diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2009-11-25 15:15:30 +0000 |
---|---|---|
committer | Sebastian Pop <sebastian.pop@amd.com> | 2009-11-25 15:15:30 +0000 |
commit | ccc5981b934bd89d1b865b20dd19a5deb35af844 (patch) | |
tree | f7a7b5f1a58c2d3234a40f91840c6e410200a4f6 /opcodes/i386-dis.c | |
parent | a6d1ef576a49bde0b6813e02e354f9172ba94077 (diff) | |
download | gdb-ccc5981b934bd89d1b865b20dd19a5deb35af844.zip gdb-ccc5981b934bd89d1b865b20dd19a5deb35af844.tar.gz gdb-ccc5981b934bd89d1b865b20dd19a5deb35af844.tar.bz2 |
2009-11-17 Quentin Neill <quentin.neill@amd.com>
Sebastian Pop <sebastian.pop@amd.com>
gas/testsuite/
* gas/i386/x86-64-fma4.d: Add new patterns.
* gas/i386/x86-64-fma4.s: Same.
* gas/i386/x86-64-xop.d: Adjusted.
opcodes/
* i386-dis.c (get_vex_imm8): Increase bytes_before_imm when
decoding the second source operand from the immediate byte.
(OP_EX_VexW): Pass an extra integer to identify the second
and third source arguments.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r-- | opcodes/i386-dis.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index a69f34f..a9bb2b1 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -13691,7 +13691,7 @@ OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED) /* Get the VEX immediate byte without moving codep. */ static unsigned char -get_vex_imm8 (int sizeflag) +get_vex_imm8 (int sizeflag, int opnum) { int bytes_before_imm = 0; @@ -13708,10 +13708,13 @@ get_vex_imm8 (int sizeflag) { FETCH_DATA (the_info, codep + 1); base = *codep & 7; - /* Don't increase bytes_before_imm as this has already - been done in OP_E_memory. */ + /* When decoding the third source, don't increase + bytes_before_imm as this has already been incremented + by one in OP_E_memory while decoding the second + source operand. */ + if (opnum == 0) + bytes_before_imm++; } - switch (modrm.mod) { case 0: @@ -13725,8 +13728,13 @@ get_vex_imm8 (int sizeflag) bytes_before_imm += 4; break; case 1: - /* 1 byte displacement: codep has already been - incremented by 1 in OP_E_memory. */ + /* 1 byte displacement: when decoding the third source, + don't increase bytes_before_imm as this has already + been incremented by one in OP_E_memory while decoding + the second source operand. */ + if (opnum == 0) + bytes_before_imm++; + break; } } @@ -13744,8 +13752,13 @@ get_vex_imm8 (int sizeflag) bytes_before_imm += 2; break; case 1: - /* 1 byte displacement: codep has already been - incremented by 1 in OP_E_memory. */ + /* 1 byte displacement: when decoding the third source, + don't increase bytes_before_imm as this has already + been incremented by one in OP_E_memory while decoding + the second source operand. */ + if (opnum == 0) + bytes_before_imm++; + break; } } @@ -13856,12 +13869,12 @@ OP_EX_VexW (int bytemode, int sizeflag) codep++; if (vex.w) - reg = get_vex_imm8 (sizeflag) >> 4; + reg = get_vex_imm8 (sizeflag, 0) >> 4; } else { if (!vex.w) - reg = get_vex_imm8 (sizeflag) >> 4; + reg = get_vex_imm8 (sizeflag, 1) >> 4; } OP_EX_VexReg (bytemode, sizeflag, reg); |