]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: Make the definition of xtensa_cstoresi_operator more appropriate
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Thu, 18 Dec 2025 10:27:15 +0000 (19:27 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 19 Dec 2025 11:03:04 +0000 (03:03 -0800)
The description of 'cstoremode4' in gccint says:

   "These operations may FAIL, but should do so only in relatively uncommon
    cases; if they would FAIL for common cases involving integer comparisons,
    it is best to restrict the predicates to not allow these operands."

   -- 16.10 Standard Pattern Names For Generation, gccint (the latest)

Therefore, it is preferable to include unsigned comparisons in the operator
constraints of the pattern only if the machine instructions emitted by the
pattern require such comparisons.

gcc/ChangeLog:

* config/xtensa/predicates.md (xtensa_cstoresi_operator):
Change it to include unsigned comparisons only when TARGET_SALT is
enabled.

gcc/config/xtensa/predicates.md

index 62c0f8aca20893ca6093b90a033d2fe2758e8f7c..9aebeea255b6afddfc664cf774fcd9a26025abdb 100644 (file)
   (match_code "plus,minus"))
 
 (define_predicate "xtensa_cstoresi_operator"
-  (match_code "eq,ne,gt,ge,lt,le,gtu,geu,ltu,leu"))
+  (if_then_else (match_test "TARGET_SALT")
+               (match_code "eq,ne,gt,ge,lt,le,gtu,geu,ltu,leu")
+               (match_code "eq,ne,gt,ge,lt,le")))
 
 (define_predicate "xtensa_shift_per_byte_operator"
   (match_code "ashift,ashiftrt,lshiftrt"))