From 4a77025b7d680c2f8d8a04c1b769d28a5897234a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 21 Dec 2018 17:01:53 +0100 Subject: [PATCH] re PR target/88522 (Error: operand size mismatch for `vpgatherqq') PR target/88522 * config/i386/sse.md (*avx512pf_gatherpfsf_mask, *avx512pf_gatherpfdf_mask, *avx512pf_scatterpfsf_mask, *avx512pf_scatterpfdf_mask): Use %X5 instead of %5 for -masm=intel. (gatherq_mode): Remove mode iterator. (*avx512f_gathersi, *avx512f_gathersi_2): Use X instead of . (*avx512f_gatherdi): Use X instead of . (*avx512f_gatherdi_2, *avx512f_scattersi, *avx512f_scatterdi): Use %X5 for -masm=intel. From-SVN: r267327 --- gcc/ChangeLog | 12 ++++++++ gcc/config/i386/sse.md | 64 ++++++++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce6ba2f16ea..0fc3225ee2f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,17 @@ 2018-12-21 Jakub Jelinek + PR target/88522 + * config/i386/sse.md (*avx512pf_gatherpfsf_mask, + *avx512pf_gatherpfdf_mask, *avx512pf_scatterpfsf_mask, + *avx512pf_scatterpfdf_mask): Use %X5 instead of %5 for + -masm=intel. + (gatherq_mode): Remove mode iterator. + (*avx512f_gathersi, *avx512f_gathersi_2): Use X instead + of . + (*avx512f_gatherdi): Use X instead of . + (*avx512f_gatherdi_2, *avx512f_scattersi, + *avx512f_scatterdi): Use %X5 for -masm=intel. + PR rtl-optimization/88563 * expr.c (expand_expr_real_2) : Swap innermode and mode arguments to convert_modes. Likewise swap mode and word_mode diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 5dcb621f7e4..6ec9896ab6f 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -17269,9 +17269,11 @@ switch (INTVAL (operands[4])) { case 3: - return "vgatherpf0ps\t{%5%{%0%}|%5%{%0%}}"; + /* %X5 so that we don't emit any *WORD PTR for -masm=intel, as + gas changed what it requires incompatibly. */ + return "vgatherpf0ps\t{%5%{%0%}|%X5%{%0%}}"; case 2: - return "vgatherpf1ps\t{%5%{%0%}|%5%{%0%}}"; + return "vgatherpf1ps\t{%5%{%0%}|%X5%{%0%}}"; default: gcc_unreachable (); } @@ -17314,9 +17316,11 @@ switch (INTVAL (operands[4])) { case 3: - return "vgatherpf0pd\t{%5%{%0%}|%5%{%0%}}"; + /* %X5 so that we don't emit any *WORD PTR for -masm=intel, as + gas changed what it requires incompatibly. */ + return "vgatherpf0pd\t{%5%{%0%}|%X5%{%0%}}"; case 2: - return "vgatherpf1pd\t{%5%{%0%}|%5%{%0%}}"; + return "vgatherpf1pd\t{%5%{%0%}|%X5%{%0%}}"; default: gcc_unreachable (); } @@ -17360,10 +17364,12 @@ { case 3: case 7: - return "vscatterpf0ps\t{%5%{%0%}|%5%{%0%}}"; + /* %X5 so that we don't emit any *WORD PTR for -masm=intel, as + gas changed what it requires incompatibly. */ + return "vscatterpf0ps\t{%5%{%0%}|%X5%{%0%}}"; case 2: case 6: - return "vscatterpf1ps\t{%5%{%0%}|%5%{%0%}}"; + return "vscatterpf1ps\t{%5%{%0%}|%X5%{%0%}}"; default: gcc_unreachable (); } @@ -17407,10 +17413,12 @@ { case 3: case 7: - return "vscatterpf0pd\t{%5%{%0%}|%5%{%0%}}"; + /* %X5 so that we don't emit any *WORD PTR for -masm=intel, as + gas changed what it requires incompatibly. */ + return "vscatterpf0pd\t{%5%{%0%}|%X5%{%0%}}"; case 2: case 6: - return "vscatterpf1pd\t{%5%{%0%}|%5%{%0%}}"; + return "vscatterpf1pd\t{%5%{%0%}|%X5%{%0%}}"; default: gcc_unreachable (); } @@ -20290,12 +20298,6 @@ (set_attr "prefix" "vex") (set_attr "mode" "")]) -;; Memory operand override for -masm=intel of the v*gatherq* patterns. -(define_mode_attr gatherq_mode - [(V4SI "q") (V2DI "x") (V4SF "q") (V2DF "x") - (V8SI "x") (V4DI "t") (V8SF "x") (V4DF "t") - (V16SI "t") (V8DI "g") (V16SF "t") (V8DF "g")]) - (define_expand "_gathersi" [(parallel [(set (match_operand:VI48F 0 "register_operand") (unspec:VI48F @@ -20329,7 +20331,9 @@ UNSPEC_GATHER)) (clobber (match_scratch: 2 "=&Yk"))] "TARGET_AVX512F" - "vgatherd\t{%6, %0%{%2%}|%0%{%2%}, %6}" +;; %X6 so that we don't emit any *WORD PTR for -masm=intel, as +;; gas changed what it requires incompatibly. + "vgatherd\t{%6, %0%{%2%}|%0%{%2%}, %X6}" [(set_attr "type" "ssemov") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -20348,7 +20352,9 @@ UNSPEC_GATHER)) (clobber (match_scratch: 1 "=&Yk"))] "TARGET_AVX512F" - "vgatherd\t{%5, %0%{%1%}|%0%{%1%}, %5}" +;; %X5 so that we don't emit any *WORD PTR for -masm=intel, as +;; gas changed what it requires incompatibly. + "vgatherd\t{%5, %0%{%1%}|%0%{%1%}, %X5}" [(set_attr "type" "ssemov") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -20387,9 +20393,9 @@ UNSPEC_GATHER)) (clobber (match_scratch:QI 2 "=&Yk"))] "TARGET_AVX512F" -{ - return "vgatherq\t{%6, %1%{%2%}|%1%{%2%}, %6}"; -} +;; %X6 so that we don't emit any *WORD PTR for -masm=intel, as +;; gas changed what it requires incompatibly. + "vgatherq\t{%6, %1%{%2%}|%1%{%2%}, %X6}" [(set_attr "type" "ssemov") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -20409,14 +20415,16 @@ (clobber (match_scratch:QI 1 "=&Yk"))] "TARGET_AVX512F" { + /* %X5 so that we don't emit any *WORD PTR for -masm=intel, as + gas changed what it requires incompatibly. */ if (mode != mode) { if ( != 64) - return "vgatherq\t{%5, %x0%{%1%}|%x0%{%1%}, %5}"; + return "vgatherq\t{%5, %x0%{%1%}|%x0%{%1%}, %X5}"; else - return "vgatherq\t{%5, %t0%{%1%}|%t0%{%1%}, %t5}"; + return "vgatherq\t{%5, %t0%{%1%}|%t0%{%1%}, %X5}"; } - return "vgatherq\t{%5, %0%{%1%}|%0%{%1%}, %5}"; + return "vgatherq\t{%5, %0%{%1%}|%0%{%1%}, %X5}"; } [(set_attr "type" "ssemov") (set_attr "prefix" "evex") @@ -20453,7 +20461,9 @@ UNSPEC_SCATTER)) (clobber (match_scratch: 1 "=&Yk"))] "TARGET_AVX512F" - "vscatterd\t{%3, %5%{%1%}|%5%{%1%}, %3}" +;; %X5 so that we don't emit any *WORD PTR for -masm=intel, as +;; gas changed what it requires incompatibly. + "vscatterd\t{%3, %5%{%1%}|%X5%{%1%}, %3}" [(set_attr "type" "ssemov") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -20489,11 +20499,9 @@ UNSPEC_SCATTER)) (clobber (match_scratch:QI 1 "=&Yk"))] "TARGET_AVX512F" -{ - if (GET_MODE_SIZE (GET_MODE_INNER (mode)) == 8) - return "vscatterq\t{%3, %5%{%1%}|%5%{%1%}, %3}"; - return "vscatterq\t{%3, %5%{%1%}|%t5%{%1%}, %3}"; -} +;; %X5 so that we don't emit any *WORD PTR for -masm=intel, as +;; gas changed what it requires incompatibly. + "vscatterq\t{%3, %5%{%1%}|%X5%{%1%}, %3}" [(set_attr "type" "ssemov") (set_attr "prefix" "evex") (set_attr "mode" "")]) -- 2.30.2