include/llvm/CodeGen/MachineInstrBuilder.h: Add addClobber() inline

convenience method.  Fix typo in comment.
lib/Target/X86/InstSelectSimple.cpp: Explicitly specify some implicit uses.
 Use MOVZX/MOVSX instead of MOV instructions with sign extend instructions.
 Take out LEAVE instructions.
 32-bit IDIV and DIV use CDQ, not CWQ (CWQ is a typo).
 Fix typo in comment and remove some FIXME comments.
lib/Target/X86/Printer.cpp: Include X86InstrInfo.h and llvm/Function.h.
 Add some simple code to Printer::runOnFunction to iterate over
  MachineBasicBlocks and call X86InstrInfo::print().
lib/Target/X86/X86InstrInfo.def: Make some more instructions with
 implicit defs "Void".  Add more sign/zero extending "move" insns
 (movsx, movzx).
lib/Target/X86/X86RegisterInfo.def: Add EFLAGS as a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4707 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brian Gaeke
2002-11-14 22:32:30 +00:00
parent e555460e4e
commit 6559bb96a9
7 changed files with 139 additions and 80 deletions

View File

@@ -34,13 +34,22 @@ struct MachineInstrBuilder {
return *this; return *this;
} }
/// addReg - Add an LLVM value that is to be used as a register...x /// addReg - Add an LLVM value that is to be used as a register...
/// ///
MachineInstrBuilder &addReg(Value *V, bool isDef = false, bool isDNU = false){ MachineInstrBuilder &addReg(Value *V, bool isDef = false, bool isDNU = false){
MI->addRegOperand(V, isDef, isDNU); MI->addRegOperand(V, isDef, isDNU);
return *this; return *this;
} }
/// addClobber - Assert that this MI is going to clobber a specific
/// register. Useful for instructions that always clobber certain hard regs.
/// (Same as addReg(RegNo, true) but shorter and more obvious).
///
MachineInstrBuilder &addClobber(int RegNo) {
MI->addRegOperand(RegNo, true);
return *this;
}
/// addPCDisp - Add an LLVM value to be treated as a PC relative /// addPCDisp - Add an LLVM value to be treated as a PC relative
/// displacement... /// displacement...
/// ///

View File

