[LLVMbugs] [Bug 11555] OpenCL shift counts can overflow

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 22 18:54:37 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=11555

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #3 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Per OpenCL 6.3/j:

"The result of E1 << E2 is E1 left-shifted by log2(N) least significant bits in
E2 viewed as an unsigned integer value, where N is the number of bits used to
represent the data type of E1 after integer promotion"

After integer promotion, E1 has type 'int', so the result of your shift is 256.
Your test is wrong.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130323/273ff93c/attachment.html>


More information about the llvm-bugs mailing list