llvm.org GIT mirror llvm / 7491fd3
Merging r201507: ------------------------------------------------------------------------ r201507 | craig.topper | 2014-02-17 05:03:43 -0500 (Mon, 17 Feb 2014) | 2 lines Fix diassembler handling of rex.b when mod=00/01/10 and bbb=101. Mod=00 should ignore the base register entirely. Mod=01/10 should treat this as R13 plus displacment. Fixes PR18860. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@206056 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 6 years ago
2 changed file(s) with 27 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
10641064
10651065 switch (base) {
10661066 case 0x5:
1067 case 0xd:
10671068 switch (modFromModRM(insn->modRM)) {
10681069 case 0x0:
10691070 insn->eaDisplacement = EA_DISP_32;
10711072 break;
10721073 case 0x1:
10731074 insn->eaDisplacement = EA_DISP_8;
1074 insn->sibBase = (insn->addressSize == 4 ?
1075 SIB_BASE_EBP : SIB_BASE_RBP);
1075 insn->sibBase = (SIBBase)(sibBaseBase + base);
10761076 break;
10771077 case 0x2:
10781078 insn->eaDisplacement = EA_DISP_32;
1079 insn->sibBase = (insn->addressSize == 4 ?
1080 SIB_BASE_EBP : SIB_BASE_RBP);
1079 insn->sibBase = (SIBBase)(sibBaseBase + base);
10811080 break;
10821081 case 0x3:
10831082 debug("Cannot have Mod = 0b11 and a SIB byte");
240240
241241 # CHECK: pextrw $3, %xmm3, (%rax)
242242 0x66 0x0f 0x3a 0x15 0x18 0x03
243
244 # CHECK: $0, 305419896(,%r8)
245 0x43 0x80 0x04 0x05 0x78 0x56 0x34 0x12 0x00
246
247 # CHECK: $0, 305419896(%r13,%r8)
248 0x43 0x80 0x84 0x05 0x78 0x56 0x34 0x12 0x00
249
250 # CHECK: $0, 305419896(,%r8)
251 0x42 0x80 0x04 0x05 0x78 0x56 0x34 0x12 0x00
252
253 # CHECK: $0, 305419896(%rbp,%r8)
254 0x42 0x80 0x84 0x05 0x78 0x56 0x34 0x12 0x00
255
256 # CHECK: $0, 305419896(,%r12)
257 0x42 0x80 0x04 0x25 0x78 0x56 0x34 0x12 0x00
258
259 # CHECK: $0, 305419896(%rbp,%r12)
260 0x42 0x80 0x84 0x25 0x78 0x56 0x34 0x12 0x00
261
262 # CHECK: $0, 305419896
263 0x80 0x04 0x25 0x78 0x56 0x34 0x12 0x00
264
265 # CHECK: $0, 305419896(%rbp)
266 0x80 0x84 0x25 0x78 0x56 0x34 0x12 0x00