From 87b84a691394e10a04efd7450e521eeaa768d143 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 30 Oct 2002 01:15:31 +0000 Subject: [PATCH] Set the destination register field based on the target specific flags llvm-svn: 4442 --- llvm/lib/Target/X86/X86InstrInfo.cpp | 7 +++++-- llvm/lib/Target/X86/X86InstrInfo.def | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 6d2bf1d49697..c81ddb19003e 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -12,8 +12,11 @@ // descriptors // static const MachineInstrDescriptor X86Insts[] = { -#define I(ENUM, NAME, FLAGS, TSFLAGS) \ - { NAME, -1, -1, 0, false, 0, 0, TSFLAGS, FLAGS }, +#define I(ENUM, NAME, FLAGS, TSFLAGS) \ + { NAME, \ + -1, /* Always vararg */ \ + ((TSFLAGS) & X86II::Void) ? -1 : 0, /* Result is in 0 */ \ + 0, false, 0, 0, TSFLAGS, FLAGS, TSFLAGS }, #include "X86InstrInfo.def" }; diff --git a/llvm/lib/Target/X86/X86InstrInfo.def b/llvm/lib/Target/X86/X86InstrInfo.def index bd4e47be4d37..2388b9bf38d2 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.def +++ b/llvm/lib/Target/X86/X86InstrInfo.def @@ -5,6 +5,10 @@ // specified below, and is used to make all of the information relevant to an // instruction be in one place. // +// Note that X86 Instructions always have the destination register listed as +// operand 0, unless it does not produce a value (in which case the TSFlags will +// include X86II::Void). +// //===----------------------------------------------------------------------===// // NOTE: No include guards desired