Commit fd14d6cb by Segher Boessenkool Committed by Segher Boessenkool

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
parent 2afeb1ca
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> 2019-11-08 Andre Vieira <andre.simoesdiasvieira@arm.com>
PR tree-optimization/92351 PR tree-optimization/92351
...@@ -1134,10 +1134,14 @@ ...@@ -1134,10 +1134,14 @@
;; validate_condition_mode is an assertion. ;; validate_condition_mode is an assertion.
(define_predicate "branch_comparison_operator" (define_predicate "branch_comparison_operator"
(and (match_operand 0 "comparison_operator") (and (match_operand 0 "comparison_operator")
(and (match_test "GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC") (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), (match_test "validate_condition_mode (GET_CODE (op),
GET_MODE (XEXP (op, 0))), GET_MODE (XEXP (op, 0))),
1")))) 1")))
;; Return 1 if OP is an unsigned comparison operator. ;; Return 1 if OP is an unsigned comparison operator.
(define_predicate "unsigned_comparison_operator" (define_predicate "unsigned_comparison_operator"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment