From e070095c0c140d54877a6ebec6b0b30d9b041023 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 26 May 2016 19:32:55 +0200 Subject: [PATCH] i386.md (*movqi_internal): Use if_then_else or cond RTXes to calculate attribute value. * config/i386/i386.md (*movqi_internal) : Use if_then_else or cond RTXes to calculate attribute value. * config/i386/mmx.md (*vec_extractv2sf_1) : Ditto. : Ditto. (*vec_extractv2sf_1) : Ditto. * config/i386/sse.md (sse_loadlps) : Ditto. (*vec_concatv2sf_sse4_1) : Ditto. : Ditto. : Ditto. : Ditto. : Ditto. : Ditto. (vec_set_0) : Ditto. : Ditto. : Ditto. : Ditto. (*vec_interleave_highv2df) : Ditto. (*vec_interleave_lowv2df) : Ditto. (sse2_storelpd) : Ditto. (sse2_loadhpd) : Ditto. (sse2_loadlpd) : Ditto. : Ditto. : Ditto. (sse2_movsd) : Ditto. : Ditto. (vec_concatv2df) : Ditto. : Ditto. (*vec_extractv4si) : Ditto. (*vec_extractv2di_1) : Ditto. : Ditto. : Ditto. : Ditto. : Ditto. (*vec_concatv2si_sse4_1) : Ditto. : Ditto. : Ditto. (vec_concatv2di) : Ditto. : Ditto. : Ditto. : Ditto. From-SVN: r236787 --- gcc/ChangeLog | 43 +++++++ gcc/config/i386/i386.md | 5 +- gcc/config/i386/mmx.md | 15 ++- gcc/config/i386/sse.md | 264 ++++++++++++++++++++++++++++++++++------ 4 files changed, 287 insertions(+), 40 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 52335d18f21..5a76af4c9e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,46 @@ +2016-05-26 Uros Bizjak + + * config/i386/i386.md (*movqi_internal) : Use + if_then_else or cond RTXes to calculate attribute value. + * config/i386/mmx.md (*vec_extractv2sf_1) : Ditto. + : Ditto. + (*vec_extractv2sf_1) : Ditto. + * config/i386/sse.md (sse_loadlps) : Ditto. + (*vec_concatv2sf_sse4_1) : Ditto. + : Ditto. + : Ditto. + : Ditto. + : Ditto. + : Ditto. + (vec_set_0) : Ditto. + : Ditto. + : Ditto. + : Ditto. + (*vec_interleave_highv2df) : Ditto. + (*vec_interleave_lowv2df) : Ditto. + (sse2_storelpd) : Ditto. + (sse2_loadhpd) : Ditto. + (sse2_loadlpd) : Ditto. + : Ditto. + : Ditto. + (sse2_movsd) : Ditto. + : Ditto. + (vec_concatv2df) : Ditto. + : Ditto. + (*vec_extractv4si) : Ditto. + (*vec_extractv2di_1) : Ditto. + : Ditto. + : Ditto. + : Ditto. + : Ditto. + (*vec_concatv2si_sse4_1) : Ditto. + : Ditto. + : Ditto. + (vec_concatv2di) : Ditto. + : Ditto. + : Ditto. + : Ditto. + 2016-05-26 Martin Liska * tree-ssa-loop-ivopts.c (comp_cost::infinite_cost_p): New diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index d20bbe431fa..6a2978ef4ff 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2594,7 +2594,10 @@ return "mov{b}\t{%1, %0|%0, %1}"; } } - [(set_attr "isa" "*,*,*,*,*,*,*,*,*,*,avx512dq,avx512dq") + [(set (attr "isa") + (if_then_else (eq_attr "alternative" "10,11") + (const_string "avx512dq") + (const_string "*"))) (set (attr "type") (cond [(eq_attr "alternative" "7,8,9,10,11") (const_string "mskmov") diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 9a239c2facf..65e8b460508 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -610,8 +610,14 @@ #" [(set_attr "isa" "*,sse3,noavx,*,*,*,*") (set_attr "type" "mmxcvt,sse,sseshuf1,mmxmov,ssemov,fmov,imov") - (set_attr "length_immediate" "*,*,1,*,*,*,*") - (set_attr "prefix_rep" "*,1,*,*,*,*,*") + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "2") + (const_string "1") + (const_string "*"))) + (set (attr "prefix_rep") + (if_then_else (eq_attr "alternative" "1") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "orig,maybe_vex,orig,orig,orig,orig,orig") (set_attr "mode" "DI,V4SF,V4SF,SF,SF,SF,SF")]) @@ -1297,7 +1303,10 @@ #" [(set_attr "isa" "*,sse2,noavx,*,*,*") (set_attr "type" "mmxcvt,sseshuf1,sseshuf1,mmxmov,ssemov,imov") - (set_attr "length_immediate" "*,1,1,*,*,*") + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "1,2") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "orig,maybe_vex,orig,orig,orig,orig") (set_attr "mode" "DI,TI,V4SF,SI,SI,SI")]) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 0d3dab62447..b348f2df544 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -6510,7 +6510,10 @@ %vmovlps\t{%2, %0|%q0, %2}" [(set_attr "isa" "noavx,avx,noavx,avx,*") (set_attr "type" "sseshuf,sseshuf,ssemov,ssemov,ssemov") - (set_attr "length_immediate" "1,1,*,*,*") + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "0,1") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex,maybe_vex") (set_attr "mode" "V4SF,V4SF,V2SF,V2SF,V2SF")]) @@ -6586,12 +6589,41 @@ %vmovss\t{%1, %0|%0, %1} punpckldq\t{%2, %0|%0, %2} movd\t{%1, %0|%0, %1}" - [(set_attr "isa" "noavx,noavx,avx,noavx,noavx,avx,*,*,*") - (set_attr "type" "sselog,sselog,sselog,sselog,sselog,sselog,ssemov,mmxcvt,mmxmov") - (set_attr "prefix_data16" "*,*,*,1,1,*,*,*,*") - (set_attr "prefix_extra" "*,*,*,1,1,1,*,*,*") - (set_attr "length_immediate" "*,*,*,1,1,1,*,*,*") - (set_attr "prefix" "orig,orig,maybe_evex,orig,orig,maybe_evex,maybe_vex,orig,orig") + [(set (attr "isa") + (cond [(eq_attr "alternative" "0,1,3,4") + (const_string "noavx") + (eq_attr "alternative" "2,5") + (const_string "avx") + ] + (const_string "*"))) + (set (attr "type") + (cond [(eq_attr "alternative" "6") + (const_string "ssemov") + (eq_attr "alternative" "7") + (const_string "mmxcvt") + (eq_attr "alternative" "8") + (const_string "mmxmov") + ] + (const_string "sselog"))) + (set (attr "prefix_data16") + (if_then_else (eq_attr "alternative" "3,4") + (const_string "1") + (const_string "*"))) + (set (attr "prefix_extra") + (if_then_else (eq_attr "alternative" "3,4,5") + (const_string "1") + (const_string "*"))) + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "3,4,5") + (const_string "1") + (const_string "*"))) + (set (attr "prefix") + (cond [(eq_attr "alternative" "2,5") + (const_string "maybe_evex") + (eq_attr "alternative" "6") + (const_string "maybe_vex") + ] + (const_string "orig"))) (set_attr "mode" "V4SF,V4SF,V4SF,V4SF,V4SF,V4SF,SF,DI,DI")]) ;; ??? In theory we can match memory for the MMX alternative, but allowing @@ -6664,7 +6696,17 @@ # # #" - [(set_attr "isa" "sse4_noavx,sse4_noavx,avx,sse2,sse2,noavx,noavx,avx,sse4_noavx,sse4_noavx,avx,*,*,*") + [(set (attr "isa") + (cond [(eq_attr "alternative" "0,1,8,9") + (const_string "sse4_noavx") + (eq_attr "alternative" "2,7,10") + (const_string "avx") + (eq_attr "alternative" "3,4") + (const_string "sse2") + (eq_attr "alternative" "5,6") + (const_string "noavx") + ] + (const_string "*"))) (set (attr "type") (cond [(eq_attr "alternative" "0,1,2,8,9,10") (const_string "sselog") @@ -6674,9 +6716,25 @@ (const_string "fmov") ] (const_string "ssemov"))) - (set_attr "prefix_extra" "*,*,*,*,*,*,*,*,1,1,1,*,*,*") - (set_attr "length_immediate" "*,*,*,*,*,*,*,*,1,1,1,*,*,*") - (set_attr "prefix" "orig,orig,maybe_evex,maybe_vex,maybe_vex,orig,orig,vex,orig,orig,vex,*,*,*") + (set (attr "prefix_extra") + (if_then_else (eq_attr "alternative" "8,9,10") + (const_string "1") + (const_string "*"))) + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "8,9,10") + (const_string "1") + (const_string "*"))) + (set (attr "prefix") + (cond [(eq_attr "alternative" "0,1,5,6,8,9") + (const_string "orig") + (eq_attr "alternative" "2") + (const_string "maybe_evex") + (eq_attr "alternative" "3,4") + (const_string "maybe_vex") + (eq_attr "alternative" "7,10") + (const_string "vex") + ] + (const_string "*"))) (set_attr "mode" "SF,SF,SF,,SI,SF,SF,SF,TI,TI,TI,*,*,*")]) ;; A subset is vec_setv4sf. @@ -7667,7 +7725,10 @@ %vmovhpd\t{%1, %0|%q0, %1}" [(set_attr "isa" "noavx,avx,sse3,noavx,avx,*") (set_attr "type" "sselog,sselog,sselog,ssemov,ssemov,ssemov") - (set_attr "prefix_data16" "*,*,*,1,*,1") + (set (attr "prefix_data16") + (if_then_else (eq_attr "alternative" "3,5") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "orig,maybe_evex,maybe_vex,orig,maybe_evex,maybe_vex") (set_attr "mode" "V2DF,V2DF,DF,V1DF,V1DF,V1DF")]) @@ -7826,7 +7887,10 @@ %vmovlpd\t{%2, %H0|%H0, %2}" [(set_attr "isa" "noavx,avx,sse3,noavx,avx,*") (set_attr "type" "sselog,sselog,sselog,ssemov,ssemov,ssemov") - (set_attr "prefix_data16" "*,*,*,1,*,1") + (set (attr "prefix_data16") + (if_then_else (eq_attr "alternative" "3,5") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "orig,maybe_evex,maybe_vex,orig,maybe_evex,maybe_vex") (set_attr "mode" "V2DF,V2DF,DF,V1DF,V1DF,V1DF")]) @@ -8512,7 +8576,10 @@ # #" [(set_attr "type" "ssemov,ssemov,ssemov,fmov,imov") - (set_attr "prefix_data16" "1,*,*,*,*") + (set (attr "prefix_data16") + (if_then_else (eq_attr "alternative" "0") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "maybe_vex") (set_attr "mode" "V1DF,DF,DF,DF,DF")]) @@ -8582,7 +8649,10 @@ #" [(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_data16") + (if_then_else (eq_attr "alternative" "0") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex,*,*,*") (set_attr "mode" "V1DF,V1DF,V2DF,V2DF,DF,DF,DF")]) @@ -8650,9 +8720,23 @@ (const_string "imov") ] (const_string "ssemov"))) - (set_attr "prefix_data16" "*,1,*,*,*,*,1,*,*,*,*") - (set_attr "length_immediate" "*,*,*,*,*,1,*,*,*,*,*") - (set_attr "prefix" "maybe_vex,orig,maybe_evex,orig,maybe_evex,orig,orig,maybe_evex,*,*,*") + (set (attr "prefix_data16") + (if_then_else (eq_attr "alternative" "1,6") + (const_string "1") + (const_string "*"))) + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "5") + (const_string "1") + (const_string "*"))) + (set (attr "prefix") + (cond [(eq_attr "alternative" "0") + (const_string "maybe_vex") + (eq_attr "alternative" "1,3,5,6") + (const_string "orig") + (eq_attr "alternative" "2,4,7") + (const_string "maybe_evex") + ] + (const_string "*"))) (set_attr "mode" "DF,V1DF,V1DF,V1DF,V1DF,V2DF,V1DF,V1DF,DF,DF,DF")]) (define_split @@ -8693,8 +8777,17 @@ (not (match_test "TARGET_AVX"))) (const_string "1") (const_string "*"))) - (set_attr "length_immediate" "*,*,*,*,*,1,*,*,*") - (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex,maybe_vex,orig,orig,maybe_evex,maybe_vex") + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "5") + (const_string "1") + (const_string "*"))) + (set (attr "prefix") + (cond [(eq_attr "alternative" "1,3,7") + (const_string "maybe_evex") + (eq_attr "alternative" "4,8") + (const_string "maybe_vex") + ] + (const_string "orig"))) (set_attr "mode" "DF,DF,V1DF,V1DF,V1DF,V2DF,V1DF,V1DF,V1DF")]) (define_insn "vec_dupv2df" @@ -8730,7 +8823,19 @@ %vmovq\t{%1, %0|%0, %1} movlhps\t{%2, %0|%0, %2} movhps\t{%2, %0|%0, %2}" - [(set_attr "isa" "sse2_noavx,avx,avx512vl,sse3,avx512vl,sse2_noavx,avx,sse2,noavx,noavx") + [(set (attr "isa") + (cond [(eq_attr "alternative" "0,5") + (const_string "sse2_noavx") + (eq_attr "alternative" "1,6") + (const_string "avx") + (eq_attr "alternative" "2,4") + (const_string "avx512vl") + (eq_attr "alternative" "3") + (const_string "sse3") + (eq_attr "alternative" "7") + (const_string "sse2") + ] + (const_string "noavx"))) (set (attr "type") (if_then_else (eq_attr "alternative" "0,1,2,3,4") @@ -8740,7 +8845,15 @@ (if_then_else (eq_attr "alternative" "5") (const_string "1") (const_string "*"))) - (set_attr "prefix" "orig,vex,evex,maybe_vex,evex,orig,vex,maybe_vex,orig,orig") + (set (attr "prefix") + (cond [(eq_attr "alternative" "1,6") + (const_string "vex") + (eq_attr "alternative" "2,4") + (const_string "evex") + (eq_attr "alternative" "3,7") + (const_string "maybe_vex") + ] + (const_string "orig"))) (set_attr "mode" "V2DF,V2DF,V2DF, DF, DF, V1DF,V1DF,DF,V4SF,V2SF")]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -13198,7 +13311,10 @@ } [(set_attr "isa" "*,avx512dq,noavx,noavx,avx,avx512bw") (set_attr "type" "sselog1,sselog1,sseishft1,sseishft1,sseishft1,sseishft1") - (set_attr "prefix_extra" "1,1,*,*,*,*") + (set (attr "prefix_extra") + (if_then_else (eq_attr "alternative" "0,1") + (const_string "1") + (const_string "*"))) (set_attr "length_immediate" "1") (set_attr "prefix" "maybe_vex,evex,orig,orig,vex,evex") (set_attr "mode" "TI")]) @@ -13256,11 +13372,44 @@ movhlps\t{%1, %0|%0, %1} # #" - [(set_attr "isa" "x64_sse4,x64_avx512dq,*,sse2_noavx,avx,avx512bw,noavx,*,x64") - (set_attr "type" "sselog1,sselog1,ssemov,sseishft1,sseishft1,sseishft1,ssemov,ssemov,imov") - (set_attr "length_immediate" "1,1,*,1,1,1,*,*,*") - (set_attr "prefix_rex" "1,1,*,*,*,*,*,*,*") - (set_attr "prefix_extra" "1,1,*,*,*,*,*,*,*") + [(set (attr "isa") + (cond [(eq_attr "alternative" "0") + (const_string "x64_sse4") + (eq_attr "alternative" "1") + (const_string "x64_avx512dq") + (eq_attr "alternative" "3") + (const_string "sse2_noavx") + (eq_attr "alternative" "4") + (const_string "avx") + (eq_attr "alternative" "5") + (const_string "avx512bw") + (eq_attr "alternative" "6") + (const_string "noavx") + (eq_attr "alternative" "8") + (const_string "x64") + ] + (const_string "*"))) + (set (attr "type") + (cond [(eq_attr "alternative" "2,6,7") + (const_string "ssemov") + (eq_attr "alternative" "3,4,5") + (const_string "sseishft1") + (eq_attr "alternative" "8") + (const_string "imov") + ] + (const_string "sselog1"))) + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "0,1,3,4,5") + (const_string "1") + (const_string "*"))) + (set (attr "prefix_rex") + (if_then_else (eq_attr "alternative" "0,1") + (const_string "1") + (const_string "*"))) + (set (attr "prefix_extra") + (if_then_else (eq_attr "alternative" "0,1") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "maybe_vex,evex,maybe_vex,orig,vex,evex,orig,*,*") (set_attr "mode" "TI,TI,V2SF,TI,TI,TI,V4SF,DI,DI")]) @@ -13357,9 +13506,23 @@ punpckldq\t{%2, %0|%0, %2} movd\t{%1, %0|%0, %1}" [(set_attr "isa" "noavx,noavx,avx,noavx,noavx,avx,*,*,*") - (set_attr "type" "sselog,sselog,sselog,sselog,sselog,sselog,ssemov,mmxcvt,mmxmov") - (set_attr "prefix_extra" "1,1,1,*,*,*,*,*,*") - (set_attr "length_immediate" "1,1,1,*,*,*,*,*,*") + (set (attr "type") + (cond [(eq_attr "alternative" "6") + (const_string "ssemov") + (eq_attr "alternative" "7") + (const_string "mmxcvt") + (eq_attr "alternative" "8") + (const_string "mmxmov") + ] + (const_string "sselog"))) + (set (attr "prefix_extra") + (if_then_else (eq_attr "alternative" "0,1,2") + (const_string "1") + (const_string "*"))) + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "0,1,2") + (const_string "1") + (const_string "*"))) (set_attr "prefix" "orig,orig,vex,orig,orig,vex,maybe_vex,orig,orig") (set_attr "mode" "TI,TI,TI,TI,TI,TI,TI,DI,DI")]) @@ -13423,16 +13586,45 @@ movlhps\t{%2, %0|%0, %2} movhps\t{%2, %0|%0, %2} vmovhps\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "isa" "x64_sse4_noavx,x64_sse4_noavx,x64_avx,x64,sse2,sse2,sse2_noavx,avx,noavx,noavx,avx") + [(set (attr "isa") + (cond [(eq_attr "alternative" "0,1") + (const_string "x64_sse4_noavx") + (eq_attr "alternative" "2") + (const_string "x64_avx") + (eq_attr "alternative" "3") + (const_string "x64") + (eq_attr "alternative" "4,5") + (const_string "sse2") + (eq_attr "alternative" "6") + (const_string "sse2_noavx") + (eq_attr "alternative" "7,10") + (const_string "avx") + ] + (const_string "noavx"))) (set (attr "type") (if_then_else (eq_attr "alternative" "0,1,2,6,7") (const_string "sselog") (const_string "ssemov"))) - (set_attr "prefix_rex" "1,1,1,1,*,*,*,*,*,*,*") - (set_attr "prefix_extra" "1,1,1,*,*,*,*,*,*,*,*") - (set_attr "length_immediate" "1,1,1,*,*,*,*,*,*,*,*") - (set_attr "prefix" "orig,orig,vex,maybe_vex,maybe_vex,orig,orig,vex,orig,orig,vex") + (set (attr "prefix_rex") + (if_then_else (eq_attr "alternative" "0,1,2,3") + (const_string "1") + (const_string "*"))) + (set (attr "prefix_extra") + (if_then_else (eq_attr "alternative" "0,1,2") + (const_string "1") + (const_string "*"))) + (set (attr "length_immediate") + (if_then_else (eq_attr "alternative" "0,1,2") + (const_string "1") + (const_string "*"))) + (set (attr "prefix") + (cond [(eq_attr "alternative" "2,7,10") + (const_string "vex") + (eq_attr "alternative" "3,4") + (const_string "maybe_vex") + ] + (const_string "orig"))) (set_attr "mode" "TI,TI,TI,TI,TI,TI,TI,TI,V4SF,V2SF,V2SF")]) (define_expand "vec_unpacks_lo_" -- 2.30.2