From ad8ecc8114ce17e4f8f118606225f1002d7faec2 Mon Sep 17 00:00:00 2001 From: Michael Zolotukhin Date: Fri, 15 Nov 2013 05:22:32 -0800 Subject: [PATCH] Reorder invalid default mask check gas/ 2013-11-15 Michael Zolotukhin * config/tc-i386.c (check_VecOperands): Reorder checks. gas/testsuite/ 2013-11-15 Michael Zolotukhin * gas/i386/inval-avx512f.s: Add invalid test for gather instruction with default mask. * gas/i386/inval-avx512f.l: Update correspondingly. --- gas/ChangeLog | 4 ++ gas/config/tc-i386.c | 16 +++---- gas/testsuite/ChangeLog | 6 +++ gas/testsuite/gas/i386/inval-avx512f.l | 64 ++++++++++++++------------ gas/testsuite/gas/i386/inval-avx512f.s | 4 ++ 5 files changed, 57 insertions(+), 37 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 2b8ac6e9330..57fb668f129 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2013-11-15 Michael Zolotukhin + + * config/tc-i386.c (check_VecOperands): Reorder checks. + 2013-11-11 Catherine Moore * config/mips/tc-mips.c (convert_reg_type): Use diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 973ebe4474f..4ce772ca298 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4345,6 +4345,14 @@ check_VecOperands (const insn_template *t) return 1; } + /* Check if default mask is allowed. */ + if (t->opcode_modifier.nodefmask + && (!i.mask || i.mask->mask->reg_num == 0)) + { + i.error = no_default_mask; + return 1; + } + /* For VSIB byte, we need a vector register for index, and all vector registers must be distinct. */ if (t->opcode_modifier.vecsib) @@ -4462,14 +4470,6 @@ check_VecOperands (const insn_template *t) return 1; } - /* Check if default mask is allowed. */ - if (t->opcode_modifier.nodefmask - && (!i.mask || i.mask->mask->reg_num == 0)) - { - i.error = no_default_mask; - return 1; - } - /* Check RC/SAE. */ if (i.rounding) { diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index c0f5fc36dd3..bce81e52302 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-11-15 Michael Zolotukhin + + * gas/i386/inval-avx512f.s: Add invalid test for gather instruction + with default mask. + * gas/i386/inval-avx512f.l: Update correspondingly. + 2013-11-05 Yufeng Zhang * gas/aarch64/deprecated.d: New file. diff --git a/gas/testsuite/gas/i386/inval-avx512f.l b/gas/testsuite/gas/i386/inval-avx512f.l index 9b46fae19b4..6c525f0f7af 100644 --- a/gas/testsuite/gas/i386/inval-avx512f.l +++ b/gas/testsuite/gas/i386/inval-avx512f.l @@ -9,26 +9,28 @@ .*:12: Error: .* .*:14: Error: .* .*:15: Error: .* -.*:18: Error: .* -.*:19: Error: .* +.*:17: Error: .* .*:20: Error: .* .*:21: Error: .* -.*:21: Error: .* -.*:22: Error: .* .*:22: Error: .* .*:23: Error: .* .*:23: Error: .* +.*:24: Error: .* +.*:24: Error: .* +.*:25: Error: .* .*:25: Error: .* -.*:26: Error: .* +.*:27: Error: .* .*:28: Error: .* -.*:29: Error: .* +.*:30: Error: .* .*:31: Error: .* -.*:32: Error: .* .*:33: Error: .* -.*:34: Error: .* .*:35: Error: .* .*:36: Error: .* .*:37: Error: .* +.*:38: Error: .* +.*:39: Error: .* +.*:40: Error: .* +.*:41: Error: .* GAS LISTING .* @@ -48,24 +50,28 @@ GAS LISTING .* [ ]*14[ ]+vcvtps2pd \(%eax\)\{%k1\}, %zmm1 [ ]*15[ ]+vcvtps2pd \(%eax\)\{z\}, %zmm1 [ ]*16[ ]+ -[ ]*17[ ]+\.intel_syntax noprefix -[ ]*18[ ]+mov eax\{k1\}, \{sae\} -[ ]*19[ ]+mov eax, \{sae\} -[ ]*20[ ]+mov eax\{k2\}, ebx -[ ]*21[ ]+vaddps zmm2\{z\}\{k1\}\{z\}, zmm1, zmm3 -[ ]*22[ ]+vaddps zmm2\{z\}, zmm1\{k3\}, zmm3 -[ ]*23[ ]+vaddps zmm2\{k2\}, zmm1\{k1\}, zmm3 -[ ]*24[ ]+ -[ ]*25[ ]+vcvtps2pd zmm1\{1to8\}, \[eax\] -[ ]*26[ ]+vcvtps2pd zmm1, \[eax\]\{1to16\} -[ ]*27[ ]+ -[ ]*28[ ]+vcvtps2pd zmm1, \[eax\]\{k1\} -[ ]*29[ ]+vcvtps2pd zmm1, \[eax\]\{z\} -[ ]*30[ ]+ -[ ]*31[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to8\} -[ ]*32[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to16\} -[ ]*33[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to8\} -[ ]*34[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to16\} -[ ]*35[ ]+vaddps zmm2, zmm1, ZMMWORD PTR \[eax\]\{1to16\} -[ ]*36[ ]+vaddps zmm2, zmm1, DWORD PTR \[eax\] -[ ]*37[ ]+vaddpd zmm2, zmm1, QWORD PTR \[eax\] +[ ]*17[ ]+vgatherqpd \(%rdi,%zmm2,8\),%zmm6 +[ ]*18[ ]+ +[ ]*19[ ]+\.intel_syntax noprefix +[ ]*20[ ]+mov eax\{k1\}, \{sae\} +[ ]*21[ ]+mov eax, \{sae\} +[ ]*22[ ]+mov eax\{k2\}, ebx +[ ]*23[ ]+vaddps zmm2\{z\}\{k1\}\{z\}, zmm1, zmm3 +[ ]*24[ ]+vaddps zmm2\{z\}, zmm1\{k3\}, zmm3 +[ ]*25[ ]+vaddps zmm2\{k2\}, zmm1\{k1\}, zmm3 +[ ]*26[ ]+ +[ ]*27[ ]+vcvtps2pd zmm1\{1to8\}, \[eax\] +[ ]*28[ ]+vcvtps2pd zmm1, \[eax\]\{1to16\} +[ ]*29[ ]+ +[ ]*30[ ]+vcvtps2pd zmm1, \[eax\]\{k1\} +[ ]*31[ ]+vcvtps2pd zmm1, \[eax\]\{z\} +[ ]*32[ ]+ +[ ]*33[ ]+vgatherqpd zmm6, ZMMWORD PTR \[rdi\+zmm2\*8\] +[ ]*34[ ]+ +[ ]*35[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to8\} +[ ]*36[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to16\} +[ ]*37[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to8\} +[ ]*38[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to16\} +[ ]*39[ ]+vaddps zmm2, zmm1, ZMMWORD PTR \[eax\]\{1to16\} +[ ]*40[ ]+vaddps zmm2, zmm1, DWORD PTR \[eax\] +[ ]*41[ ]+vaddpd zmm2, zmm1, QWORD PTR \[eax\] diff --git a/gas/testsuite/gas/i386/inval-avx512f.s b/gas/testsuite/gas/i386/inval-avx512f.s index c2ab50e6c8d..b1ddba44077 100644 --- a/gas/testsuite/gas/i386/inval-avx512f.s +++ b/gas/testsuite/gas/i386/inval-avx512f.s @@ -14,6 +14,8 @@ _start: vcvtps2pd (%eax){%k1}, %zmm1 vcvtps2pd (%eax){z}, %zmm1 + vgatherqpd (%rdi,%zmm2,8),%zmm6 + .intel_syntax noprefix mov eax{k1}, {sae} mov eax, {sae} @@ -28,6 +30,8 @@ _start: vcvtps2pd zmm1, [eax]{k1} vcvtps2pd zmm1, [eax]{z} + vgatherqpd zmm6, ZMMWORD PTR [rdi+zmm2*8] + vaddps zmm2, zmm1, QWORD PTR [eax]{1to8} vaddps zmm2, zmm1, QWORD PTR [eax]{1to16} vaddpd zmm2, zmm1, DWORD PTR [eax]{1to8} -- 2.30.2