rs6000.md (f32_vsx): New mode attributes to refine the constraints used on 32/64...
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Tue, 23 Sep 2014 17:11:07 +0000 (17:11 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Tue, 23 Sep 2014 17:11:07 +0000 (17:11 +0000)
2014-09-23  Michael Meissner  <meissner@linux.vnet.ibm.com>

* config/rs6000/rs6000.md (f32_vsx): New mode attributes to
refine the constraints used on 32/64-bit floating point moves.
(f32_av): Likewise.
(f64_vsx): Likewise.
(f64_dm): Likewise.
(f64_av): Likewise.
(BOOL_REGS_OUTPUT): Use wt constraint for TImode instead of wa.
(BOOL_REGS_OP1): Likewise.
(BOOL_REGS_OP2): Likewise.
(BOOL_REGS_UNARY): Likewise.
(mov<mode>_hardfloat, SFmode/SDmode): Tighten down constraints for
32/64-bit floating point moves.  Do not use wa, instead use ww/ws
for moves involving VSX registers.  Do not use constraints that
target VSX registers for decimal types.
(mov<mode>_hardfloat32, DFmode/DDmode): Likewise.
(mov<mode>_hardfloat64, DFmode/DDmode): Likewise.

From-SVN: r215521

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index a8bff8f5acd860d123f338776913e800ff901f8b..62369c7500b84bc5dbc813d7848be83f9186618d 100644 (file)
@@ -1,3 +1,22 @@
+2014-09-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       * config/rs6000/rs6000.md (f32_vsx): New mode attributes to
+       refine the constraints used on 32/64-bit floating point moves.
+       (f32_av): Likewise.
+       (f64_vsx): Likewise.
+       (f64_dm): Likewise.
+       (f64_av): Likewise.
+       (BOOL_REGS_OUTPUT): Use wt constraint for TImode instead of wa.
+       (BOOL_REGS_OP1): Likewise.
+       (BOOL_REGS_OP2): Likewise.
+       (BOOL_REGS_UNARY): Likewise.
+       (mov<mode>_hardfloat, SFmode/SDmode): Tighten down constraints for
+       32/64-bit floating point moves.  Do not use wa, instead use ww/ws
+       for moves involving VSX registers.  Do not use constraints that
+       target VSX registers for decimal types.
+       (mov<mode>_hardfloat32, DFmode/DDmode): Likewise.
+       (mov<mode>_hardfloat64, DFmode/DDmode): Likewise.
+
 2014-09-23  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree.h (int_bit_position): Turn into inline function;
index ae33e557e957f9b28de6119e00cdb745b0dcb02b..8ce53a5069cc616ad91f0134b46619c58e5c21fa 100644 (file)
 (define_mode_attr f32_sv [(SF "stxsspx %x1,%y0")  (SD "stxsiwzx %x1,%y0")])
 
 ; Definitions for 32-bit fpr direct move
+; At present, the decimal modes are not allowed in the traditional altivec
+; registers, so restrict the constraints to just the traditional FPRs.
 (define_mode_attr f32_dm [(SF "wn") (SD "wh")])
 
+; Definitions for 32-bit VSX
+(define_mode_attr f32_vsx [(SF "ww") (SD "wn")])
+
+; Definitions for 32-bit use of altivec registers
+(define_mode_attr f32_av  [(SF "wu") (SD "wn")])
+
+; Definitions for 64-bit VSX
+(define_mode_attr f64_vsx [(DF "ws") (DD "wn")])
+
+; Definitions for 64-bit direct move
+(define_mode_attr f64_dm  [(DF "wk") (DD "wh")])
+
+; Definitions for 64-bit use of altivec registers
+(define_mode_attr f64_av  [(DF "wv") (DD "wn")])
+
 ; These modes do not fit in integer registers in 32-bit mode.
 ; but on e500v2, the gpr are 64 bit registers
 (define_mode_iterator DIFD [DI (DF "!TARGET_E500_DOUBLE") DD])
 ;; either.
 
 ;; Mode attribute for boolean operation register constraints for output
-(define_mode_attr BOOL_REGS_OUTPUT     [(TI    "&r,r,r,wa,v")
+(define_mode_attr BOOL_REGS_OUTPUT     [(TI    "&r,r,r,wt,v")
                                         (PTI   "&r,r,r")
                                         (V16QI "wa,v,&?r,?r,?r")
                                         (V8HI  "wa,v,&?r,?r,?r")
                                         (V1TI  "wa,v,&?r,?r,?r")])
 
 ;; Mode attribute for boolean operation register constraints for operand1
-(define_mode_attr BOOL_REGS_OP1                [(TI    "r,0,r,wa,v")
+(define_mode_attr BOOL_REGS_OP1                [(TI    "r,0,r,wt,v")
                                         (PTI   "r,0,r")
                                         (V16QI "wa,v,r,0,r")
                                         (V8HI  "wa,v,r,0,r")
                                         (V1TI  "wa,v,r,0,r")])
 
 ;; Mode attribute for boolean operation register constraints for operand2
-(define_mode_attr BOOL_REGS_OP2                [(TI    "r,r,0,wa,v")
+(define_mode_attr BOOL_REGS_OP2                [(TI    "r,r,0,wt,v")
                                         (PTI   "r,r,0")
                                         (V16QI "wa,v,r,r,0")
                                         (V8HI  "wa,v,r,r,0")
 ;; Mode attribute for boolean operation register constraints for operand1
 ;; for one_cmpl.  To simplify things, we repeat the constraint where 0
 ;; is used for operand1 or operand2
-(define_mode_attr BOOL_REGS_UNARY      [(TI    "r,0,0,wa,v")
+(define_mode_attr BOOL_REGS_UNARY      [(TI    "r,0,0,wt,v")
                                         (PTI   "r,0,0")
                                         (V16QI "wa,v,r,0,0")
                                         (V8HI  "wa,v,r,0,0")
 }")
 
 (define_insn "mov<mode>_hardfloat"
-  [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,wa,wa,<f32_lr>,<f32_sm>,wu,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
-       (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,wa,j,<f32_lm>,<f32_sr>,Z,wu,r,<f32_dm>,r,h,0,G,Fn"))]
+  [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,<f32_vsx>,<f32_vsx>,<f32_lr>,<f32_sm>,<f32_av>,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
+       (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,<f32_vsx>,j,<f32_lm>,<f32_sr>,Z,<f32_av>,r,<f32_dm>,r, h, 0, G,Fn"))]
   "(gpc_reg_operand (operands[0], <MODE>mode)
    || gpc_reg_operand (operands[1], <MODE>mode))
    && (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
 ;; reloading.
 
 (define_insn "*mov<mode>_hardfloat32"
-  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,!r,!r,!r")
-       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,G,H,F"))]
+  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,!r,!r,!r")
+       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,G,H,F"))]
   "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT 
    && (gpc_reg_operand (operands[0], <MODE>mode)
        || gpc_reg_operand (operands[1], <MODE>mode))"
 ; ld/std require word-aligned displacements -> 'Y' constraint.
 ; List Y->r and r->Y before r->r for reload.
 (define_insn "*mov<mode>_hardfloat64"
-  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,wk")
-       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wk,r"))]
+  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,<f64_dm>")
+       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,r,h,0,G,H,F,wg,r,<f64_dm>,r"))]
   "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
    && (gpc_reg_operand (operands[0], <MODE>mode)
        || gpc_reg_operand (operands[1], <MODE>mode))"