[LLVMdev] problems with single byte stores in the arm backend

Jim Grosbach grosbach at apple.com
Wed Jul 13 09:33:32 PDT 2011


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




More information about the llvm-dev mailing list