aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386.c16
-rw-r--r--gas/testsuite/gas/i386/intel.s4
-rw-r--r--gas/testsuite/gas/i386/opcode.s4
-rw-r--r--gas/testsuite/gas/i386/x86-64-xop.s44
-rw-r--r--gas/testsuite/gas/i386/xop.s50
5 files changed, 66 insertions, 52 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index d54cb65..920c4bd 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2373,7 +2373,8 @@ smallest_imm_type (offsetT num)
}
else if (fits_in_signed_byte (num))
{
- t.bitfield.imm8 = 1;
+ if (fits_in_unsigned_byte (num))
+ t.bitfield.imm8 = 1;
t.bitfield.imm8s = 1;
t.bitfield.imm16 = 1;
t.bitfield.imm32 = 1;
@@ -7829,6 +7830,18 @@ static int
update_imm (unsigned int j)
{
i386_operand_type overlap = i.types[j];
+
+ if (i.tm.operand_types[j].bitfield.imm8
+ && i.tm.operand_types[j].bitfield.imm8s
+ && overlap.bitfield.imm8 && overlap.bitfield.imm8s)
+ {
+ /* This combination is used on 8-bit immediates where e.g. $~0 is
+ desirable to permit. We're past operand type matching, so simply
+ put things back in the shape they were before introducing the
+ distinction between Imm8, Imm8S, and Imm8|Imm8S. */
+ overlap.bitfield.imm8s = 0;
+ }
+
if (overlap.bitfield.imm8
+ overlap.bitfield.imm8s
+ overlap.bitfield.imm16
@@ -8318,6 +8331,7 @@ build_modrm_byte (void)
|| (i.tm.opcode_modifier.vexvvvv == VEXXDS
&& i.imm_operands == 1
&& (i.types[0].bitfield.imm8
+ || i.types[0].bitfield.imm8s
|| i.types[i.operands - 1].bitfield.imm8)));
if (i.imm_operands == 2)
source = 2;
diff --git a/gas/testsuite/gas/i386/intel.s b/gas/testsuite/gas/i386/intel.s
index 7afc490..922f260 100644
--- a/gas/testsuite/gas/i386/intel.s
+++ b/gas/testsuite/gas/i386/intel.s
@@ -205,8 +205,8 @@ foo:
rcl dword ptr 0x90909090[eax]
rcl byte ptr 0x90909090[eax], cl
rcl dword ptr 0x90909090[eax], cl
- aam 0xffffff90
- aad 0xffffff90
+ aam 0x90
+ aad 0x90
xlat byte ptr ds:[ebx]
fcom dword ptr 0x90909090[eax]
fst dword ptr 0x90909090[eax]
diff --git a/gas/testsuite/gas/i386/opcode.s b/gas/testsuite/gas/i386/opcode.s
index e1227b7..8b87dd7 100644
--- a/gas/testsuite/gas/i386/opcode.s
+++ b/gas/testsuite/gas/i386/opcode.s
@@ -202,8 +202,8 @@ foo:
rcll 0x90909090(%eax)
rclb %cl,0x90909090(%eax)
rcll %cl,0x90909090(%eax)
- aam $0xffffff90
- aad $0xffffff90
+ aam $0x90
+ aad $0x90
xlat %ds:(%ebx)
fcoms 0x90909090(%eax)
fsts 0x90909090(%eax)
diff --git a/gas/testsuite/gas/i386/x86-64-xop.s b/gas/testsuite/gas/i386/x86-64-xop.s
index 98f3c46..f63bebe 100644
--- a/gas/testsuite/gas/i386/x86-64-xop.s
+++ b/gas/testsuite/gas/i386/x86-64-xop.s
@@ -911,20 +911,20 @@ _start:
VPROTB %xmm15,%xmm15,%xmm15
# Tests for op VPROTB imm8, xmm2, xmm1 (at&t syntax)
VPROTB $0x3,%xmm11,%xmm15
- VPROTB $0xFF,%xmm0,%xmm0
- VPROTB $0xFF,%xmm11,%xmm4
+ VPROTB $-1,%xmm0,%xmm0
+ VPROTB $-1,%xmm11,%xmm4
VPROTB $0x0,%xmm11,%xmm4
VPROTB $0x0,%xmm15,%xmm4
VPROTB $0x0,%xmm0,%xmm15
- VPROTB $0xFF,%xmm11,%xmm0
+ VPROTB $-1,%xmm11,%xmm0
VPROTB $0x3,%xmm0,%xmm0
VPROTB $0x3,%xmm11,%xmm0
VPROTB $0x0,%xmm0,%xmm4
- VPROTB $0xFF,%xmm15,%xmm0
- VPROTB $0xFF,%xmm0,%xmm15
- VPROTB $0xFF,%xmm15,%xmm15
+ VPROTB $-1,%xmm15,%xmm0
+ VPROTB $-1,%xmm0,%xmm15
+ VPROTB $-1,%xmm15,%xmm15
VPROTB $0x3,%xmm15,%xmm4
- VPROTB $0xFF,%xmm11,%xmm15
+ VPROTB $-1,%xmm11,%xmm15
VPROTB $0x3,%xmm0,%xmm15
# Tests for op VPROTD xmm3, xmm2/mem128, xmm1 (at&t syntax)
VPROTD %xmm2,%xmm0,%xmm15
@@ -964,17 +964,17 @@ _start:
VPROTD $0x0,%xmm15,%xmm15
VPROTD $0x0,(%rsi),%xmm15
VPROTD $0x0,%xmm0,%xmm11
- VPROTD $0xFF,%xmm15,%xmm0
+ VPROTD $-1,%xmm15,%xmm0
VPROTD $0x3,%xmm0,%xmm0
VPROTD $0x3,%xmm15,%xmm0
VPROTD $0x0,%xmm11,%xmm11
VPROTD $0x0,%xmm0,%xmm15
VPROTD $0x3,(%rcx),%xmm0
- VPROTD $0xFF,(%rsi),%xmm0
+ VPROTD $-1,(%rsi),%xmm0
VPROTD $0x0,(%rdi),%xmm15
- VPROTD $0xFF,%xmm15,%xmm15
- VPROTD $0xFF,%xmm11,%xmm11
- VPROTD $0xFF,(%rsi),%xmm11
+ VPROTD $-1,%xmm15,%xmm15
+ VPROTD $-1,%xmm11,%xmm11
+ VPROTD $-1,(%rsi),%xmm11
VPROTD $0x3,(%rdi),%xmm15
VPROTD $0x3,%xmm15,%xmm11
# Tests for op VPROTQ xmm3, xmm2/mem128, xmm1 (at&t syntax)
@@ -1015,17 +1015,17 @@ _start:
VPROTQ $0x0,%xmm15,%xmm15
VPROTQ $0x0,(%rsi),%xmm15
VPROTQ $0x0,%xmm0,%xmm11
- VPROTQ $0xFF,%xmm15,%xmm0
+ VPROTQ $-1,%xmm15,%xmm0
VPROTQ $0x3,%xmm0,%xmm0
VPROTQ $0x3,%xmm15,%xmm0
VPROTQ $0x0,%xmm11,%xmm11
VPROTQ $0x0,%xmm0,%xmm15
VPROTQ $0x3,(%rcx),%xmm0
- VPROTQ $0xFF,(%rsi),%xmm0
+ VPROTQ $-1,(%rsi),%xmm0
VPROTQ $0x0,(%rdi),%xmm15
- VPROTQ $0xFF,%xmm15,%xmm15
- VPROTQ $0xFF,%xmm11,%xmm11
- VPROTQ $0xFF,(%rsi),%xmm11
+ VPROTQ $-1,%xmm15,%xmm15
+ VPROTQ $-1,%xmm11,%xmm11
+ VPROTQ $-1,(%rsi),%xmm11
VPROTQ $0x3,(%rdi),%xmm15
VPROTQ $0x3,%xmm15,%xmm11
# Tests for op VPROTW xmm3, xmm2/mem128, xmm1 (at&t syntax)
@@ -1066,17 +1066,17 @@ _start:
VPROTW $0x0,%xmm15,%xmm15
VPROTW $0x0,(%rsi),%xmm15
VPROTW $0x0,%xmm0,%xmm11
- VPROTW $0xFF,%xmm15,%xmm0
+ VPROTW $-1,%xmm15,%xmm0
VPROTW $0x3,%xmm0,%xmm0
VPROTW $0x3,%xmm15,%xmm0
VPROTW $0x0,%xmm11,%xmm11
VPROTW $0x0,%xmm0,%xmm15
VPROTW $0x3,(%rcx),%xmm0
- VPROTW $0xFF,(%rsi),%xmm0
+ VPROTW $-1,(%rsi),%xmm0
VPROTW $0x0,(%rdi),%xmm15
- VPROTW $0xFF,%xmm15,%xmm15
- VPROTW $0xFF,%xmm11,%xmm11
- VPROTW $0xFF,(%rsi),%xmm11
+ VPROTW $-1,%xmm15,%xmm15
+ VPROTW $-1,%xmm11,%xmm11
+ VPROTW $-1,(%rsi),%xmm11
VPROTW $0x3,(%rdi),%xmm15
VPROTW $0x3,%xmm15,%xmm11
# Tests for op VPSHAB xmm3, xmm2/mem128, xmm1 (at&t syntax)
diff --git a/gas/testsuite/gas/i386/xop.s b/gas/testsuite/gas/i386/xop.s
index 5b7697a..0a8d411 100644
--- a/gas/testsuite/gas/i386/xop.s
+++ b/gas/testsuite/gas/i386/xop.s
@@ -911,20 +911,20 @@ _start:
VPROTB %xmm1,%xmm7,%xmm3
# Tests for op VPROTB imm8, xmm2, xmm1 (at&t syntax)
VPROTB $0x3,%xmm5,%xmm2
- VPROTB $0xFF,%xmm0,%xmm0
- VPROTB $0xFF,%xmm5,%xmm7
+ VPROTB $-1,%xmm0,%xmm0
+ VPROTB $-1,%xmm5,%xmm7
VPROTB $0x0,%xmm5,%xmm7
VPROTB $0x0,%xmm7,%xmm7
VPROTB $0x0,%xmm0,%xmm2
- VPROTB $0xFF,%xmm5,%xmm0
+ VPROTB $-1,%xmm5,%xmm0
VPROTB $0x3,%xmm0,%xmm0
VPROTB $0x3,%xmm5,%xmm0
VPROTB $0x0,%xmm0,%xmm7
- VPROTB $0xFF,%xmm7,%xmm0
- VPROTB $0xFF,%xmm0,%xmm2
- VPROTB $0xFF,%xmm7,%xmm2
+ VPROTB $-1,%xmm7,%xmm0
+ VPROTB $-1,%xmm0,%xmm2
+ VPROTB $-1,%xmm7,%xmm2
VPROTB $0x3,%xmm7,%xmm7
- VPROTB $0xFF,%xmm5,%xmm2
+ VPROTB $-1,%xmm5,%xmm2
VPROTB $0x3,%xmm0,%xmm2
# Tests for op VPROTD xmm3, xmm2/mem128, xmm1 (at&t syntax)
VPROTD %xmm7,%xmm0,%xmm3
@@ -964,18 +964,18 @@ _start:
VPROTD $0x0,%xmm7,%xmm7
VPROTD $0x0,(%ebx),%xmm7
VPROTD $0x0,%xmm0,%xmm5
- VPROTD $0xFF,%xmm5,%xmm0
+ VPROTD $-1,%xmm5,%xmm0
VPROTD $0x3,%xmm0,%xmm0
VPROTD $0x3,%xmm7,%xmm0
VPROTD $0x0,%xmm5,%xmm5
VPROTD $0x0,%xmm0,%xmm7
VPROTD $0x3,(%eax),%xmm0
- VPROTD $0xFF,(%ebx),%xmm0
+ VPROTD $-1,(%ebx),%xmm0
VPROTD $0x0,(%eax),%xmm7
- VPROTD $0xFF,%xmm7,%xmm7
- VPROTD $0xFF,%xmm5,%xmm5
- VPROTD $0xFF,(%ebx),%xmm5
- VPROTD $0xFF,%xmm7,%xmm0
+ VPROTD $-1,%xmm7,%xmm7
+ VPROTD $-1,%xmm5,%xmm5
+ VPROTD $-1,(%ebx),%xmm5
+ VPROTD $-1,%xmm7,%xmm0
VPROTD $0x3,(%eax),%xmm7
# Tests for op VPROTQ xmm3, xmm2/mem128, xmm1 (at&t syntax)
VPROTQ %xmm7,%xmm0,%xmm3
@@ -1015,18 +1015,18 @@ _start:
VPROTQ $0x0,%xmm7,%xmm7
VPROTQ $0x0,(%ebx),%xmm7
VPROTQ $0x0,%xmm0,%xmm5
- VPROTQ $0xFF,%xmm5,%xmm0
+ VPROTQ $-1,%xmm5,%xmm0
VPROTQ $0x3,%xmm0,%xmm0
VPROTQ $0x3,%xmm7,%xmm0
VPROTQ $0x0,%xmm5,%xmm5
VPROTQ $0x0,%xmm0,%xmm7
VPROTQ $0x3,(%eax),%xmm0
- VPROTQ $0xFF,(%ebx),%xmm0
+ VPROTQ $-1,(%ebx),%xmm0
VPROTQ $0x0,(%eax),%xmm7
- VPROTQ $0xFF,%xmm7,%xmm7
- VPROTQ $0xFF,%xmm5,%xmm5
- VPROTQ $0xFF,(%ebx),%xmm5
- VPROTQ $0xFF,%xmm7,%xmm0
+ VPROTQ $-1,%xmm7,%xmm7
+ VPROTQ $-1,%xmm5,%xmm5
+ VPROTQ $-1,(%ebx),%xmm5
+ VPROTQ $-1,%xmm7,%xmm0
VPROTQ $0x3,(%eax),%xmm7
# Tests for op VPROTW xmm3, xmm2/mem128, xmm1 (at&t syntax)
VPROTW %xmm7,%xmm0,%xmm3
@@ -1066,18 +1066,18 @@ _start:
VPROTW $0x0,%xmm7,%xmm7
VPROTW $0x0,(%ebx),%xmm7
VPROTW $0x0,%xmm0,%xmm5
- VPROTW $0xFF,%xmm5,%xmm0
+ VPROTW $-1,%xmm5,%xmm0
VPROTW $0x3,%xmm0,%xmm0
VPROTW $0x3,%xmm7,%xmm0
VPROTW $0x0,%xmm5,%xmm5
VPROTW $0x0,%xmm0,%xmm7
VPROTW $0x3,(%eax),%xmm0
- VPROTW $0xFF,(%ebx),%xmm0
+ VPROTW $-1,(%ebx),%xmm0
VPROTW $0x0,(%eax),%xmm7
- VPROTW $0xFF,%xmm7,%xmm7
- VPROTW $0xFF,%xmm5,%xmm5
- VPROTW $0xFF,(%ebx),%xmm5
- VPROTW $0xFF,%xmm7,%xmm0
+ VPROTW $-1,%xmm7,%xmm7
+ VPROTW $-1,%xmm5,%xmm5
+ VPROTW $-1,(%ebx),%xmm5
+ VPROTW $-1,%xmm7,%xmm0
VPROTW $0x3,(%eax),%xmm7
# Tests for op VPSHAB xmm3, xmm2/mem128, xmm1 (at&t syntax)
VPSHAB %xmm7,%xmm0,%xmm3