Why do my MIPS crosscompiler works like this for NOT operation?

Posted by Mazicky on Stack Overflow See other posts from Stack Overflow or by Mazicky
Published on 2010-03-30T01:58:30Z Indexed on 2010/03/30 2:03 UTC
Read the original article Hit count: 308

Filed under:
|
|

Hello,

I setup my crosscompiler for making MIPS instructions.

And it compiles C code well.

but I found a weird thing for NOT operations.

if i make code like int a; func(!a);

and i studied MIPS instructions with text book that says "MIPS converts NOT operation to 'nor with zero'"

So i thought it would converted like nor a a $zero

but my compiler converts xori a a 0x0 sltu a 1

/////////////////////////////////////// i compiled the code with 'myaccount>> mipsel-unknown-linux-gnu-gcc -S myfilename.c' and it makes myfilename.s file..

what am i missing??

© Stack Overflow or respective owner

Related posts about mips

Related posts about xor