[LLVMdev] sext..to instruction

Duncan Sands baldrick at free.fr
Mon Oct 6 10:12:54 PDT 2008


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



More information about the llvm-dev mailing list