I'm working on a target based on the MIPS target, and when I copy f64 values into 32 bit registers for calling functions, I need the operation to work on a of 32 bit registers (because the language I'm translating to isn't actually mips).  I've been looking at how to do this, but I haven't been able to figure it out.  Since the Mips target code is still really close to mine, I'll use it's code to explain relavent details.  Any help would be highly appreciated.<br>
<br>The idea I tried to implement to accomplish this is to create a 64 bit register class that is set up to span two 32 bit registers in the same way as the 64 bit floats span two 32 bit floating point registers in mips.  Creating the register class is easy enough to implement in the RegisterInfo.td file.   <br>
<br>The next thing I wanted to do is create a Pseudo-Element similar to the ExtractElementF64 in mips. I added the following Code to InstrFPU.td (and added the CopyF64 ISD to another file):<br><br>    def SDT_MipsCopyF64 : SDTypeProfile<1, 1, [SDTCisVT<0, i64>,<br>
                                          SDTCisVT<1, f64>]>;<br><br>    def MipsCopyF64 : SDNode<"MIPSISD::CopyF64",<br>                                   SDT_MIPSCopyF64>;<br><br>I also changed CPU64Regs to CPU64PRegs ( My 64 bit paired register class) in the DMFC1 rule for testing.<br>
<br>Next, I added the code in ExpandPseudo to use the following pseudo instruction expansion:<br><br>    void MipsExpandPseudo::ExpandCopyF64(MachineBasicBlock& MBB,<br>                                               MachineBasicBlock::iterator I) {<br>
      unsigned DstReg = I->getOperand(0).getReg();<br>      unsigned SrcReg = I->getOperand(1).getReg();<br>      const MCInstrDesc& Dmfc1Tdd = TII->get(MIPS::DMFC1);<br><br>      DebugLoc dl = I->getDebugLoc();<br>
      const uint16_t* SubReg = TM.getRegisterInfo()->getSubRegisters(SrcReg);<br><br>      BuildMI(MBB, I, dl, Dmfc1Tdd, DstReg).addReg(*SubReg);<br>    }<br><br>Finally, I want to add the rule to ISelLowering to actually use these rules.  Under the CCValAssign::Full case in the LowerCall function, here is the old code:<br>
          SDValue Lo = DAG.getNode(MIPSISD::ExtractElementF64, dl, MVT::i32,<br>                                   Arg, DAG.getConstant(0, MVT::i32));<br>          SDValue Hi = DAG.getNode(MIPSISD::ExtractElementF64, dl, MVT::i32,<br>
                                   Arg, DAG.getConstant(1, MVT::i32));<br><br>          if (!Subtarget->isLittle())<br>            std::swap(Lo, Hi);<br><br>          unsigned LocRegLo = VA.getLocReg();<br>          unsigned LocRegHigh = getNextIntArgReg(LocRegLo);<br>
<br>          RegsToPass.push_back(std::make_pair(LocRegLo, Lo));<br>          RegsToPass.push_back(std::make_pair(LocRegHigh, Hi));<br><br>I added this SDValue: <br>    SDValue Num = DAG.getNode(MIPSISD::CopyF64,dl,MVT::i32, Arg);<br>
<br>But I need to create a Hi and a Lo SDValue to add to the RegsToPass pairs seen in the code above.  If someone would help me figure out what goes here, I would be very thankful:<br>    SDValue Hi = ?<br>    SDValue Lo = ?<br>
<br><br><br>