[LLVMbugs] [Bug 13813] New: Sign change issue using vector extensions and __builtin_shufflevector

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 11 07:43:53 PDT 2012


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

             Bug #: 13813
           Summary: Sign change issue using vector extensions and
                    __builtin_shufflevector
           Product: clang
           Version: 3.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tomalexander at paphus.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9186
  --> http://llvm.org/bugs/attachment.cgi?id=9186
The code to demonstrate the problem

I was working on a matrix math library and decided to use vector extensions and
__builtin_shufflevector. I noticed that commenting and uncommenting a line that
makes no changes to the matrix will result in a sign change but only when I
generate the matrix using __builtin_shufflevector.

I cut down my code as much as I could while still making sense. Line 97 in
matrix.cpp is the line that I comment and uncomment. it is a const member
function so it can't change any values. With it uncommented my result is:

MATRIX:
       1           0           0           0
       0           1           0           0
      -0          -0          -1          -0
       0           0           0           1

with it commented I get:


MATRIX:
       1           0           0           0
       0           1           0           0
       0           0           1          -0
       0           0           0           1

I tested it on two machines to make sure it wasn't a processor issue.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list