diff mbox series

[committed] hppa: Don't use '%' operator in base14_operand

Message ID Zy6KffQpqBEaisrr@mx3210.local
State New
Headers show
Series [committed] hppa: Don't use '%' operator in base14_operand | expand

Commit Message

John David Anglin Nov. 8, 2024, 10:02 p.m. UTC
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.  Committed
to trunk and gcc-14.

Dave
---

hppa: Don't use '%' operator in base14_operand

Division is slow on hppa and mode sizes are powers of 2.  So, we
can use '&' operator to check displacement alignment.

2024-11-08  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	* config/pa/predicates.md (base14_operand): Use '&' operator
	instead of '%' to check displacement alignment.
diff mbox series

Patch

diff --git a/gcc/config/pa/predicates.md b/gcc/config/pa/predicates.md
index 0defd2282fb..a27b2b1c78d 100644
--- a/gcc/config/pa/predicates.md
+++ b/gcc/config/pa/predicates.md
@@ -285,7 +285,7 @@ 
       return false;
 
     default:
-      return (INTVAL (op) % GET_MODE_SIZE (mode)) == 0;
+      return (INTVAL (op) & (GET_MODE_SIZE (mode) - 1)) == 0;
     }
 
   return false;