@@ -211,33 +211,30 @@ ISel::visitSetCondInst (SetCondInst & I)
break; break;
} }
// (Non-trapping) compare and pop twice. // (Non-trapping) compare and pop twice.
// FIXME: Result of comparison -> condition codes, not a register.
BuildMI (BB, X86::FUCOMPP, 0); BuildMI (BB, X86::FUCOMPP, 0);
// Move fp status word (concodes) to ax. // Move fp status word (concodes) to ax.
BuildMI (BB, X86::FNSTSWr8, 1, X86::AX); BuildMI (BB, X86::FNSTSWr8, 1, X86::AX);
// Load real concodes from ax. // Load real concodes from ax.
// FIXME: Once again, flags are not modeled. BuildMI (BB, X86::SAHF, 1, X86::EFLAGS).addReg(X86::AH);
BuildMI (BB, X86::SAHF, 0);
} }
else else
{ // integer comparison { // integer comparison
// Emit: cmp <var1>, <var2> (do the comparison). We can // Emit: cmp <var1>, <var2> (do the comparison). We can
// compare 8-bit with 8-bit, 16-bit with 16-bit, 32-bit with // compare 8-bit with 8-bit, 16-bit with 16-bit, 32-bit with
// 32-bit. // 32-bit.
// FIXME: Result of comparison -> condition codes, not a register.
switch (comparisonWidth) switch (comparisonWidth)
{ {
case 1: case 1:
BuildMI (BB, X86::CMPrr8, 2, BuildMI (BB, X86::CMPrr8, 2,
X86::NoReg).addReg (reg1).addReg (reg2); X86::EFLAGS).addReg (reg1).addReg (reg2);
break; break;
case 2: case 2:
BuildMI (BB, X86::CMPrr16, 2, BuildMI (BB, X86::CMPrr16, 2,
X86::NoReg).addReg (reg1).addReg (reg2); X86::EFLAGS).addReg (reg1).addReg (reg2);
break; break;
case 4: case 4:
BuildMI (BB, X86::CMPrr32, 2, BuildMI (BB, X86::CMPrr32, 2,
X86::NoReg).addReg (reg1).addReg (reg2); X86::EFLAGS).addReg (reg1).addReg (reg2);
break; break;
case 8: case 8:
default: default:
@@ -297,15 +294,11 @@ ISel::visitSetCondInst (SetCondInst & I)
case 1: case 1:
BuildMI (BB, X86::MOVrr8, 1, resultReg).addReg (X86::AL); BuildMI (BB, X86::MOVrr8, 1, resultReg).addReg (X86::AL);
break; break;
// FIXME: What to do about implicit destination registers?
// E.g., you don't specify it, but CBW is more like AX = CBW(AL).
case 2: case 2:
BuildMI (BB, X86::CBW, 0, X86::AX); BuildMI (BB, X86::MOVZXr16r8, 1, resultReg).addReg (X86::AL);
BuildMI (BB, X86::MOVrr16, 1, resultReg).addReg (X86::AX);
break; break;
case 4: case 4:
BuildMI (BB, X86::CWDE, 0, X86::EAX); BuildMI (BB, X86::MOVZXr32r8, 1, resultReg).addReg (X86::AL);
BuildMI (BB, X86::MOVrr32, 1, resultReg).addReg (X86::EAX);
break; break;
case 8: case 8:
default: default:
@@ -331,6 +324,7 @@ ISel::visitReturnInst (ReturnInst & I)
{ {
if (I.getNumOperands () == 1) if (I.getNumOperands () == 1)
{ {
bool unsignedReturnValue = I.getOperand(0)->getType()->isUnsigned();
unsigned val = getReg (I.getOperand (0)); unsigned val = getReg (I.getOperand (0));
unsigned operandSize = unsigned operandSize =
I.getOperand (0)->getType ()->getPrimitiveSize (); I.getOperand (0)->getType ()->getPrimitiveSize ();
@@ -358,21 +352,22 @@ ISel::visitReturnInst (ReturnInst & I)
{ {
case 1: case 1:
// ret sbyte, ubyte: Extend value into EAX and return // ret sbyte, ubyte: Extend value into EAX and return
// MOV AL, <val> if (unsignedReturnValue) {
// CBW BuildMI (BB, X86::MOVZXr32r8, 1, X86::EAX).addReg (val);
BuildMI (BB, X86::MOVrr8, 1, X86::AL).addReg (val); } else {
BuildMI (BB, X86::CBW, 0); BuildMI (BB, X86::MOVSXr32r8, 1, X86::EAX).addReg (val);
}
break; break;
case 2: case 2:
// ret short, ushort: Extend value into EAX and return // ret short, ushort: Extend value into EAX and return
// MOV AX, <val> if (unsignedReturnValue) {
// CWDE BuildMI (BB, X86::MOVZXr32r16, 1, X86::EAX).addReg (val);
BuildMI (BB, X86::MOVrr16, 1, X86::AX).addReg (val); } else {
BuildMI (BB, X86::CWDE, 0); BuildMI (BB, X86::MOVSXr32r16, 1, X86::EAX).addReg (val);
}
break; break;
case 4: case 4:
// ret int, uint, ptr: Move value into EAX and return // ret int, uint, ptr: Move value into EAX and return
// MOV EAX, <val>
BuildMI (BB, X86::MOVrr32, 1, X86::EAX).addReg (val); BuildMI (BB, X86::MOVrr32, 1, X86::EAX).addReg (val);
break; break;
case 8: case 8:
@@ -387,8 +382,7 @@ ISel::visitReturnInst (ReturnInst & I)
} }
} }
} }
// Emit a 'leave' and a 'ret' // Emit a 'ret' -- the 'leave' will be added by the reg allocator, I guess?
BuildMI (BB, X86::LEAVE, 0);
BuildMI (BB, X86::RET, 0); BuildMI (BB, X86::RET, 0);
} }
@@ -473,7 +467,7 @@ void ISel::visitDivRem(BinaryOperator &I) {
static const unsigned Regs[] ={ X86::AL , X86::AX , X86::EAX }; static const unsigned Regs[] ={ X86::AL , X86::AX , X86::EAX };
static const unsigned MovOpcode[]={ X86::MOVrr8, X86::MOVrr16, X86::MOVrr32 }; static const unsigned MovOpcode[]={ X86::MOVrr8, X86::MOVrr16, X86::MOVrr32 };
static const unsigned ExtOpcode[]={ X86::CBW , X86::CWD , X86::CWQ }; static const unsigned ExtOpcode[]={ X86::CBW , X86::CWD , X86::CDQ };
static const unsigned ClrOpcode[]={ X86::XORrr8, X86::XORrr16, X86::XORrr32 }; static const unsigned ClrOpcode[]={ X86::XORrr8, X86::XORrr16, X86::XORrr32 };
static const unsigned ExtRegs[] ={ X86::AH , X86::DX , X86::EDX }; static const unsigned ExtRegs[] ={ X86::AH , X86::DX , X86::EDX };
@@ -502,7 +496,7 @@ void ISel::visitDivRem(BinaryOperator &I) {
// Figure out which register we want to pick the result out of... // Figure out which register we want to pick the result out of...
unsigned DestReg = (I.getOpcode() == Instruction::Div) ? Reg : ExtReg; unsigned DestReg = (I.getOpcode() == Instruction::Div) ? Reg : ExtReg;
// Emit the appropriate multiple instruction... // Emit the appropriate divide or remainder instruction...
// FIXME: We need to mark that this modified AH, DX, or EDX also!! // FIXME: We need to mark that this modified AH, DX, or EDX also!!
BuildMI(BB,DivOpcode[isSigned][Class], 2, DestReg).addReg(Reg).addReg(Op1Reg); BuildMI(BB,DivOpcode[isSigned][Class], 2, DestReg).addReg(Reg).addReg(Op1Reg);

View File

@@ -6,7 +6,10 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "X86.h" #include "X86.h"
#include "X86InstrInfo.h"
#include "llvm/Pass.h" #include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunction.h"
#include <iostream> #include <iostream>
@@ -21,18 +24,41 @@ namespace {
}; };
} }
bool Printer::runOnFunction(Function &F) { /// runOnFunction - This uses the X86InstructionInfo::print method
MachineFunction &MF = MachineFunction::get(&F); /// to print assembly for each instruction.
O << "x86 printing not implemented yet!\n"; bool Printer::runOnFunction (Function & F)
{
// This should use the X86InstructionInfo::print method to print assembly static unsigned bbnumber = 0;
// for each instruction MachineFunction & MF = MachineFunction::get (&F);
const MachineInstrInfo & MII = TM.getInstrInfo ();
const X86InstrInfo & x86ii = dynamic_cast <const X86InstrInfo &> (MII);
O << "# x86 printing not implemented yet!\n";
// Print out labels for the function.
O << "\t.globl\t" << F.getName () << "\n";
O << "\t.type\t" << F.getName () << ", @function\n";
O << F.getName () << ":\n";
// Print out code for the function.
for (MachineFunction::const_iterator bb_i = MF.begin (), bb_e = MF.end ();
bb_i != bb_e; ++bb_i)
{
// Print a label for the basic block.
O << ".BB" << bbnumber++ << ":\n";
for (MachineBasicBlock::const_iterator i_i = bb_i->begin (), i_e =
bb_i->end (); i_i != i_e; ++i_i)
{
// Print the assembly for the instruction.
O << "\t";
x86ii.print (*i_i, O);
}
}
// We didn't modify anything.
return false; return false;
} }
/// createX86CodePrinterPass - Print out the specified machine code function to /// createX86CodePrinterPass - Print out the specified machine code function to
/// the specified stream. This function should work regardless of whether or /// the specified stream. This function should work regardless of whether or
/// not the function is in SSA form or not. /// not the function is in SSA form or not.

