aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2021-04-29 15:24:51 +0200
committerUros Bizjak <ubizjak@gmail.com>2021-04-29 15:25:39 +0200
commitd03ca8a6148f55e119b8220a9c65147173b32065 (patch)
tree34f03b9e4ea194fe7cac42bdeacf0a5ebf97e942 /gcc/config
parentfc14ff611181c274584c7963bc597a6ca50c20a1 (diff)
downloadgcc-d03ca8a6148f55e119b8220a9c65147173b32065.zip
gcc-d03ca8a6148f55e119b8220a9c65147173b32065.tar.gz
gcc-d03ca8a6148f55e119b8220a9c65147173b32065.tar.bz2
i386: Cleanup comparison predicates.
CCCmode is allowed only with GEU and LTU comparison codes. Also allow CCGZmode for these two codes. There is no need to check for trivial FP comparison operator, ix86_fp_compare_code_to_integer will return UNKNOWN code for unsupported operators. 2021-04-29 Uroš Bizjak <ubizjak@gmail.com> gcc/ * config/i386/predicates.md (fcmov_comparison_operator): Do not check for trivial FP comparison operator. <case GEU, case LTU>: Allow CCGZmode. <case GTU, case LEU>: Do not allow CCCmode. (ix86_comparison_operator) <case GTU, case LEU>: Allow only CCmode. (ix86_carry_flag_operator): Match only LTU and UNLT code. Do not check for trivial FP comparison operator. Allow CCGZmode.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/predicates.md31
1 files changed, 13 insertions, 18 deletions
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index b1df854..04a03a7 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -1352,16 +1352,17 @@
enum rtx_code code = GET_CODE (op);
if (inmode == CCFPmode)
- {
- if (!ix86_trivial_fp_comparison_operator (op, mode))
- return false;
- code = ix86_fp_compare_code_to_integer (code);
- }
+ code = ix86_fp_compare_code_to_integer (code);
+
/* i387 supports just limited amount of conditional codes. */
switch (code)
{
- case LTU: case GTU: case LEU: case GEU:
- if (inmode == CCmode || inmode == CCFPmode || inmode == CCCmode)
+ case GEU: case LTU:
+ if (inmode == CCCmode || inmode == CCGZmode)
+ return true;
+ /* FALLTHRU */
+ case GTU: case LEU:
+ if (inmode == CCmode || inmode == CCFPmode)
return true;
return false;
case ORDERED: case UNORDERED:
@@ -1418,11 +1419,11 @@
return true;
return false;
case GEU: case LTU:
- if (inmode == CCGZmode)
+ if (inmode == CCCmode || inmode == CCGZmode)
return true;
/* FALLTHRU */
case GTU: case LEU:
- if (inmode == CCmode || inmode == CCCmode || inmode == CCGZmode)
+ if (inmode == CCmode)
return true;
return false;
case ORDERED: case UNORDERED:
@@ -1441,20 +1442,14 @@
;; Return true if OP is a valid comparison operator
;; testing carry flag to be set.
(define_predicate "ix86_carry_flag_operator"
- (match_code "ltu,lt,unlt,gtu,gt,ungt,le,unle,ge,unge,ltgt,uneq")
+ (match_code "ltu,unlt")
{
machine_mode inmode = GET_MODE (XEXP (op, 0));
enum rtx_code code = GET_CODE (op);
if (inmode == CCFPmode)
- {
- if (!ix86_trivial_fp_comparison_operator (op, mode))
- return false;
- code = ix86_fp_compare_code_to_integer (code);
- }
- else if (inmode == CCCmode)
- return code == LTU || code == GTU;
- else if (inmode != CCmode)
+ code = ix86_fp_compare_code_to_integer (code);
+ else if (inmode != CCmode && inmode != CCCmode && inmode != CCGZmode)
return false;
return code == LTU;