diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-09-30 19:44:32 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-09-30 19:44:32 +0000 |
commit | 6672f86a4d9fe3c84c82aafbe8d4f6a43f3c2218 (patch) | |
tree | 17702d2aab994ca1f4116a0918c6d75028702bf5 | |
parent | 14abc25f76cedc69448c4cf2c649d5796e37b1bc (diff) |
I think this will handle double args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16618 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Sparc/SparcV8ISelSimple.cpp | 17 | ||||
-rw-r--r-- | lib/Target/SparcV8/SparcV8ISelSimple.cpp | 17 |
2 files changed, 30 insertions, 4 deletions
diff --git a/lib/Target/Sparc/SparcV8ISelSimple.cpp b/lib/Target/Sparc/SparcV8ISelSimple.cpp index fe11d84d50..2a240e2506 100644 --- a/lib/Target/Sparc/SparcV8ISelSimple.cpp +++ b/lib/Target/Sparc/SparcV8ISelSimple.cpp @@ -349,9 +349,22 @@ void V8ISel::LoadArgumentsToVirtualRegs (Function *LF) { BuildMI (BB, V8::LDFri, 2, Reg).addFrameIndex (FI).addSImm (0); break; } + case cDouble: { + // Double-fp args are passed in pairs of integer registers; go through + // memory to get them into FP registers. (Double bleh!) + unsigned DblAlign = TM.getTargetData().getDoubleAlignment(); + int FI = F->getFrameInfo()->CreateStackObject(8, DblAlign); + BuildMI (BB, V8::ST, 3).addFrameIndex (FI).addSImm (0) + .addReg (IncomingArgRegs[ArgOffset]); + ++ArgOffset; + BuildMI (BB, V8::ST, 3).addFrameIndex (FI).addSImm (4) + .addReg (IncomingArgRegs[ArgOffset]); + BuildMI (BB, V8::LDDFri, 2, Reg).addFrameIndex (FI).addSImm (0); + break; + } default: - // FIXME: handle cDouble, cLong - assert (0 && "64-bit (double, long, etc.) function args not handled"); + // FIXME: handle cLong + assert (0 && "64-bit int (long/ulong) function args not handled"); return; } diff --git a/lib/Target/SparcV8/SparcV8ISelSimple.cpp b/lib/Target/SparcV8/SparcV8ISelSimple.cpp index fe11d84d50..2a240e2506 100644 --- a/lib/Target/SparcV8/SparcV8ISelSimple.cpp +++ b/lib/Target/SparcV8/SparcV8ISelSimple.cpp @@ -349,9 +349,22 @@ void V8ISel::LoadArgumentsToVirtualRegs (Function *LF) { BuildMI (BB, V8::LDFri, 2, Reg).addFrameIndex (FI).addSImm (0); break; } + case cDouble: { + // Double-fp args are passed in pairs of integer registers; go through + // memory to get them into FP registers. (Double bleh!) + unsigned DblAlign = TM.getTargetData().getDoubleAlignment(); + int FI = F->getFrameInfo()->CreateStackObject(8, DblAlign); + BuildMI (BB, V8::ST, 3).addFrameIndex (FI).addSImm (0) + .addReg (IncomingArgRegs[ArgOffset]); + ++ArgOffset; + BuildMI (BB, V8::ST, 3).addFrameIndex (FI).addSImm (4) + .addReg (IncomingArgRegs[ArgOffset]); + BuildMI (BB, V8::LDDFri, 2, Reg).addFrameIndex (FI).addSImm (0); + break; + } default: - // FIXME: handle cDouble, cLong - assert (0 && "64-bit (double, long, etc.) function args not handled"); + // FIXME: handle cLong + assert (0 && "64-bit int (long/ulong) function args not handled"); return; } |