diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-08-12 03:04:05 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-08-12 03:04:05 +0000 |
commit | 9d27514a21364e1d1ff307d3998bc4533ade8f87 (patch) | |
tree | 3c5b6b0ddb9ba61e431be9ec93830ed8ec639f68 | |
parent | 233d0758a1cc339946828fb0b5ef014b344b47ee (diff) | |
download | external_llvm-9d27514a21364e1d1ff307d3998bc4533ade8f87.zip external_llvm-9d27514a21364e1d1ff307d3998bc4533ade8f87.tar.gz external_llvm-9d27514a21364e1d1ff307d3998bc4533ade8f87.tar.bz2 |
Fix va_arg to generate LDDFi for floating point values, instead of LDXi.
All non-FP cases use LDXi as before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7765 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/SparcV9/SparcV9InstrSelection.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index 2bc9f83..970c5fd 100644 --- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp +++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp @@ -2807,13 +2807,15 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, case 64: // reg: Phi(reg,reg) break; // don't forward the value - case 65: // reg: VaArg(reg) + case 65: // reg: VaArg(reg): the va_arg instruction { // Use value initialized by va_start as pointer to args on the stack. // Load argument via current pointer value, then increment pointer. int argSize = target.getFrameInfo().getSizeOfEachArgOnStack(); Instruction* vaArgI = subtreeRoot->getInstruction(); - mvec.push_back(BuildMI(V9::LDXi, 3).addReg(vaArgI->getOperand(0)). + MachineOpCode loadOp = vaArgI->getType()->isFloatingPoint()? V9::LDDFi + : V9::LDXi; + mvec.push_back(BuildMI(loadOp, 3).addReg(vaArgI->getOperand(0)). addSImm(0).addRegDef(vaArgI)); mvec.push_back(BuildMI(V9::ADDi, 3).addReg(vaArgI->getOperand(0)). addSImm(argSize).addRegDef(vaArgI->getOperand(0))); |