https://gcc.gnu.org/g:c9db5322ae39a49db0728a0a4cb5003efb6ae668

commit r15-5051-gc9db5322ae39a49db0728a0a4cb5003efb6ae668
Author: John David Anglin <dang...@gcc.gnu.org>
Date:   Fri Nov 8 16:54:48 2024 -0500

    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:
---
 gcc/config/pa/predicates.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/pa/predicates.md b/gcc/config/pa/predicates.md
index 0defd2282fbf..a27b2b1c78db 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;

Reply via email to