View File

@@ -6,7 +6,10 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "X86.h" #include "X86.h"
#include "X86InstrInfo.h"
#include "llvm/Pass.h" #include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunction.h"
#include <iostream> #include <iostream>
@@ -21,18 +24,41 @@ namespace {
}; };
} }
bool Printer::runOnFunction(Function &F) { /// runOnFunction - This uses the X86InstructionInfo::print method
MachineFunction &MF = MachineFunction::get(&F); /// to print assembly for each instruction.
O << "x86 printing not implemented yet!\n"; bool Printer::runOnFunction (Function & F)
{
// This should use the X86InstructionInfo::print method to print assembly static unsigned bbnumber = 0;
// for each instruction MachineFunction & MF = MachineFunction::get (&F);
const MachineInstrInfo & MII = TM.getInstrInfo ();
const X86InstrInfo & x86ii = dynamic_cast <const X86InstrInfo &> (MII);
O << "# x86 printing not implemented yet!\n";
// Print out labels for the function.
O << "\t.globl\t" << F.getName () << "\n";
O << "\t.type\t" << F.getName () << ", @function\n";
O << F.getName () << ":\n";
// Print out code for the function.
for (MachineFunction::const_iterator bb_i = MF.begin (), bb_e = MF.end ();
bb_i != bb_e; ++bb_i)
{
// Print a label for the basic block.
O << ".BB" << bbnumber++ << ":\n";
for (MachineBasicBlock::const_iterator i_i = bb_i->begin (), i_e =
bb_i->end (); i_i != i_e; ++i_i)
{
// Print the assembly for the instruction.
O << "\t";
x86ii.print (*i_i, O);
}
}
// We didn't modify anything.
return false; return false;
} }
/// createX86CodePrinterPass - Print out the specified machine code function to /// createX86CodePrinterPass - Print out the specified machine code function to
/// the specified stream. This function should work regardless of whether or /// the specified stream. This function should work regardless of whether or
/// not the function is in SSA form or not. /// not the function is in SSA form or not.

