Bin Tzeng
2013-Jun-20 23:39 UTC
[LLVMdev] 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 ==================================================================--- docs/LangRef.rst (revision 184496) +++ docs/LangRef.rst (working copy) @@ -5236,7 +5236,7 @@ .. code-block:: llvm - %X = sext i8 -1 to i16 ; yields i16 :65535 + %X = sext i8 -1 to i16 ; yields i16:-1 %Y = sext i1 true to i32 ; yields i32:-1 %Z = sext <2 x i16> <i16 8, i16 7> to <2 x i32> ; yields <i32 8, i32 7> Thanks! Bin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130620/860e05dd/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: sextExample.diff Type: application/octet-stream Size: 482 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130620/860e05dd/attachment.obj>
Chris Lattner
2013-Jun-21 04:17 UTC
[LLVMdev] Error in the example of sext instruction in reference manual
On Jun 20, 2013, at 4:39 PM, Bin Tzeng <bintzeng at gmail.com> wrote:> 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> > Index: docs/LangRef.rst > ==================================================================> --- docs/LangRef.rst (revision 184496) > +++ docs/LangRef.rst (working copy) > @@ -5236,7 +5236,7 @@ > > .. code-block:: llvm > > - %X = sext i8 -1 to i16 ; yields i16 :65535 > + %X = sext i8 -1 to i16 ; yields i16:-1 > %Y = sext i1 true to i32 ; yields i32:-1 > %Z = sext <2 x i16> <i16 8, i16 7> to <2 x i32> ; yields <i32 8, i32 7> > > > Thanks! > Bin > <sextExample.diff>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Bin Tzeng
2013-Jun-21 15:49 UTC
[LLVMdev] Error in the example of sext instruction in reference manual
Thanks for the reply. Just for a little more clarity, is i16, i32... signed, unsigned, or just a bit pattern? On Thu, Jun 20, 2013 at 9:17 PM, Chris Lattner <clattner at apple.com> wrote:> > On Jun 20, 2013, at 4:39 PM, Bin Tzeng <bintzeng at gmail.com> wrote: > > > 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 > > > > > Index: docs/LangRef.rst > > ==================================================================> > --- docs/LangRef.rst (revision 184496) > > +++ docs/LangRef.rst (working copy) > > @@ -5236,7 +5236,7 @@ > > > > .. code-block:: llvm > > > > - %X = sext i8 -1 to i16 ; yields i16 :65535 > > + %X = sext i8 -1 to i16 ; yields i16:-1 > > %Y = sext i1 true to i32 ; yields i32:-1 > > %Z = sext <2 x i16> <i16 8, i16 7> to <2 x i32> ; yields <i32 8, > i32 7> > > > > > > Thanks! > > Bin > > <sextExample.diff>_______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130621/ae701fdc/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Error in the example of sext instruction in reference manual
- [LLVMdev] Error in the example of sext instruction in reference manual
- [LLVMdev] Error in the example of sext instruction in reference manual
- [LLVMdev] dominator, post-dominator and memory leak
- [LLVMdev] dominator, post-dominator and memory leak