From ba94c7af45cf628c815208b4a961138ef279fe1a Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sat, 11 Jun 2011 12:10:08 +0200 Subject: [PATCH] i386.md: Use default value in "isa" attribute. * config/i386/i386.md: Use default value in "isa" attribute. * config/i386/sse.md: Ditto. * config/i386/mmx.md: Ditto. From-SVN: r174945 --- gcc/config/i386/i386.md | 6 +- gcc/config/i386/mmx.md | 62 ++++++++++++++++--- gcc/config/i386/sse.md | 134 +++++++++++++++++++++++----------------- 3 files changed, 136 insertions(+), 66 deletions(-) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index b01435ce2c3..204cb4fa9c8 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2151,7 +2151,7 @@ [(set (attr "isa") (if_then_else (eq_attr "alternative" "9,10,11,12") (const_string "noavx") - (const_string "base"))) + (const_string "*"))) (set (attr "type") (cond [(eq_attr "alternative" "0,1") (const_string "multi") @@ -12700,7 +12700,7 @@ (if_then_else (match_operand:MODEF 3 "mult_operator" "") (const_string "fmul") (const_string "fop")))) - (set_attr "isa" "base,noavx,avx") + (set_attr "isa" "*,noavx,avx") (set_attr "prefix" "orig,orig,vex") (set_attr "mode" "")]) @@ -12760,7 +12760,7 @@ (const_string "fdiv") ] (const_string "fop"))) - (set_attr "isa" "base,base,noavx,avx") + (set_attr "isa" "*,*,noavx,avx") (set_attr "prefix" "orig,orig,orig,vex") (set_attr "mode" "")]) diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index f56fb227b1a..f3b949ef02a 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -85,7 +85,19 @@ %vmovq\t{%1, %0|%0, %1} %vmovd\t{%1, %0|%0, %1} %vmovd\t{%1, %0|%0, %1}" - [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,ssemov") + [(set (attr "type") + (cond [(eq_attr "alternative" "0,1") + (const_string "imov") + (eq_attr "alternative" "2") + (const_string "mmx") + (eq_attr "alternative" "3,4,5") + (const_string "mmxmov") + (eq_attr "alternative" "6,7") + (const_string "ssecvt") + (eq_attr "alternative" "8") + (const_string "sselog1") + ] + (const_string "ssemov"))) (set_attr "unit" "*,*,*,*,*,*,mmx,mmx,*,*,*,*,*") (set_attr "prefix_rep" "*,*,*,*,*,*,1,1,*,1,*,*,*") (set_attr "prefix_data16" "*,*,*,*,*,*,*,*,*,*,1,1,1") @@ -125,8 +137,20 @@ [(set (attr "isa") (if_then_else (eq_attr "alternative" "9,10,11,12") (const_string "noavx") - (const_string "base"))) - (set_attr "type" "mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov,*,*") + (const_string "*"))) + (set (attr "type") + (cond [(eq_attr "alternative" "0") + (const_string "mmx") + (eq_attr "alternative" "1,2,3") + (const_string "mmxmov") + (eq_attr "alternative" "4,5") + (const_string "ssecvt") + (eq_attr "alternative" "6,9") + (const_string "sselog1") + (eq_attr "alternative" "13,14") + (const_string "multi") + ] + (const_string "ssemov"))) (set_attr "unit" "*,*,*,*,mmx,mmx,*,*,*,*,*,*,*,*,*") (set (attr "prefix_rep") (if_then_else @@ -179,7 +203,19 @@ %vmovlps\t{%1, %0|%0, %1} %vmovd\t{%1, %0|%0, %1} %vmovd\t{%1, %0|%0, %1}" - [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov") + [(set (attr "type") + (cond [(eq_attr "alternative" "0,1") + (const_string "imov") + (eq_attr "alternative" "2") + (const_string "mmx") + (eq_attr "alternative" "3,4,5") + (const_string "mmxmov") + (eq_attr "alternative" "6,7") + (const_string "ssecvt") + (eq_attr "alternative" "9") + (const_string "sselog1") + ] + (const_string "ssemov"))) (set_attr "unit" "*,*,*,*,*,*,mmx,mmx,*,*,*,*,*,*") (set_attr "prefix_rep" "*,*,*,*,*,*,1,1,*,*,*,*,*,*") (set (attr "length_vex") @@ -214,7 +250,19 @@ %vmovlps\t{%1, %0|%0, %1} # #" - [(set_attr "type" "mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,*,*") + [(set (attr "type") + (cond [(eq_attr "alternative" "0") + (const_string "mmx") + (eq_attr "alternative" "1,2,3") + (const_string "mmxmov") + (eq_attr "alternative" "4,5") + (const_string "ssecvt") + (eq_attr "alternative" "6") + (const_string "sselog1") + (eq_attr "alternative" "10,11") + (const_string "multi") + ] + (const_string "ssemov"))) (set_attr "unit" "*,*,*,*,mmx,mmx,*,*,*,*,*,*") (set_attr "prefix_rep" "*,*,*,*,1,1,*,*,*,*,*,*") (set (attr "prefix") @@ -228,8 +276,8 @@ [(set (match_operand:MMXMODE 0 "nonimmediate_operand" "") (match_operand:MMXMODE 1 "general_operand" ""))] "!TARGET_64BIT && reload_completed - && (!MMX_REG_P (operands[0]) && !SSE_REG_P (operands[0])) - && (!MMX_REG_P (operands[1]) && !SSE_REG_P (operands[1]))" + && !(MMX_REG_P (operands[0]) || SSE_REG_P (operands[0]) + || MMX_REG_P (operands[1]) || SSE_REG_P (operands[1]))" [(const_int 0)] "ix86_split_long_move (operands); DONE;") diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index b3982af5ec0..0dd4c304d67 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -2792,7 +2792,7 @@ movlps\t{%H2, %0|%0, %H2} vmovlps\t{%H2, %1, %0|%0, %1, %H2} %vmovhps\t{%2, %0|%0, %2}" - [(set_attr "isa" "noavx,avx,noavx,avx,base") + [(set_attr "isa" "noavx,avx,noavx,avx,*") (set_attr "type" "ssemov") (set_attr "prefix" "orig,vex,orig,vex,maybe_vex") (set_attr "mode" "V4SF,V4SF,V2SF,V2SF,V2SF")]) @@ -2837,7 +2837,7 @@ movhps\t{%2, %0|%0, %2} vmovhps\t{%2, %1, %0|%0, %1, %2} %vmovlps\t{%2, %H0|%H0, %2}" - [(set_attr "isa" "noavx,avx,noavx,avx,base") + [(set_attr "isa" "noavx,avx,noavx,avx,*") (set_attr "type" "ssemov") (set_attr "prefix" "orig,vex,orig,vex,maybe_vex") (set_attr "mode" "V4SF,V4SF,V2SF,V2SF,V2SF")]) @@ -3200,7 +3200,7 @@ movlhps\t{%2, %0|%0, %2} vmovlhps\t{%2, %1, %0|%0, %1, %2} %vmovlps\t{%2, %H0|%H0, %2}" - [(set_attr "isa" "noavx,avx,noavx,avx,base") + [(set_attr "isa" "noavx,avx,noavx,avx,*") (set_attr "type" "ssemov") (set_attr "prefix" "orig,vex,orig,vex,maybe_vex") (set_attr "mode" "V2SF,V2SF,V4SF,V4SF,V2SF")]) @@ -3253,7 +3253,7 @@ movlps\t{%2, %0|%0, %2} vmovlps\t{%2, %1, %0|%0, %1, %2} %vmovlps\t{%2, %0|%0, %2}" - [(set_attr "isa" "noavx,avx,noavx,avx,base") + [(set_attr "isa" "noavx,avx,noavx,avx,*") (set_attr "type" "sselog,sselog,ssemov,ssemov,ssemov") (set_attr "length_immediate" "1,1,*,*,*") (set_attr "prefix" "orig,vex,orig,vex,maybe_vex") @@ -3324,7 +3324,7 @@ %vmovss\t{%1, %0|%0, %1} punpckldq\t{%2, %0|%0, %2} movd\t{%1, %0|%0, %1}" - [(set_attr "isa" "noavx,avx,noavx,avx,base,base,base") + [(set_attr "isa" "noavx,avx,noavx,avx,*,*,*") (set_attr "type" "sselog,sselog,sselog,sselog,ssemov,mmxcvt,mmxmov") (set_attr "prefix_data16" "*,*,1,*,*,*,*") (set_attr "prefix_extra" "*,*,1,1,*,*,*") @@ -3378,11 +3378,11 @@ ;; see comment above inline_secondary_memory_needed function in i386.c (define_insn "vec_set_0" [(set (match_operand:VI4F_128 0 "nonimmediate_operand" - "=Y4,Y2,Y2,x,x,x,Y4 ,x ,m,m,m") + "=Y4,Y2,Y2,x,x,x,Y4 ,x ,m,m ,m") (vec_merge:VI4F_128 (vec_duplicate:VI4F_128 (match_operand: 2 "general_operand" - " Y4,m ,*r,m,x,x,*rm,*rm,x,*r,fF")) + " Y4,m ,*r,m,x,x,*rm,*rm,x,fF,*r")) (match_operand:VI4F_128 1 "vector_move_operand" " C ,C ,C ,C,0,x,0 ,x ,0,0 ,0") (const_int 1)))] @@ -3399,8 +3399,16 @@ # # #" - [(set_attr "isa" "base,base,base,noavx,noavx,avx,noavx,avx,base,base,base") - (set_attr "type" "sselog,ssemov,ssemov,ssemov,ssemov,ssemov,sselog,sselog,*,*,*") + [(set_attr "isa" "*,*,*,noavx,noavx,avx,noavx,avx,*,*,*") + (set (attr "type") + (cond [(eq_attr "alternative" "0,6,7") + (const_string "sselog") + (eq_attr "alternative" "9") + (const_string "fmov") + (eq_attr "alternative" "10") + (const_string "imov") + ] + (const_string "ssemov"))) (set_attr "prefix_extra" "*,*,*,*,*,*,1,1,*,*,*") (set_attr "length_immediate" "*,*,*,*,*,*,1,1,*,*,*") (set_attr "prefix" "maybe_vex,maybe_vex,maybe_vex,orig,orig,vex,orig,vex,*,*,*") @@ -3820,7 +3828,7 @@ movlpd\t{%H1, %0|%0, %H1} vmovlpd\t{%H1, %2, %0|%0, %2, %H1} %vmovhpd\t{%1, %0|%0, %1}" - [(set_attr "isa" "noavx,avx,base,noavx,avx,base") + [(set_attr "isa" "noavx,avx,*,noavx,avx,*") (set_attr "type" "sselog,sselog,sselog,ssemov,ssemov,ssemov") (set_attr "prefix_data16" "*,*,*,1,*,1") (set_attr "prefix" "orig,vex,maybe_vex,orig,vex,maybe_vex") @@ -3922,7 +3930,7 @@ movhpd\t{%2, %0|%0, %2} vmovhpd\t{%2, %1, %0|%0, %1, %2} %vmovlpd\t{%2, %H0|%H0, %2}" - [(set_attr "isa" "noavx,avx,base,noavx,avx,base") + [(set_attr "isa" "noavx,avx,*,noavx,avx,*") (set_attr "type" "sselog,sselog,sselog,ssemov,ssemov,ssemov") (set_attr "prefix_data16" "*,*,*,1,*,1") (set_attr "prefix" "orig,vex,maybe_vex,orig,vex,maybe_vex") @@ -4128,7 +4136,7 @@ # # #" - [(set_attr "isa" "base,noavx,avx,base,base,base") + [(set_attr "isa" "*,noavx,avx,*,*,*") (set_attr "type" "ssemov,sselog1,sselog1,ssemov,fmov,imov") (set (attr "prefix_data16") (if_then_else @@ -4148,6 +4156,20 @@ [(set (match_dup 0) (match_dup 1))] "operands[1] = adjust_address (operands[1], DFmode, 8);") +(define_insn "*vec_extractv2df_1_sse" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x") + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,x,o") + (parallel [(const_int 1)])))] + "!TARGET_SSE2 && TARGET_SSE + && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movhps\t{%1, %0|%0, %1} + movhlps\t{%1, %0|%0, %1} + movlps\t{%H1, %0|%0, %H1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + ;; Avoid combining registers from different units in a single alternative, ;; see comment above inline_secondary_memory_needed function in i386.c (define_insn "sse2_storelpd" @@ -4184,6 +4206,20 @@ DONE; }) +(define_insn "*vec_extractv2df_0_sse" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x") + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,x,m") + (parallel [(const_int 0)])))] + "!TARGET_SSE2 && TARGET_SSE + && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movlps\t{%1, %0|%0, %1} + movaps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + (define_expand "sse2_loadhpd_exp" [(set (match_operand:V2DF 0 "nonimmediate_operand" "") (vec_concat:V2DF @@ -4225,7 +4261,7 @@ # # #" - [(set_attr "isa" "noavx,avx,noavx,avx,base,base,base") + [(set_attr "isa" "noavx,avx,noavx,avx,*,*,*") (set_attr "type" "ssemov,ssemov,sselog,sselog,ssemov,fmov,imov") (set_attr "prefix_data16" "1,*,*,*,*,*,*") (set_attr "prefix" "orig,vex,orig,vex,*,*,*") @@ -4285,8 +4321,16 @@ # # #" - [(set_attr "isa" "base,noavx,avx,noavx,avx,noavx,noavx,avx,base,base,base") - (set_attr "type" "ssemov,ssemov,ssemov,ssemov,ssemov,sselog,ssemov,ssemov,ssemov,fmov,imov") + [(set_attr "isa" "*,noavx,avx,noavx,avx,noavx,noavx,avx,*,*,*") + (set (attr "type") + (cond [(eq_attr "alternative" "5") + (const_string "sselog") + (eq_attr "alternative" "9") + (const_string "fmov") + (eq_attr "alternative" "10") + (const_string "imov") + ] + (const_string "ssemov"))) (set_attr "prefix_data16" "*,1,*,*,*,*,1,*,*,*,*") (set_attr "length_immediate" "*,*,*,*,*,1,*,*,*,*,*") (set_attr "prefix" "maybe_vex,orig,vex,orig,vex,orig,orig,vex,*,*,*") @@ -4301,36 +4345,6 @@ [(set (match_dup 0) (match_dup 1))] "operands[0] = adjust_address (operands[0], DFmode, 8);") -;; Not sure these two are ever used, but it doesn't hurt to have -;; them. -aoliva -(define_insn "*vec_extractv2df_1_sse" - [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x") - (vec_select:DF - (match_operand:V2DF 1 "nonimmediate_operand" "x,x,o") - (parallel [(const_int 1)])))] - "!TARGET_SSE2 && TARGET_SSE - && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "@ - movhps\t{%1, %0|%0, %1} - movhlps\t{%1, %0|%0, %1} - movlps\t{%H1, %0|%0, %H1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "V2SF,V4SF,V2SF")]) - -(define_insn "*vec_extractv2df_0_sse" - [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x") - (vec_select:DF - (match_operand:V2DF 1 "nonimmediate_operand" "x,x,m") - (parallel [(const_int 0)])))] - "!TARGET_SSE2 && TARGET_SSE - && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "@ - movlps\t{%1, %0|%0, %1} - movaps\t{%1, %0|%0, %1} - movlps\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "V2SF,V4SF,V2SF")]) - (define_insn "sse2_movsd" [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,x,m,x,x,x,o") (vec_merge:V2DF @@ -4348,8 +4362,12 @@ movhps\t{%H1, %0|%0, %H1} vmovhps\t{%H1, %2, %0|%0, %2, %H1} %vmovhps\t{%1, %H0|%H0, %1}" - [(set_attr "isa" "noavx,avx,noavx,avx,base,noavx,noavx,avx,base") - (set_attr "type" "ssemov,ssemov,ssemov,ssemov,ssemov,sselog,ssemov,ssemov,ssemov") + [(set_attr "isa" "noavx,avx,noavx,avx,*,noavx,noavx,avx,*") + (set (attr "type") + (if_then_else + (eq_attr "alternative" "5") + (const_string "sselog") + (const_string "ssemov"))) (set (attr "prefix_data16") (if_then_else (and (eq_attr "alternative" "2,4") @@ -4404,8 +4422,12 @@ %vmovsd\t{%1, %0|%0, %1} movlhps\t{%2, %0|%0, %2} movhps\t{%2, %0|%0, %2}" - [(set_attr "isa" "noavx,avx,noavx,avx,base,noavx,noavx") - (set_attr "type" "sselog,sselog,ssemov,ssemov,ssemov,ssemov,ssemov") + [(set_attr "isa" "noavx,avx,noavx,avx,*,noavx,noavx") + (set (attr "type") + (if_then_else + (eq_attr "alternative" "0,1") + (const_string "sselog") + (const_string "ssemov"))) (set_attr "prefix_data16" "*,*,1,*,*,*,*") (set_attr "prefix" "orig,vex,orig,vex,maybe_vex,orig,orig") (set_attr "mode" "V2DF,V2DF,V1DF,V1DF,DF,V4SF,V2SF")]) @@ -6305,7 +6327,7 @@ movss\t{%2, %0|%0, %2} movss\t{%2, %0|%0, %2} vmovss\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "isa" "base,base,noavx,noavx,avx") + [(set_attr "isa" "*,*,noavx,noavx,avx") (set_attr "type" "ssemov") (set_attr "prefix" "maybe_vex,maybe_vex,orig,orig,vex") (set_attr "mode" "TI,TI,V4SF,SF,SF")]) @@ -6393,7 +6415,7 @@ vpsrldq\t{$8, %1, %0|%0, %1, 8} %vmovq\t{%H1, %0|%0, %H1} mov{q}\t{%H1, %0|%0, %H1}" - [(set_attr "isa" "base,noavx,avx,base,base") + [(set_attr "isa" "*,noavx,avx,*,*") (set_attr "type" "ssemov,sseishft1,sseishft1,ssemov,imov") (set_attr "length_immediate" "*,1,1,*,*") (set_attr "memory" "*,none,none,*,*") @@ -6414,7 +6436,7 @@ %vmovq\t{%H1, %0|%0, %H1} movhlps\t{%1, %0|%0, %1} movlps\t{%H1, %0|%0, %H1}" - [(set_attr "isa" "base,noavx,avx,base,noavx,noavx") + [(set_attr "isa" "*,noavx,avx,*,noavx,noavx") (set_attr "type" "ssemov,sseishft1,sseishft1,ssemov,ssemov,ssemov") (set_attr "length_immediate" "*,1,1,*,*,*") (set_attr "memory" "*,none,none,*,*,*") @@ -6456,7 +6478,7 @@ punpcklqdq\t%0, %0 vpunpcklqdq\t{%d1, %0|%0, %d1} %vmovddup\t{%1, %0|%0, %1}" - [(set_attr "isa" "noavx,avx,base") + [(set_attr "isa" "noavx,avx,*") (set_attr "type" "sselog1") (set_attr "prefix" "orig,vex,maybe_vex") (set_attr "mode" "TI,TI,DF")]) @@ -6486,7 +6508,7 @@ %vmovd\t{%1, %0|%0, %1} punpckldq\t{%2, %0|%0, %2} movd\t{%1, %0|%0, %1}" - [(set_attr "isa" "noavx,avx,noavx,avx,base,base,base") + [(set_attr "isa" "noavx,avx,noavx,avx,*,*,*") (set_attr "type" "sselog,sselog,sselog,sselog,ssemov,mmxcvt,mmxmov") (set_attr "prefix_extra" "1,1,*,*,*,*,*") (set_attr "length_immediate" "1,1,*,*,*,*,*") @@ -6561,7 +6583,7 @@ vpunpcklqdq\t{%2, %1, %0|%0, %1, %2} movhps\t{%2, %0|%0, %2} vmovhps\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "isa" "noavx,avx,base,base,base,noavx,avx,noavx,avx") + [(set_attr "isa" "noavx,avx,*,*,*,noavx,avx,noavx,avx") (set (attr "type") (if_then_else (eq_attr "alternative" "0,1,5,6") @@ -6592,7 +6614,7 @@ movlhps\t{%2, %0|%0, %2} movhps\t{%2, %0|%0, %2} vmovhps\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "isa" "base,base,noavx,avx,noavx,noavx,avx") + [(set_attr "isa" "*,*,noavx,avx,noavx,noavx,avx") (set_attr "type" "ssemov,ssemov,sselog,sselog,ssemov,ssemov,ssemov") (set_attr "prefix" "maybe_vex,orig,orig,vex,orig,orig,vex") (set_attr "mode" "TI,TI,TI,TI,V4SF,V2SF,V2SF")]) -- 2.30.2