Error in the example of sext instruction in reference manual

Hi all,

There might be a simple error in the LLVM reference manual. The example for sext instruction:

%X = sext i8 -1 to i16 ; yields i16 :65535

%X should yield i16: -1, as opposed to 65535.
Here is the simple patch (also attached):

Index: docs/LangRef.rst

sextExample.diff (482 Bytes)

Hi all,

There might be a simple error in the LLVM reference manual. The example for sext instruction:

%X = sext i8 -1 to i16 ; yields i16 :65535

%X should yield i16: -1, as opposed to 65535.
Here is the simple patch (also attached):

These are the same value.

-Chris

Thanks for the reply. Just for a little more clarity, is i16, i32… signed, unsigned, or just a bit pattern?

From: llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu] On Behalf Of Bin Tzeng
Subject: Re: [LLVMdev] Error in the example of sext instruction in reference manual

Just for a little more clarity, is i16, i32... signed, unsigned, or
just a bit pattern?

It's just a bit pattern. The operations performed on it can treat it as signed, unsigned, or whatever, as appropriate.

- Chuck

THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

Thanks for the clarification!