Hi, In order to emit "la $4,ADDR" instead of lui followed by addiu to load the data address, could you advise what is proper way to revise td files in the MIPS target? Thanks, -- Gang-Ryung Uh, Associate Professor Department of Computer Science College of Engineering, Boise State Univerisity tel: 1 208 426-5691 e-mail:guh at boisestate.edu http://cs.boisestate.edu/~uh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111005/623e2d60/attachment.html>
On Oct 5, 2011, at 4:01 PM, Gang-Ryung Uh wrote:> Hi, > > In order to emit "la $4,ADDR" instead of lui followed by addiu to load the data address, could you advise what is proper way to revise td files in the MIPS target?Why? -eric
Hi, for our micro-architecture research, we are using simplescalar 3.0 32bit mips simulator, which comes with binutils 1.5.2, and the ld fails at "lui" (bfd error). However, the ld is happy with "la" (assembler macro) and simulator correctly simulates. On Wed, Oct 5, 2011 at 5:04 PM, Eric Christopher <echristo at apple.com> wrote:> > On Oct 5, 2011, at 4:01 PM, Gang-Ryung Uh wrote: > > > Hi, > > > > In order to emit "la $4,ADDR" instead of lui followed by addiu to > load the data address, could you advise what is proper way to revise td > files in the MIPS target? > > Why? > > -eric > >-- Gang-Ryung Uh, Associate Professor Department of Computer Science College of Engineering, Boise State Univerisity tel: 1 208 426-5691 e-mail:guh at boisestate.edu http://cs.boisestate.edu/~uh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111005/3e386d99/attachment.html>
Do you want to replace lui $2, %hi(g1) addiu $2, $2, %lo(g1) with this? la $2, g1 If that is the case, you can add this pattern. def op_la : Operand<i32>; def LA : FI<0x09, (outs CPURegs:$dst), (ins op_la:$addr0, op_la:$addr1), "la $dst, $addr0", [(set CPURegs:$dst, (add (MipsHi tglobaladdr:$addr0), (MipsLo tglobaladdr:$addr1)))], IIAlu>; Note that you still need to find a way to print "g1" instead of "%hi(g1)". On Wed, Oct 5, 2011 at 4:01 PM, Gang-Ryung Uh <guh at boisestate.edu> wrote:> Hi, > In order to emit "la $4,ADDR" instead of lui followed by addiu to load > the data address, could you advise what is proper way to revise td files in > the MIPS target? > Thanks, > > -- > Gang-Ryung Uh, Associate Professor > Department of Computer Science > College of Engineering, Boise State Univerisity > tel: 1 208 426-5691 e-mail:guh at boisestate.edu > http://cs.boisestate.edu/~uh > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Hi, I noticed one class in MipsInstrFormats.td:L46 -> Class MipsPseudo. I wonder whether I can use this. If does, I wonder what would be the right way to use. Thanks, On Thu, Oct 6, 2011 at 11:29 AM, Akira Hatanaka <ahatanak at gmail.com> wrote:> Do you want to replace > > lui $2, %hi(g1) > addiu $2, $2, %lo(g1) > > with this? > la $2, g1 > > If that is the case, you can add this pattern. > > def op_la : Operand<i32>; > > def LA : > FI<0x09, (outs CPURegs:$dst), (ins op_la:$addr0, op_la:$addr1), > "la $dst, $addr0", [(set CPURegs:$dst, > (add (MipsHi tglobaladdr:$addr0), (MipsLo > tglobaladdr:$addr1)))], IIAlu>; > > Note that you still need to find a way to print "g1" instead of "%hi(g1)". > > On Wed, Oct 5, 2011 at 4:01 PM, Gang-Ryung Uh <guh at boisestate.edu> wrote: > > Hi, > > In order to emit "la $4,ADDR" instead of lui followed by addiu to > load > > the data address, could you advise what is proper way to revise td files > in > > the MIPS target? > > Thanks, > > > > -- > > Gang-Ryung Uh, Associate Professor > > Department of Computer Science > > College of Engineering, Boise State Univerisity > > tel: 1 208 426-5691 e-mail:guh at boisestate.edu > > http://cs.boisestate.edu/~uh > > > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > >-- Gang-Ryung Uh, Associate Professor Department of Computer Science College of Engineering, Boise State Univerisity tel: 1 208 426-5691 e-mail:guh at boisestate.edu http://cs.boisestate.edu/~uh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111007/34b764f3/attachment.html>