From: Uros Bizjak Date: Mon, 4 May 2015 19:50:51 +0000 (+0200) Subject: i386.c: Change GET_CODE (...) == CONST_DOUBLE check to CONST_DOUBLE_P predicate. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f4eb706df3bf10b82f571b0910df14317d1ff27;p=gcc.git i386.c: Change GET_CODE (...) == CONST_DOUBLE check to CONST_DOUBLE_P predicate. * config/i386/i386.c: Change GET_CODE (...) == CONST_DOUBLE check to CONST_DOUBLE_P predicate. (standard_sse_constant_p): Return 0 for !TARGET_SSE. (ix86_legitimate_constant_p) : For 32bit targets, allow only operands that satisfy standard_sse_constant_p predicate. * config/i386/i386.md: Change GET_CODE (...) == CONST_DOUBLE check to CONST_DOUBLE_P predicate. From-SVN: r222774 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c3b0c3dd0f6..c16c1d05962 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2015-05-04 Uros Bizjak + + * config/i386/i386.c: Change GET_CODE (...) == CONST_DOUBLE check + to CONST_DOUBLE_P predicate. + (standard_sse_constant_p): Return 0 for !TARGET_SSE. + (ix86_legitimate_constant_p) : For 32bit targets, + allow only operands that satisfy standard_sse_constant_p predicate. + * config/i386/i386.md: Change GET_CODE (...) == CONST_DOUBLE check + to CONST_DOUBLE_P predicate. + 2015-05-04 Jeff Law * match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 461094f4e26..607cfcab2ed 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9368,7 +9368,7 @@ standard_80387_constant_p (rtx x) REAL_VALUE_TYPE r; - if (!(X87_FLOAT_MODE_P (mode) && (GET_CODE (x) == CONST_DOUBLE))) + if (!(CONST_DOUBLE_P (x) && X87_FLOAT_MODE_P (mode))) return -1; if (x == CONST0_RTX (mode)) @@ -9469,9 +9469,14 @@ standard_80387_constant_rtx (int idx) int standard_sse_constant_p (rtx x) { - machine_mode mode = GET_MODE (x); + machine_mode mode; - if (x == const0_rtx || x == CONST0_RTX (GET_MODE (x))) + if (!TARGET_SSE) + return 0; + + mode = GET_MODE (x); + + if (x == const0_rtx || x == CONST0_RTX (mode)) return 1; if (vector_all_ones_operand (x, mode)) switch (mode) @@ -13078,9 +13083,7 @@ ix86_legitimate_constant_p (machine_mode, rtx x) break; case CONST_WIDE_INT: - if (GET_MODE (x) == TImode - && x != CONST0_RTX (TImode) - && !TARGET_64BIT) + if (!TARGET_64BIT && !standard_sse_constant_p (x)) return false; break; @@ -15903,7 +15906,7 @@ ix86_print_operand (FILE *file, rtx x, int code) output_address (x); } - else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == SFmode) + else if (CONST_DOUBLE_P (x) && GET_MODE (x) == SFmode) { REAL_VALUE_TYPE r; long l; @@ -15921,7 +15924,7 @@ ix86_print_operand (FILE *file, rtx x, int code) fprintf (file, "0x%08x", (unsigned int) l); } - else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == DFmode) + else if (CONST_DOUBLE_P (x) && GET_MODE (x) == DFmode) { REAL_VALUE_TYPE r; long l[2]; @@ -15935,7 +15938,7 @@ ix86_print_operand (FILE *file, rtx x, int code) } /* These float cases don't actually occur as immediate operands. */ - else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == XFmode) + else if (CONST_DOUBLE_P (x) && GET_MODE (x) == XFmode) { char dstr[30]; @@ -17364,8 +17367,7 @@ ix86_expand_move (machine_mode mode, rtx operands[]) op1 = copy_to_mode_reg (mode, op1); if (can_create_pseudo_p () - && FLOAT_MODE_P (mode) - && GET_CODE (op1) == CONST_DOUBLE) + && CONST_DOUBLE_P (op1)) { /* If we are loading a floating point constant to a register, force the value to memory now, since we'll get better code @@ -19563,7 +19565,7 @@ ix86_expand_copysign (rtx operands[]) else vmode = mode; - if (GET_CODE (op0) == CONST_DOUBLE) + if (CONST_DOUBLE_P (op0)) { rtx (*copysign_insn)(rtx, rtx, rtx, rtx); @@ -22632,7 +22634,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, machine_mode mode) for (i = 1; i < size; i++) parts[i] = adjust_address (operand, SImode, 4 * i); } - else if (GET_CODE (operand) == CONST_DOUBLE) + else if (CONST_DOUBLE_P (operand)) { REAL_VALUE_TYPE r; long l[4]; @@ -22683,7 +22685,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, machine_mode mode) parts[0] = operand; parts[1] = adjust_address (operand, upper_mode, 8); } - else if (GET_CODE (operand) == CONST_DOUBLE) + else if (CONST_DOUBLE_P (operand)) { REAL_VALUE_TYPE r; long l[4]; @@ -41208,7 +41210,7 @@ ix86_preferred_reload_class (rtx x, reg_class_t regclass) return SSE_CLASS_P (regclass) ? regclass : NO_REGS; /* Floating-point constants need more complex checks. */ - if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) != VOIDmode) + if (CONST_DOUBLE_P (x)) { /* General regs can load everything. */ if (reg_class_subset_p (regclass, GENERAL_REGS)) @@ -44551,9 +44553,9 @@ ix86_expand_vector_init (bool mmx_ok, rtx target, rtx vals) for (i = 0; i < n_elts; ++i) { x = XVECEXP (vals, 0, i); - if (!(CONST_INT_P (x) - || GET_CODE (x) == CONST_DOUBLE - || GET_CODE (x) == CONST_FIXED)) + if (!(CONST_SCALAR_INT_P (x) + || CONST_DOUBLE_P (x) + || CONST_FIXED_P (x))) n_var++, one_var = i; else if (x != CONST0_RTX (inner_mode)) all_const_zero = false; diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 55c5d06f51e..8b0830c7a1b 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2955,7 +2955,7 @@ && !(MEM_P (operands[0]) && MEM_P (operands[1])) && (!can_create_pseudo_p () || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) - || GET_CODE (operands[1]) != CONST_DOUBLE + || !CONST_DOUBLE_P (operands[1]) || (optimize_function_for_size_p (cfun) && standard_sse_constant_p (operands[1]) && !memory_operand (operands[0], TFmode)) @@ -3025,7 +3025,7 @@ "!(MEM_P (operands[0]) && MEM_P (operands[1])) && (!can_create_pseudo_p () || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) - || GET_CODE (operands[1]) != CONST_DOUBLE + || !CONST_DOUBLE_P (operands[1]) || (optimize_function_for_size_p (cfun) && standard_80387_constant_p (operands[1]) > 0 && !memory_operand (operands[0], XFmode)) @@ -3079,7 +3079,7 @@ "!(MEM_P (operands[0]) && MEM_P (operands[1])) && (!can_create_pseudo_p () || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) - || GET_CODE (operands[1]) != CONST_DOUBLE + || !CONST_DOUBLE_P (operands[1]) || (optimize_function_for_size_p (cfun) && ((!(TARGET_SSE2 && TARGET_SSE_MATH) && standard_80387_constant_p (operands[1]) > 0) @@ -3262,7 +3262,7 @@ "!(MEM_P (operands[0]) && MEM_P (operands[1])) && (!can_create_pseudo_p () || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) - || GET_CODE (operands[1]) != CONST_DOUBLE + || !CONST_DOUBLE_P (operands[1]) || (optimize_function_for_size_p (cfun) && ((!TARGET_SSE_MATH && standard_80387_constant_p (operands[1]) > 0) @@ -3961,7 +3961,7 @@ { /* ??? Needed for compress_float_constant since all fp constants are TARGET_LEGITIMATE_CONSTANT_P. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE) + if (CONST_DOUBLE_P (operands[1])) { if ((!TARGET_SSE2 || TARGET_MIX_SSE_I387) && standard_80387_constant_p (operands[1]) > 0) @@ -4077,7 +4077,7 @@ { /* ??? Needed for compress_float_constant since all fp constants are TARGET_LEGITIMATE_CONSTANT_P. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE) + if (CONST_DOUBLE_P (operands[1])) { if (standard_80387_constant_p (operands[1]) > 0) {