Disassembly broken?

Hi all.

I came across a strange behaviour in the instruction printer for Thumbv2:

The instruction is 0xf000b800, which is a b.w #0

LLVM returns it as b.w #-262144, which doesn't make any sense to me.

Should I consider it a bug?

Yep, b.w using ARM’s “alternative syntax” is broken. Luckily, though LLVM bitcode doesn’t compile to this form, and will always use a label instead. Here’s a patch that only acknowledges the broken instructions:

https://github.com/garious/llvm/commit/916c4badd816178da9fdbac5b5ed2331a7201f98

I submitted this to llvm-commits a while back, but nobody replied. :frowning:

-Greg

Ah, sometimes things get lost. How about resubmitting the patch and cc’ing me and grosbach@apple.com?

Thanks!

-eric

Greg Cc me too on the bug. If Eric doesn’t get to this I’ll be back in the office next week on Wednesday before Jim gets back the following week and take a look at it.

Kev