Artur Pietrek
2009-Oct-06 12:10 UTC
[LLVMdev] TableGen question - how to split a 64bit operation to two 32bit
Hi all,I'm working on my own backend for a custom CPU. I have defined paired registers for 64bit operations, however to set a 64bit paired register with 64bit immediate I have to set each register in that pair separately with the higher and the lower 32bits of the immediate. Could anyone give me an advice how to describe it in *InstructionInfo.td or point me to something similar in the LLVM source code? (I was looking for it but couldn't find it) Thanks, Artur -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091006/eec456ae/attachment.html>
Anton Korobeynikov
2009-Oct-06 13:09 UTC
[LLVMdev] TableGen question - how to split a 64bit operation to two 32bit
Hello, Artur> I'm working on my own backend for a custom CPU. I have defined paired > registers for 64bit operations, however to set a 64bit paired register with > 64bit immediate I have to set each register in that pair separately with the > higher and the lower 32bits of the immediate. > Could anyone give me an advice how to describe it in *InstructionInfo.td or > point me to something similar in the LLVM source code? (I was looking for it > but couldn't find it)There are several possible ways of doing so. One is to work at asmprinter level. Also, many processors have separate instructions to set e.g. low and high 16 bits of the whole 32 bit register. You might want to see, how the stuff is done there (you'll need a custom operand matching function + transform). See, e.g. arm, systemz, powerpc backends. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Jim Grosbach
2009-Oct-06 15:39 UTC
[LLVMdev] TableGen question - how to split a 64bit operation to two 32bit
Hi Artur, The Thumb2 target (in lib/Targets/ARM/ARMInstrThumb2.td) materializes a 32-bit constant by a two-instruction sequence to load the low and high half-words. It's not pretty, but it works. The pattern is at the bottom of the file. Regards, -Jim On Oct 6, 2009, at 5:10 AM, Artur Pietrek wrote:> Hi all, > I'm working on my own backend for a custom CPU. I have defined > paired registers for 64bit operations, however to set a 64bit paired > register with 64bit immediate I have to set each register in that > pair separately with the higher and the lower 32bits of the immediate. > Could anyone give me an advice how to describe it in > *InstructionInfo.td or point me to something similar in the LLVM > source code? (I was looking for it but couldn't find it) > > Thanks, > Artur > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Artur Pietrek
2009-Oct-07 11:49 UTC
[LLVMdev] TableGen question - how to split a 64bit operation to two 32bit
Hi Jim, On Tue, Oct 6, 2009 at 5:39 PM, Jim Grosbach <grosbach at apple.com> wrote:> Hi Artur, > > The Thumb2 target (in lib/Targets/ARM/ARMInstrThumb2.td) materializes a > 32-bit constant by a two-instruction sequence to load the low and high > half-words. It's not pretty, but it works. The pattern is at the bottom of > the file. > > Regards, > -JimWow, somehow I've missed that when I was looking in the source. Thanks a lot. Artur> On Oct 6, 2009, at 5:10 AM, Artur Pietrek wrote: > > Hi all, >> I'm working on my own backend for a custom CPU. I have defined paired >> registers for 64bit operations, however to set a 64bit paired register with >> 64bit immediate I have to set each register in that pair separately with the >> higher and the lower 32bits of the immediate. >> Could anyone give me an advice how to describe it in *InstructionInfo.td >> or point me to something similar in the LLVM source code? (I was looking for >> it but couldn't find it) >> >> Thanks, >> Artur >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091007/a0649379/attachment.html>
Reasonably Related Threads
- [LLVMdev] TableGen question - how to split a 64bit operation to two 32bit
- [LLVMdev] MSIL codegen
- [LLVMdev] Opportunities for meeting more frequently than once a year?
- [LLVMdev] [patch] DwarfDebug problem with line section
- [LLVMdev] Few questions about stack frame and calling conventions implementation in a backend