diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2019-11-08 15:53:42 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2019-11-08 15:53:42 +0100 |
commit | fd14d6cbc4c82fd22a77d7c38ec37b5c8a97f23c (patch) | |
tree | e2d8d4ee4efa2e435bea0608a7a1001de65dc965 | |
parent | 2afeb1ca38dbb7c8708272452417426e46b4d6ed (diff) | |
download | gcc-fd14d6cbc4c82fd22a77d7c38ec37b5c8a97f23c.zip gcc-fd14d6cbc4c82fd22a77d7c38ec37b5c8a97f23c.tar.gz gcc-fd14d6cbc4c82fd22a77d7c38ec37b5c8a97f23c.tar.bz2 |
rs6000: Fix branch_comparison_operator
* config/rs6000/predicates.md (branch_comparison_operator): Allow only
the comparison codes that make sense for the mode used, and only the
codes that can be done with a single branch instruction.
From-SVN: r277976
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/predicates.md | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b61665d..c68960c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-08 Segher Boessenkool <segher@kernel.crashing.org> + + * config/rs6000/predicates.md (branch_comparison_operator): Allow only + the comparison codes that make sense for the mode used, and only the + codes that can be done with a single branch instruction. + 2019-11-08 Andre Vieira <andre.simoesdiasvieira@arm.com> PR tree-optimization/92351 diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 51cdd3a..d0c3f9a 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -1134,10 +1134,14 @@ ;; validate_condition_mode is an assertion. (define_predicate "branch_comparison_operator" (and (match_operand 0 "comparison_operator") - (and (match_test "GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC") - (match_test "validate_condition_mode (GET_CODE (op), - GET_MODE (XEXP (op, 0))), - 1")))) + (match_test "GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC") + (if_then_else (match_test "GET_MODE (XEXP (op, 0)) == CCFPmode + && !flag_finite_math_only") + (match_code "lt,gt,eq,unordered,unge,unle,ne,ordered") + (match_code "lt,ltu,le,leu,gt,gtu,ge,geu,eq,ne")) + (match_test "validate_condition_mode (GET_CODE (op), + GET_MODE (XEXP (op, 0))), + 1"))) ;; Return 1 if OP is an unsigned comparison operator. (define_predicate "unsigned_comparison_operator" |