llvm.org GIT mirror llvm / c4d3f66
fix the encodings of monitor and mwait, which were completely busted in both encoders. I'm not bothering to fix it in the old one at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95947 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
2 changed file(s) with 16 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
541541 // FIXME: This is terrible, they should get proper encoding bits in TSFlags.
542542 if (Opcode == X86::LFENCE || Opcode == X86::MFENCE ||
543543 Opcode == X86::MONITOR || Opcode == X86::MWAIT) {
544 EmitByte(ModRMByte(3, (TSFlags & X86II::FormMask)-X86II::MRM0r, 0),
544 EmitByte(ModRMByte(3, (TSFlags & X86II::FormMask)-X86II::MRM0r,
545 Opcode == X86::MWAIT),
545546 CurByte, OS);
546
547 switch (Opcode) {
548 default: break;
549 case X86::MONITOR: EmitByte(0xC8, CurByte, OS); break;
550 case X86::MWAIT: EmitByte(0xC9, CurByte, OS); break;
551 }
552547 } else {
553548 EmitRegModRMByte(MI.getOperand(CurOp++),
554549 (TSFlags & X86II::FormMask)-X86II::MRM0r,
0 // RUN: llvm-mc -triple i386-unknown-unknown --show-encoding --enable-new-x86-encoder %s | FileCheck %s
1
2 lfence
3 // CHECK: lfence
4 // CHECK: encoding: [0x0f,0xae,0xe8]
5 mfence
6 // CHECK: mfence
7 // CHECK: encoding: [0x0f,0xae,0xf0]
8 monitor
9 // CHECK: monitor
10 // CHECK: encoding: [0x0f,0x01,0xc8]
11 mwait
12 // CHECK: mwait
13 // CHECK: encoding: [0x0f,0x01,0xc9]