add encoder support and tests for rdtscp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96076 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-02-13 03:42:24 +00:00
parent a1e7621510
commit b779033a23
4 changed files with 14 additions and 1 deletions

View File

@ -279,6 +279,7 @@ namespace X86II {
MRM_E8 = 39,
MRM_F0 = 40,
MRM_F8 = 41,
MRM_F9 = 42,
FormMask = 63,

View File

@ -617,6 +617,10 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
EmitByte(BaseOpcode, CurByte, OS);
EmitByte(0xF8, CurByte, OS);
break;
case X86II::MRM_F9:
EmitByte(BaseOpcode, CurByte, OS);
EmitByte(0xF9, CurByte, OS);
break;
}
// If there is a remaining operand, it must be a trailing immediate. Emit it

View File

@ -29,6 +29,11 @@
// CHECK: swapgs
// CHECK: encoding: [0x0f,0x01,0xf8]
rdtscp
// CHECK: rdtscp
// CHECK: encoding: [0x0f,0x01,0xf9]
// CHECK: movl %eax, 16(%ebp) # encoding: [0x89,0x45,0x10]
movl %eax, 16(%ebp)
// CHECK: movl %eax, -16(%ebp) # encoding: [0x89,0x45,0xf0]

View File

@ -38,4 +38,7 @@
0x0f 0x01 0xc4
# CHECK: swapgs
0x0f 0x01 0xf8
0x0f 0x01 0xf8
# CHECK: rdtscp
0x0f 0x01 0xf9