[LLVMdev] Thumb-2 code generation error in Apple LLVM at all optimization levels

Don Quixote de la Mancha quixote at dulcineatech.com
Fri Nov 11 18:12:24 PST 2011


On Fri, Nov 11, 2011 at 5:26 PM, Owen Anderson <resistor at mac.com> wrote:
> This is not quite right.  It does have a 12-bit immediate field, but it is decomposed into an 8-bit base immediate and a 4-bit right-rotate value.  Your example of #4000 is encoded as a base value of 0xfa and a rotate of 0xe, which is correct.
>
>> I don't know what the "it hs" instruction does.  I suspect that's
>> where the problem lies, but "it" is a very common word, and "hs" is
>> quite common as well, as it is a frequent mispelling for "has".
>> Perhaps someone who knows Thumb-2 assembly better than I do could
>> comment.
>
> The IT instruction is how you express predication in Thumb2.  Unlike ARM instructions, where the predicate is part of the instruction, Thumb2 instructions use IT to set the predicates for following instructions.  In this case, it applies the "hs" predicate to the subsequent call to _usleep.  I'd have to double check, but I'm fairly confident that the hs condition code is equivalent to >= for integers.

All of my regression testing so far has had my speed slider set to its
maximum, so the useconds_t has always been precisely zero.

Maybe there's something special about zero that would not be the case
for an integer ranging from 1 to 3999.

I'll check that out, but not right now, I'm about to pass right out,
but I don't want to because I am even more hungry than I am tired.

There is a pizza joint within walking distance of my apartment.  I'm
going to go stuff myself silly.



-- 
Don Quixote de la Mancha
Dulcinea Technologies Corporation
Software of Elegance and Beauty
http://www.dulcineatech.com
quixote at dulcineatech.com




More information about the llvm-dev mailing list