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  <dang...@gcc.gnu.org>

gcc/ChangeLog:

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

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;

Attachment: signature.asc
Description: PGP signature

Reply via email to