[LLVMdev] sext..to instruction

Le Anh Quang anhquangbk at googlemail.com
Mon Oct 6 14:11:38 PDT 2008


Thanks , i see it now :)
Quang

-----Urspr√ľngliche Nachricht-----
Von: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] Im
Auftrag von Duncan Sands
Gesendet: Montag, 6. Oktober 2008 19:13
An: llvmdev at cs.uiuc.edu
Cc: Le Anh Quang
Betreff: Re: [LLVMdev] sext..to instruction

> I'm not sure about it, when sext to results a positve/negative value?

sext does signed-extension, zext does unsigned-extension.
This means that zext always extends by zero bits,
while with sext the additional bits are all copies of the
top bit of the original value.  So with sext, if it was
negative in the original type when considered as a signed
value, then it will be negative in the new type too.

Best wishes,

Duncan.
_______________________________________________
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