aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-03-02 14:10:36 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-03-02 14:10:36 +0100
commit69fa742f51be811038302e736c5a01eba6dbba5f (patch)
tree9736f77aed98b123ff61b9d000312e5335529b82 /gcc
parentc954de7f5c34c044773cad88ceb7ae2aa60506ed (diff)
downloadgcc-69fa742f51be811038302e736c5a01eba6dbba5f.zip
gcc-69fa742f51be811038302e736c5a01eba6dbba5f.tar.gz
gcc-69fa742f51be811038302e736c5a01eba6dbba5f.tar.bz2
re PR target/70028 (Error: operand size mismatch for `kmovw' (wrong assembly generated) with -mavx512bw -masm=intel)
PR target/70028 * config/i386/i386.md (kmovw): Move m constraint to 2nd alternative. (*movhi_internal): Put mask moves from and to memory separately from moves from/to GPRs. * gcc.target/i386/pr70028.c: New test. From-SVN: r233904
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.md13
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70028.c19
4 files changed, 38 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b5a246d..adc085c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2016-03-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70028
+ * config/i386/i386.md (kmovw): Move m constraint to 2nd alternative.
+ (*movhi_internal): Put mask moves from and to memory separately
+ from moves from/to GPRs.
+
2016-03-02 Richard Biener <rguenther@suse.de>
* genmatch.c (dt_node::gen_kids): Fix match code-gen for embedded
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index edde41a..7fec5de 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2442,7 +2442,7 @@
(define_insn "kmovw"
[(set (match_operand:HI 0 "nonimmediate_operand" "=k,k")
(unspec:HI
- [(match_operand:HI 1 "nonimmediate_operand" "rm,k")]
+ [(match_operand:HI 1 "nonimmediate_operand" "r,km")]
UNSPEC_KMOV))]
"!(MEM_P (operands[0]) && MEM_P (operands[1])) && TARGET_AVX512F"
"@
@@ -2454,8 +2454,8 @@
(define_insn "*movhi_internal"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r ,r ,m ,k,k,rm")
- (match_operand:HI 1 "general_operand" "r ,rn,rm,rn,rm,k,k"))]
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r ,r ,m ,k,k, r,m")
+ (match_operand:HI 1 "general_operand" "r ,rn,rm,rn,r,km,k,k"))]
"!(MEM_P (operands[0]) && MEM_P (operands[1]))"
{
switch (get_attr_type (insn))
@@ -2469,7 +2469,8 @@
switch (which_alternative)
{
case 4: return "kmovw\t{%k1, %0|%0, %k1}";
- case 5: return "kmovw\t{%1, %0|%0, %1}";
+ case 5: /* FALLTHRU */
+ case 7: return "kmovw\t{%1, %0|%0, %1}";
case 6: return "kmovw\t{%1, %k0|%k0, %1}";
default: gcc_unreachable ();
}
@@ -2482,7 +2483,7 @@
}
}
[(set (attr "type")
- (cond [(eq_attr "alternative" "4,5,6")
+ (cond [(eq_attr "alternative" "4,5,6,7")
(const_string "mskmov")
(match_test "optimize_function_for_size_p (cfun)")
(const_string "imov")
@@ -2499,7 +2500,7 @@
]
(const_string "imov")))
(set (attr "prefix")
- (if_then_else (eq_attr "alternative" "4,5,6")
+ (if_then_else (eq_attr "alternative" "4,5,6,7")
(const_string "vex")
(const_string "orig")))
(set (attr "mode")
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 73cc25d..2f977c1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70028
+ * gcc.target/i386/pr70028.c: New test.
+
2016-03-02 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
* c-c++-common/asan/swapcontext-test-1.c,
diff --git a/gcc/testsuite/gcc.target/i386/pr70028.c b/gcc/testsuite/gcc.target/i386/pr70028.c
new file mode 100644
index 0000000..c071aad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70028.c
@@ -0,0 +1,19 @@
+/* PR target/70028 */
+/* { dg-do assemble { target avx512bw } } */
+/* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target masm_intel } */
+/* { dg-options "-O2 -fno-forward-propagate -mavx512bw -masm=intel" } */
+
+typedef unsigned short A;
+typedef int B __attribute__ ((vector_size (32)));
+typedef unsigned __int128 C;
+typedef __int128 D __attribute__ ((vector_size (32)));
+
+C
+foo (A a, int b, unsigned c, C d, A e, unsigned f, B g, D h)
+{
+ g[1] ^= (A) ~ a;
+ a ^= (unsigned) g[0];
+ h %= (D) h | 1;
+ return a + b + c + d + e + g[0] + g[1] + h[1];
+}