Robert Muth
2011-Jul-13 16:09 UTC
[LLVMdev] problems with single byte stores in the arm backend
I have been struggling with this for way too long now, so hopefully the mighty list can help: I am trying to generate a byte store instruction storing the constant value 4 at some given address in a new helper function inside ARMISelLowering.cpp I tried: SDValue Val = DAG.getConstant(4, MVT::i8); SDValue Store = DAG.getStore(chain, dl, Val, Addr, MachinePointerInfo(), false, false, 0); This gives me a a legalizer assert for MVT::i8. If I change it to MVT::i32 the code works but instead of a single byte store (STRB) I get a word store (STR). How can I force the width of the store? Thanks, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110713/43b358a6/attachment.html>
Jim Grosbach
2011-Jul-13 16:33 UTC
[LLVMdev] problems with single byte stores in the arm backend
Hi Robert, You probably want getTruncStore() instead of getStore(). -Jim On Jul 13, 2011, at 9:09 AM, Robert Muth wrote:> I have been struggling with this for way too long now, so hopefully the mighty list can help: > > I am trying to generate a byte store instruction storing the constant value 4 at some given address > in a new helper function inside ARMISelLowering.cpp > > I tried: > > SDValue Val = DAG.getConstant(4, MVT::i8); > SDValue Store = DAG.getStore(chain, > dl, > Val, > Addr, > MachinePointerInfo(), > false, false, 0); > > > This gives me a a legalizer assert for MVT::i8. > > If I change it to MVT::i32 the code works but instead of > a single byte store (STRB) I get a word store (STR). > > How can I force the width of the store? > > Thanks, > Robert > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev