Skip to content

Commit

Permalink
Rename ASM modifier trunc8, trunc16 to subreg8, subreg16.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28606 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Evan Cheng committed May 31, 2006
1 parent 2bc320d commit cbe70e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/Target/X86/X86ATTAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
"Virtual registers should not make it this far!");
O << '%';
unsigned Reg = MO.getReg();
if (Modifier && strncmp(Modifier, "trunc", strlen("trunc")) == 0) {
MVT::ValueType VT = (strcmp(Modifier,"trunc16") == 0)
if (Modifier && strncmp(Modifier, "subreg", strlen("subreg")) == 0) {
MVT::ValueType VT = (strcmp(Modifier,"subreg16") == 0)
? MVT::i16 : MVT::i8;
Reg = getX86SubSuperRegister(Reg, VT);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Target/X86/X86InstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,11 @@ def NOOP : I<0x90, RawFrm, (ops), "nop", []>;

// Truncate
def TRUNC_GR32_GR8 : I<0x88, MRMDestReg, (ops GR8:$dst, GR32_:$src),
"mov{b} {${src:trunc8}, $dst|$dst, ${src:trunc8}", []>;
"mov{b} {${src:subreg8}, $dst|$dst, ${src:subreg8}", []>;
def TRUNC_GR16_GR8 : I<0x88, MRMDestReg, (ops GR8:$dst, GR16_:$src),
"mov{b} {${src:trunc8}, $dst|$dst, ${src:trunc8}}", []>;
"mov{b} {${src:subreg8}, $dst|$dst, ${src:subreg8}}", []>;
def TRUNC_GR32_GR16 : I<0x89, MRMDestReg, (ops GR16:$dst, GR32:$src),
"mov{w} {${src:trunc16}, $dst|$dst, ${src:trunc16}}",
"mov{w} {${src:subreg16}, $dst|$dst, ${src:subreg16}}",
[(set GR16:$dst, (trunc GR32:$src))]>;

//===----------------------------------------------------------------------===//
Expand Down
4 changes: 2 additions & 2 deletions lib/Target/X86/X86IntelAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
case MachineOperand::MO_Register:
if (MRegisterInfo::isPhysicalRegister(MO.getReg())) {
unsigned Reg = MO.getReg();
if (Modifier && strncmp(Modifier, "trunc", strlen("trunc")) == 0) {
MVT::ValueType VT = (strcmp(Modifier,"trunc16") == 0)
if (Modifier && strncmp(Modifier, "subreg", strlen("subreg")) == 0) {
MVT::ValueType VT = (strcmp(Modifier,"subreg16") == 0)
? MVT::i16 : MVT::i8;
Reg = getX86SubSuperRegister(Reg, VT);
}
Expand Down

0 comments on commit cbe70e1

Please sign in to comment.