From aede9b9598a49da48478c889a8f4412a8b32bcf4 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 2 Jun 2006 21:20:34 +0000 Subject: [PATCH] Use xor to clear a register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28667 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelDAGToDAG.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 3afee990b91..e8da9d79126 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -744,17 +744,17 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) { default: assert(0 && "Unsupported VT!"); case MVT::i8: LoReg = X86::AL; HiReg = X86::AH; - ClrOpcode = X86::MOV8ri; + ClrOpcode = X86::MOV8r0; SExtOpcode = X86::CBW; break; case MVT::i16: LoReg = X86::AX; HiReg = X86::DX; - ClrOpcode = X86::MOV16ri; + ClrOpcode = X86::MOV16r0; SExtOpcode = X86::CWD; break; case MVT::i32: LoReg = X86::EAX; HiReg = X86::EDX; - ClrOpcode = X86::MOV32ri; + ClrOpcode = X86::MOV32r0; SExtOpcode = X86::CDQ; break; } @@ -783,9 +783,7 @@ void X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) { SDOperand(CurDAG->getTargetNode(SExtOpcode, MVT::Flag, InFlag), 0); } else { // Zero out the high part, effectively zero extending the input. - SDOperand ClrNode = - SDOperand(CurDAG->getTargetNode(ClrOpcode, NVT, - CurDAG->getTargetConstant(0, NVT)), 0); + SDOperand ClrNode = SDOperand(CurDAG->getTargetNode(ClrOpcode, NVT), 0); Chain = CurDAG->getCopyToReg(Chain, CurDAG->getRegister(HiReg, NVT), ClrNode, InFlag); InFlag = Chain.getValue(1); -- 2.34.1