]> 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:57:28 +0000 (16:57 -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 50dffa1138cad156fbb4846ef462ce532f93a3ed..74f75770676ea5e13c2dcbbb3b6ead775d10a4e0 100644 (file)
       return false;
 
     default:
-      return (INTVAL (op) % GET_MODE_SIZE (mode)) == 0;
+      return (INTVAL (op) & (GET_MODE_SIZE (mode) - 1)) == 0;
     }
 
   return false;