]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hppa: Don't use '%' operator in base14_operand
authorJohn David Anglin <danglin@gcc.gnu.org>
Fri, 8 Nov 2024 21:54:48 +0000 (16:54 -0500)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 8 Nov 2024 21:54:48 +0000 (16:54 -0500)
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.

gcc/config/pa/predicates.md

index 0defd2282fbf792c888bf0ff2fcfca254ac39edb..a27b2b1c78dbb4067c501e7ac942925998ce7bb3 100644 (file)
       return false;
 
     default:
-      return (INTVAL (op) % GET_MODE_SIZE (mode)) == 0;
+      return (INTVAL (op) & (GET_MODE_SIZE (mode) - 1)) == 0;
     }
 
   return false;