[LLVMdev] [PATCH] Fix arm sbfx/ubfx generation

Evan Cheng evan.cheng at apple.com
Wed Oct 21 17:40:19 PDT 2009


Thanks. I've applied your patch after tweaking the test.

Evan

On Oct 20, 2009, at 8:21 PM, David Conrad wrote:

> On Oct 20, 2009, at 10:27 PM, David Conrad wrote:
> 
>> Hi,
>> 
>> Currently llvm can generate an invalid sbfx/ubfx op, for instance when compiling encoder/analyse.c in x264 (I'll reduce this to a test case if needed):
> 
> Well I just read the dev policy and saw that this was required, so test case attached. It'll break if llvm starts emitting the lsl r0, r0, #3 / asr r0, r0, #1 variants for shifts, not sure how to handle that.
> 
>> LSB isn't checked to ensure it's non-negative. In addition, LSB + Width cannot be >32, since it reduces to (Srl_imm - Shl_imm) + (32 - Srl_imm) == 32 - Shl_imm, and it was already assert()ed that 0 < Shl_imm < 32. So that check is just replaced by if (LSB < 0)
> 
> 
> <llvm-arm-neg-bfx-2.diff>_______________________________________________
> 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