#Lattice C Bug?
This message turned up in search, but its forum couldn’t be identified from the original transcript, so it may not be linked into its thread.
I need a second opinion about something, When lattice C, (I've got vers.
3.02) compiles the statement: if(i & (1<<30)) ….
the assembly code generated is:
move.l -8(a6),d0
btst #6,d0
bne <somewhere>
Also if I used the following: if(i & 0x40000000) …
Which should be equivalent.
Where in the #*&^%$#^% is it getting 6! It will work for (1<<31) except that
it generates an andi.l #$80000000,d0 but that is alright, it wont work for
(1<<30) or (1<<29) or (1<<28) , it does work for smaller values though. My
program uses a lot of bit masking and has some masks constructed out of
multiple bits ANDed and ORed together, but the code produced is nowhere near
correct. Am I missing something in the manual somewhere? Any comments
appreciated. Gary, (At the end of his rope) Or as Arthur Dent would say,
"Would it save time if I just went mad now?"