View File

@@ -211,33 +211,30 @@ ISel::visitSetCondInst (SetCondInst & I)
break; break;
} }
// (Non-trapping) compare and pop twice. // (Non-trapping) compare and pop twice.
// FIXME: Result of comparison -> condition codes, not a register.
BuildMI (BB, X86::FUCOMPP, 0); BuildMI (BB, X86::FUCOMPP, 0);
// Move fp status word (concodes) to ax. // Move fp status word (concodes) to ax.
BuildMI (BB, X86::FNSTSWr8, 1, X86::AX); BuildMI (BB, X86::FNSTSWr8, 1, X86::AX);
// Load real concodes from ax. // Load real concodes from ax.
// FIXME: Once again, flags are not modeled. BuildMI (BB, X86::SAHF, 1, X86::EFLAGS).addReg(X86::AH);
BuildMI (BB, X86::SAHF, 0);
} }
else else
{ // integer comparison { // integer comparison
// Emit: cmp <var1>, <var2> (do the comparison). We can // Emit: cmp <var1>, <var2> (do the comparison). We can
// compare 8-bit with 8-bit, 16-bit with 16-bit, 32-bit with // compare 8-bit with 8-bit, 16-bit with 16-bit, 32-bit with
// 32-bit. // 32-bit.
// FIXME: Result of comparison -> condition codes, not a register.
switch (comparisonWidth) switch (comparisonWidth)
{ {
case 1: case 1:
BuildMI (BB, X86::CMPrr8, 2, BuildMI (BB, X86::CMPrr8, 2,
X86::NoReg).addReg (reg1).addReg (reg2); X86::EFLAGS).addReg (reg1).addReg (reg2);
break; break;
case 2: case 2:
BuildMI (BB, X86::CMPrr16, 2, BuildMI (BB, X86::CMPrr16, 2,
X86::NoReg).addReg (reg1).addReg (reg2); X86::EFLAGS).addReg (reg1).addReg (reg2);
break; break;
case 4: case 4:
BuildMI (BB, X86::CMPrr32, 2, BuildMI (BB, X86::CMPrr32, 2,
X86::NoReg).addReg (reg1).addReg (reg2); X86::EFLAGS).addReg (reg1).addReg (reg2);
break; break;
case 8: case 8:
default: default:
@@ -297,15 +294,11 @@ ISel::visitSetCondInst (SetCondInst & I)
case 1: case 1:
BuildMI (BB, X86::MOVrr8, 1, resultReg).addReg (X86::AL); BuildMI (BB, X86::MOVrr8, 1, resultReg).addReg (X86::AL);
break; break;
// FIXME: What to do about implicit destination registers?
// E.g., you don't specify it, but CBW is more like AX = CBW(AL).
case 2: case 2:
BuildMI (BB, X86::CBW, 0, X86::AX); BuildMI (BB, X86::MOVZXr16r8, 1, resultReg).addReg (X86::AL);
BuildMI (BB, X86::MOVrr16, 1, resultReg).addReg (X86::AX);
break; break;
case 4: case 4:
BuildMI (BB, X86::CWDE, 0, X86::EAX); BuildMI (BB, X86::MOVZXr32r8, 1, resultReg).addReg (X86::AL);
BuildMI (BB, X86::MOVrr32, 1, resultReg).addReg (X86::EAX);
break; break;
case 8: case 8:
default: default:
@@ -331,6 +324,7 @@ ISel::visitReturnInst (ReturnInst & I)
{ {
if (I.getNumOperands () == 1) if (I.getNumOperands () == 1)
{ {
bool unsignedReturnValue = I.getOperand(0)->getType()->isUnsigned();
unsigned val = getReg (I.getOperand (0)); unsigned val = getReg (I.getOperand (0));
unsigned operandSize = unsigned operandSize =
I.getOperand (0)->getType ()->getPrimitiveSize (); I.getOperand (0)->getType ()->getPrimitiveSize ();
@@ -358,21 +352,22 @@ ISel::visitReturnInst (ReturnInst & I)
{ {
case 1: case 1:
// ret sbyte, ubyte: Extend value into EAX and return // ret sbyte, ubyte: Extend value into EAX and return
// MOV AL, <val> if (unsignedReturnValue) {
// CBW BuildMI (BB, X86::MOVZXr32r8, 1, X86::EAX).addReg (val);
BuildMI (BB, X86::MOVrr8, 1, X86::AL).addReg (val); } else {
BuildMI (BB, X86::CBW, 0); BuildMI (BB, X86::MOVSXr32r8, 1, X86::EAX).addReg (val);
}
break; break;
case 2: case 2:
// ret short, ushort: Extend value into EAX and return // ret short, ushort: Extend value into EAX and return
// MOV AX, <val> if (unsignedReturnValue) {
// CWDE BuildMI (BB, X86::MOVZXr32r16, 1, X86::EAX).addReg (val);
BuildMI (BB, X86::MOVrr16, 1, X86::AX).addReg (val); } else {
BuildMI (BB, X86::CWDE, 0); BuildMI (BB, X86::MOVSXr32r16, 1, X86::EAX).addReg (val);
}
break; break;
case 4: case 4:
// ret int, uint, ptr: Move value into EAX and return // ret int, uint, ptr: Move value into EAX and return
// MOV EAX, <val>
BuildMI (BB, X86::MOVrr32, 1, X86::EAX).addReg (val); BuildMI (BB, X86::MOVrr32, 1, X86::EAX).addReg (val);
break; break;
case 8: case 8:
@@ -387,8 +382,7 @@ ISel::visitReturnInst (ReturnInst & I)
} }
} }
} }
// Emit a 'leave' and a 'ret' // Emit a 'ret' -- the 'leave' will be added by the reg allocator, I guess?
BuildMI (BB, X86::LEAVE, 0);
BuildMI (BB, X86::RET, 0); BuildMI (BB, X86::RET, 0);
} }
@@ -473,7 +467,7 @@ void ISel::visitDivRem(BinaryOperator &I) {
static const unsigned Regs[] ={ X86::AL , X86::AX , X86::EAX }; static const unsigned Regs[] ={ X86::AL , X86::AX , X86::EAX };
static const unsigned MovOpcode[]={ X86::MOVrr8, X86::MOVrr16, X86::MOVrr32 }; static const unsigned MovOpcode[]={ X86::MOVrr8, X86::MOVrr16, X86::MOVrr32 };
static const unsigned ExtOpcode[]={ X86::CBW , X86::CWD , X86::CWQ }; static const unsigned ExtOpcode[]={ X86::CBW , X86::CWD , X86::CDQ };
static const unsigned ClrOpcode[]={ X86::XORrr8, X86::XORrr16, X86::XORrr32 }; static const unsigned ClrOpcode[]={ X86::XORrr8, X86::XORrr16, X86::XORrr32 };
static const unsigned ExtRegs[] ={ X86::AH , X86::DX , X86::EDX }; static const unsigned ExtRegs[] ={ X86::AH , X86::DX , X86::EDX };
@@ -502,7 +496,7 @@ void ISel::visitDivRem(BinaryOperator &I) {
// Figure out which register we want to pick the result out of... // Figure out which register we want to pick the result out of...
unsigned DestReg = (I.getOpcode() == Instruction::Div) ? Reg : ExtReg; unsigned DestReg = (I.getOpcode() == Instruction::Div) ? Reg : ExtReg;
// Emit the appropriate multiple instruction... // Emit the appropriate divide or remainder instruction...
// FIXME: We need to mark that this modified AH, DX, or EDX also!! // FIXME: We need to mark that this modified AH, DX, or EDX also!!
BuildMI(BB,DivOpcode[isSigned][Class], 2, DestReg).addReg(Reg).addReg(Op1Reg); BuildMI(BB,DivOpcode[isSigned][Class], 2, DestReg).addReg(Reg).addReg(Op1Reg);

View File

@@ -99,14 +99,14 @@ I(SARrr32 , "sarl", 0, 0) // R32 >>= cl D3/7
I(SARir32 , "sarl", 0, 0) // R32 >>= imm8 C1/7 ib I(SARir32 , "sarl", 0, 0) // R32 >>= imm8 C1/7 ib
// Floating point loads // Floating point loads
I(FLDr4 , "flds", 0, 0) // push float D9/0 I(FLDr4 , "flds", 0, X86II::Void) // push float D9/0
I(FLDr8 , "fldl ", 0, 0) // push double DD/0 I(FLDr8 , "fldl ", 0, X86II::Void) // push double DD/0
// Floating point compares // Floating point compares
I(FUCOMPP , "fucompp", 0, 0) // compare+pop2x DA E9 I(FUCOMPP , "fucompp", 0, X86II::Void) // compare+pop2x DA E9
// Floating point flag ops // Floating point flag ops
I(FNSTSWr8 , "fnstsw", 0, 0) // AX = fp flags DF E0 I(FNSTSWr8 , "fnstsw", 0, X86II::Void) // AX = fp flags DF E0
// Condition code ops, incl. set if equal/not equal/... // Condition code ops, incl. set if equal/not equal/...
I(SAHF , "sahf", 0, 0) // flags = AH 9E I(SAHF , "sahf", 0, 0) // flags = AH 9E
@@ -126,11 +126,16 @@ I(CMPrr8 , "cmpb", 0, 0) // compare R8,R8 38/r
I(CMPrr16 , "cmpw", 0, 0) // compare R16,R16 39/r I(CMPrr16 , "cmpw", 0, 0) // compare R16,R16 39/r
I(CMPrr32 , "cmpl", 0, 0) // compare R32,R32 39/r I(CMPrr32 , "cmpl", 0, 0) // compare R32,R32 39/r
// Sign extenders // Sign extenders (first 3 are good for DIV/IDIV; the others are more general)
I(CBW , "cbw", 0, 0) // AH = signext(AL) 98 I(CBW , "cbw", 0, 0) // AX = signext(AL) 98
I(CWD , "cwd", 0, 0) // DX = signext(AX) 99 I(CWD , "cwd", 0, 0) // DX:AX = signext(AX) 99
I(CWQ , "cwq", 0, 0) // EDX= signext(EAX) 99 I(CDQ , "cdq", 0, 0) // EDX:EAX = signext(EAX) 99
I(CWDE , "cwde", 0, 0) // EAX = extend AX 98 I(MOVSXr16r8 , "movsx", 0, 0) // R32 = signext(R8) 0F BE /r
I(MOVSXr32r8 , "movsx", 0, 0) // R32 = signext(R8) 0F BE /r
I(MOVSXr32r16 , "movsx", 0, 0) // R32 = signext(R16) 0F BF /r
I(MOVZXr16r8 , "movzx", 0, 0) // R32 = zeroext(R8) 0F B6 /r
I(MOVZXr32r8 , "movzx", 0, 0) // R32 = zeroext(R8) 0F B6 /r
I(MOVZXr32r16 , "movzx", 0, 0) // R32 = zeroext(R16) 0F B7 /r
// At this point, I is dead, so undefine the macro // At this point, I is dead, so undefine the macro
#undef I #undef I

View File

@@ -64,5 +64,10 @@ R(BH, "bh", MRF::INT8, 0)
// Flags, Segment registers, etc... // Flags, Segment registers, etc...
// This is a slimy hack to make it possible to say that flags are clobbered...
// Ideally we'd model instructions based on which particular flag(s) they
// could clobber.
R(EFLAGS, "eflags", MRF::INT8, 0)
// We are now done with the R macro // We are now done with the R macro
#undef R #undef R