From 7044c89cfd51f35a37e7a83f173a35d0e8b01b0f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 17 Apr 2018 09:08:06 +0200 Subject: [PATCH] re PR target/85281 (Assembler messages: Error: operand size mismatch for `vpbroadcastb' with -mavx512bw -masm=intel) PR target/85281 * config/i386/sse.md (reduces, avx512f_vmcmp3, avx512f_vmcmp3_mask, avx512f_sgetexp, avx512f_rndscale, avx512dq_ranges, avx512f_vgetmant): Use %2 instead of %2 for -masm=intel. (avx512f_vcvtss2usi, avx512f_vcvtss2usiq, avx512f_vcvttss2usi, avx512f_vcvttss2usiq): Use %k1 instead of %1 for -masm=intel. (avx512f_vcvtsd2usi, avx512f_vcvtsd2usiq, avx512f_vcvttsd2usi, avx512f_vcvttsd2usiq, ufloatv2siv2df2): Use %q1 instead of %1 for -masm=intel. (avx512f_sfixupimm, avx512f_sfixupimm_mask): Use %3 instead of %3 for -masm=intel. (sse2_shufpd_v2df_mask): Fix a typo, change %{6%} to %{%6%} for -masm=intel. (*avx512vl_v2div2qi2_store): Use %w0 instead of %0 for -masm=intel. (*avx512vl_v4qi2_store): Use %k0 instead of %0 for -masm=intel. (avx512vl_v4qi2_mask_store): Use a single pattern with %k0 and %1 for -masm=intel rather than two patterns, one with %0 and %g1. (*avx512vl_v8qi2_store): Use %q0 instead of %0 for -masm=intel. (avx512vl_v8qi2_mask_store): Use a single pattern with %q0 and %1 for -masm=intel rather than two patterns, one with %0 and %g1 and one with %0 and %1. (avx512er_vmrcp28, avx512er_vmrsqrt28): Use %1 instead of %1 for -masm=intel. (avx5124fmaddps_4fmaddps_mask, avx5124fmaddps_4fmaddss_mask, avx5124fmaddps_4fnmaddps_mask, avx5124fmaddps_4fnmaddss_mask, avx5124vnniw_vp4dpwssd_mask, avx5124vnniw_vp4dpwssds_mask): Swap order of %0 and %{%4%} for -masm=intel. (avx5124fmaddps_4fmaddps_maskz, avx5124fmaddps_4fmaddss_maskz, avx5124fmaddps_4fnmaddps_maskz, avx5124fmaddps_4fnmaddss_maskz, avx5124vnniw_vp4dpwssd_maskz, avx5124vnniw_vp4dpwssds_maskz): Swap order of %0 and %{%5%}%{z%} for -masm=intel. From-SVN: r259430 --- gcc/ChangeLog | 48 +++++++++++++++++++++++++++++ gcc/config/i386/sse.md | 84 +++++++++++++++++++++++--------------------------- 2 files changed, 86 insertions(+), 46 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4ba0f0f..a086530 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,51 @@ +2018-04-17 Jakub Jelinek + + PR target/85281 + * config/i386/sse.md (reduces, + avx512f_vmcmp3, + avx512f_vmcmp3_mask, + avx512f_sgetexp, + avx512f_rndscale, + avx512dq_ranges, + avx512f_vgetmant): + Use %2 instead of %2 for -masm=intel. + (avx512f_vcvtss2usi, avx512f_vcvtss2usiq, + avx512f_vcvttss2usi, + avx512f_vcvttss2usiq): Use %k1 instead of %1 for + -masm=intel. + (avx512f_vcvtsd2usi, avx512f_vcvtsd2usiq, + avx512f_vcvttsd2usi, + avx512f_vcvttsd2usiq, ufloatv2siv2df2): + Use %q1 instead of %1 for -masm=intel. + (avx512f_sfixupimm, + avx512f_sfixupimm_mask): Use %3 instead + of %3 for -masm=intel. + (sse2_shufpd_v2df_mask): Fix a typo, change %{6%} to %{%6%} for + -masm=intel. + (*avx512vl_v2div2qi2_store): Use %w0 instead of %0 for + -masm=intel. + (*avx512vl_v4qi2_store): Use %k0 instead of %0 for + -masm=intel. + (avx512vl_v4qi2_mask_store): Use a single pattern with + %k0 and %1 for -masm=intel rather than two patterns, one with %0 and + %g1. + (*avx512vl_v8qi2_store): Use %q0 instead of %0 for + -masm=intel. + (avx512vl_v8qi2_mask_store): Use a single pattern with + %q0 and %1 for -masm=intel rather than two patterns, one with %0 and + %g1 and one with %0 and %1. + (avx512er_vmrcp28, + avx512er_vmrsqrt28): Use %1 instead of + %1 for -masm=intel. + (avx5124fmaddps_4fmaddps_mask, avx5124fmaddps_4fmaddss_mask, + avx5124fmaddps_4fnmaddps_mask, avx5124fmaddps_4fnmaddss_mask, + avx5124vnniw_vp4dpwssd_mask, avx5124vnniw_vp4dpwssds_mask): Swap order + of %0 and %{%4%} for -masm=intel. + (avx5124fmaddps_4fmaddps_maskz, avx5124fmaddps_4fmaddss_maskz, + avx5124fmaddps_4fnmaddps_maskz, avx5124fmaddps_4fnmaddss_maskz, + avx5124vnniw_vp4dpwssd_maskz, avx5124vnniw_vp4dpwssds_maskz): Swap + order of %0 and %{%5%}%{z%} for -masm=intel. + 2018-04-17 Jan Hubicka PR lto/85405 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index c3345d0..8b5f4c6 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -2628,7 +2628,7 @@ (match_dup 1) (const_int 1)))] "TARGET_AVX512DQ" - "vreduce\t{%3, %2, %1, %0|%0, %1, %2, %3}" + "vreduce\t{%3, %2, %1, %0|%0, %1, %2, %3}" [(set_attr "type" "sse") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -2796,7 +2796,7 @@ UNSPEC_PCMP) (const_int 1)))] "TARGET_AVX512F" - "vcmp\t{%3, %2, %1, %0|%0, %1, %2, %3}" + "vcmp\t{%3, %2, %1, %0|%0, %1, %2, %3}" [(set_attr "type" "ssecmp") (set_attr "length_immediate" "1") (set_attr "prefix" "evex") @@ -2814,7 +2814,7 @@ (match_operand: 4 "register_operand" "Yk") (const_int 1))))] "TARGET_AVX512F" - "vcmp\t{%3, %2, %1, %0%{%4%}|%0%{%4%}, %1, %2, %3}" + "vcmp\t{%3, %2, %1, %0%{%4%}|%0%{%4%}, %1, %2, %3}" [(set_attr "type" "ssecmp") (set_attr "length_immediate" "1") (set_attr "prefix" "evex") @@ -4805,7 +4805,7 @@ (parallel [(const_int 0)]))] UNSPEC_UNSIGNED_FIX_NOTRUNC))] "TARGET_AVX512F" - "vcvtss2usi\t{%1, %0|%0, %1}" + "vcvtss2usi\t{%1, %0|%0, %k1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "SI")]) @@ -4818,7 +4818,7 @@ (parallel [(const_int 0)]))] UNSPEC_UNSIGNED_FIX_NOTRUNC))] "TARGET_AVX512F && TARGET_64BIT" - "vcvtss2usi\t{%1, %0|%0, %1}" + "vcvtss2usi\t{%1, %0|%0, %k1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "DI")]) @@ -4830,7 +4830,7 @@ (match_operand:V4SF 1 "" "") (parallel [(const_int 0)]))))] "TARGET_AVX512F" - "vcvttss2usi\t{%1, %0|%0, %1}" + "vcvttss2usi\t{%1, %0|%0, %k1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "SI")]) @@ -4842,7 +4842,7 @@ (match_operand:V4SF 1 "" "") (parallel [(const_int 0)]))))] "TARGET_AVX512F && TARGET_64BIT" - "vcvttss2usi\t{%1, %0|%0, %1}" + "vcvttss2usi\t{%1, %0|%0, %k1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "DI")]) @@ -4855,7 +4855,7 @@ (parallel [(const_int 0)]))] UNSPEC_UNSIGNED_FIX_NOTRUNC))] "TARGET_AVX512F" - "vcvtsd2usi\t{%1, %0|%0, %1}" + "vcvtsd2usi\t{%1, %0|%0, %q1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "SI")]) @@ -4868,7 +4868,7 @@ (parallel [(const_int 0)]))] UNSPEC_UNSIGNED_FIX_NOTRUNC))] "TARGET_AVX512F && TARGET_64BIT" - "vcvtsd2usi\t{%1, %0|%0, %1}" + "vcvtsd2usi\t{%1, %0|%0, %q1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "DI")]) @@ -4880,7 +4880,7 @@ (match_operand:V2DF 1 "" "") (parallel [(const_int 0)]))))] "TARGET_AVX512F" - "vcvttsd2usi\t{%1, %0|%0, %1}" + "vcvttsd2usi\t{%1, %0|%0, %q1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "SI")]) @@ -4892,7 +4892,7 @@ (match_operand:V2DF 1 "" "") (parallel [(const_int 0)]))))] "TARGET_AVX512F && TARGET_64BIT" - "vcvttsd2usi\t{%1, %0|%0, %1}" + "vcvttsd2usi\t{%1, %0|%0, %q1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") (set_attr "mode" "DI")]) @@ -5099,7 +5099,7 @@ (match_operand:V4SI 1 "nonimmediate_operand" "vm") (parallel [(const_int 0) (const_int 1)]))))] "TARGET_AVX512VL" - "vcvtudq2pd\t{%1, %0|%0, %1}" + "vcvtudq2pd\t{%1, %0|%0, %q1}" [(set_attr "type" "ssecvt") (set_attr "prefix" "evex") (set_attr "mode" "V2DF")]) @@ -8504,7 +8504,7 @@ (match_dup 1) (const_int 1)))] "TARGET_AVX512F" - "vgetexp\t{%2, %1, %0|%0, %1, %2}"; + "vgetexp\t{%2, %1, %0|%0, %1, %2}"; [(set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -8624,7 +8624,7 @@ (match_dup 1) (const_int 1)))] "TARGET_AVX512F" - "vfixupimm\t{%4, %3, %2, %0|%0, %2, %3, %4}"; + "vfixupimm\t{%4, %3, %2, %0|%0, %2, %3, %4}"; [(set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -8643,7 +8643,7 @@ (match_dup 1) (match_operand: 5 "register_operand" "Yk")))] "TARGET_AVX512F" - "vfixupimm\t{%4, %3, %2, %0%{%5%}|%0%{%5%}, %2, %3, %4}"; + "vfixupimm\t{%4, %3, %2, %0%{%5%}|%0%{%5%}, %2, %3, %4}"; [(set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -8670,7 +8670,7 @@ (match_dup 1) (const_int 1)))] "TARGET_AVX512F" - "vrndscale\t{%3, %2, %1, %0|%0, %1, %2, %3}" + "vrndscale\t{%3, %2, %1, %0|%0, %1, %2, %3}" [(set_attr "length_immediate" "1") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -8861,7 +8861,7 @@ mask |= (INTVAL (operands[4]) - 2) << 1; operands[3] = GEN_INT (mask); - return "vshufpd\t{%3, %2, %1, %0%{%6%}%N5|%0%{6%}%N5, %1, %2, %3}"; + return "vshufpd\t{%3, %2, %1, %0%{%6%}%N5|%0%{%6%}%N5, %1, %2, %3}"; } [(set_attr "type" "sseshuf") (set_attr "length_immediate" "1") @@ -9514,7 +9514,7 @@ (const_int 12) (const_int 13) (const_int 14) (const_int 15)]))))] "TARGET_AVX512VL" - "vpmovqb\t{%1, %0|%0, %1}" + "vpmovqb\t{%1, %0|%w0, %1}" [(set_attr "type" "ssemov") (set_attr "memory" "store") (set_attr "prefix" "evex") @@ -9604,7 +9604,7 @@ (const_int 12) (const_int 13) (const_int 14) (const_int 15)]))))] "TARGET_AVX512VL" - "vpmov\t{%1, %0|%0, %1}" + "vpmov\t{%1, %0|%k0, %1}" [(set_attr "type" "ssemov") (set_attr "memory" "store") (set_attr "prefix" "evex") @@ -9674,11 +9674,7 @@ (const_int 12) (const_int 13) (const_int 14) (const_int 15)]))))] "TARGET_AVX512VL" -{ - if (GET_MODE_SIZE (GET_MODE_INNER (mode)) == 8) - return "vpmov\t{%1, %0%{%2%}|%k0%{%2%}, %1}"; - return "vpmov\t{%1, %0%{%2%}|%0%{%2%}, %g1}"; -} + "vpmov\t{%1, %0%{%2%}|%k0%{%2%}, %1}" [(set_attr "type" "ssemov") (set_attr "memory" "store") (set_attr "prefix" "evex") @@ -9699,7 +9695,7 @@ (const_int 12) (const_int 13) (const_int 14) (const_int 15)]))))] "TARGET_AVX512VL" - "vpmov\t{%1, %0|%0, %1}" + "vpmov\t{%1, %0|%q0, %1}" [(set_attr "type" "ssemov") (set_attr "memory" "store") (set_attr "prefix" "evex") @@ -9769,11 +9765,7 @@ (const_int 12) (const_int 13) (const_int 14) (const_int 15)]))))] "TARGET_AVX512VL" -{ - if (GET_MODE_SIZE (GET_MODE_INNER (mode)) == 4) - return "vpmov\t{%1, %0%{%2%}|%0%{%2%}, %g1}"; - return "vpmov\t{%1, %0%{%2%}|%0%{%2%}, %1}"; -} + "vpmov\t{%1, %0%{%2%}|%q0%{%2%}, %1}" [(set_attr "type" "ssemov") (set_attr "memory" "store") (set_attr "prefix" "evex") @@ -16426,7 +16418,7 @@ (match_operand:VF_128 2 "register_operand" "v") (const_int 1)))] "TARGET_AVX512ER" - "vrcp28\t{%1, %2, %0|%0, %2, %1}" + "vrcp28\t{%1, %2, %0|%0, %2, %1}" [(set_attr "length_immediate" "1") (set_attr "prefix" "evex") (set_attr "type" "sse") @@ -16452,7 +16444,7 @@ (match_operand:VF_128 2 "register_operand" "v") (const_int 1)))] "TARGET_AVX512ER" - "vrsqrt28\t{%1, %2, %0|%0, %2, %1}" + "vrsqrt28\t{%1, %2, %0|%0, %2, %1}" [(set_attr "length_immediate" "1") (set_attr "type" "sse") (set_attr "prefix" "evex") @@ -19595,7 +19587,7 @@ (match_dup 1) (const_int 1)))] "TARGET_AVX512DQ" - "vrange\t{%3, %2, %1, %0|%0, %1, %2, %3}" + "vrange\t{%3, %2, %1, %0|%0, %1, %2, %3}" [(set_attr "type" "sse") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -19650,7 +19642,7 @@ (match_dup 1) (const_int 1)))] "TARGET_AVX512F" - "vgetmant\t{%3, %2, %1, %0|%0, %1, %2, %3}"; + "vgetmant\t{%3, %2, %1, %0|%0, %1, %2, %3}"; [(set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -19942,7 +19934,7 @@ (match_operand:V16SF 3 "register_operand" "0") (match_operand:HI 4 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fmaddps\t{%2, %g1, %0%{%4%}|%{%4%}%0, %g1, %2}" + "v4fmaddps\t{%2, %g1, %0%{%4%}|%0%{%4%}, %g1, %2}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("V16SF"))]) @@ -19957,7 +19949,7 @@ (match_operand:V16SF 4 "const0_operand" "C") (match_operand:HI 5 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fmaddps\t{%3, %g2, %0%{%5%}%{z%}|%{%5%}%{z%}%0, %g2, %3}" + "v4fmaddps\t{%3, %g2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %g2, %3}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("V16SF"))]) @@ -19983,7 +19975,7 @@ (match_operand:V4SF 3 "register_operand" "0") (match_operand:QI 4 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fmaddss\t{%2, %x1, %0%{%4%}|%{%4%}%0, %x1, %2}" + "v4fmaddss\t{%2, %x1, %0%{%4%}|%0%{%4%}, %x1, %2}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("SF"))]) @@ -19998,7 +19990,7 @@ (match_operand:V4SF 4 "const0_operand" "C") (match_operand:QI 5 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fmaddss\t{%3, %x2, %0%{%5%}%{z%}|%{%5%}%{z%}%0, %x2, %3}" + "v4fmaddss\t{%3, %x2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %x2, %3}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("SF"))]) @@ -20024,7 +20016,7 @@ (match_operand:V16SF 3 "register_operand" "0") (match_operand:HI 4 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fnmaddps\t{%2, %g1, %0%{%4%}|%{%4%}%0, %g1, %2}" + "v4fnmaddps\t{%2, %g1, %0%{%4%}|%0%{%4%}, %g1, %2}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("V16SF"))]) @@ -20039,7 +20031,7 @@ (match_operand:V16SF 4 "const0_operand" "C") (match_operand:HI 5 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fnmaddps\t{%3, %g2, %0%{%5%}%{z%}|%{%5%}%{z%}%0, %g2, %3}" + "v4fnmaddps\t{%3, %g2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %g2, %3}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("V16SF"))]) @@ -20065,7 +20057,7 @@ (match_operand:V4SF 3 "register_operand" "0") (match_operand:QI 4 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fnmaddss\t{%2, %x1, %0%{%4%}|%{%4%}%0, %x1, %2}" + "v4fnmaddss\t{%2, %x1, %0%{%4%}|%0%{%4%}, %x1, %2}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("SF"))]) @@ -20080,7 +20072,7 @@ (match_operand:V4SF 4 "const0_operand" "C") (match_operand:QI 5 "register_operand" "Yk")))] "TARGET_AVX5124FMAPS" - "v4fnmaddss\t{%3, %x2, %0%{%5%}%{z%}|%{%5%}%{z%}%0, %x2, %3}" + "v4fnmaddss\t{%3, %x2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %x2, %3}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("SF"))]) @@ -20106,7 +20098,7 @@ (match_operand:V16SI 3 "register_operand" "0") (match_operand:HI 4 "register_operand" "Yk")))] "TARGET_AVX5124VNNIW" - "vp4dpwssd\t{%2, %g1, %0%{%4%}|%{%4%}%0, %g1, %2}" + "vp4dpwssd\t{%2, %g1, %0%{%4%}|%0%{%4%}, %g1, %2}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("TI"))]) @@ -20121,7 +20113,7 @@ (match_operand:V16SI 4 "const0_operand" "C") (match_operand:HI 5 "register_operand" "Yk")))] "TARGET_AVX5124VNNIW" - "vp4dpwssd\t{%3, %g2, %0%{%5%}%{z%}|%{%5%}%{z%}%0, %g2, %3}" + "vp4dpwssd\t{%3, %g2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %g2, %3}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("TI"))]) @@ -20147,7 +20139,7 @@ (match_operand:V16SI 3 "register_operand" "0") (match_operand:HI 4 "register_operand" "Yk")))] "TARGET_AVX5124VNNIW" - "vp4dpwssds\t{%2, %g1, %0%{%4%}|%{%4%}%0, %g1, %2}" + "vp4dpwssds\t{%2, %g1, %0%{%4%}|%0%{%4%}, %g1, %2}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("TI"))]) @@ -20162,7 +20154,7 @@ (match_operand:V16SI 4 "const0_operand" "C") (match_operand:HI 5 "register_operand" "Yk")))] "TARGET_AVX5124VNNIW" - "vp4dpwssds\t{%3, %g2, %0%{%5%}%{z%}|%{%5%}%{z%}%0, %g2, %3}" + "vp4dpwssds\t{%3, %g2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %g2, %3}" [(set_attr ("type") ("ssemuladd")) (set_attr ("prefix") ("evex")) (set_attr ("mode") ("TI"))]) -- 2.7.4