[LLVMbugs] [Bug 6412] New: AltiVec-style vector literals

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 24 02:48:35 PST 2010


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

           Summary: AltiVec-style vector literals
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: parser
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: anton.lokhmotov at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4301)
 --> (http://llvm.org/bugs/attachment.cgi?id=4301)
Test case with exact diagnostics

When setting LanguageOptions.AltiVec=1, Clang correctly recognises AltiVec
vectors initialised with AltiVec-style vector literals:
6: vector int altivec0 = (vector int) (1, 2, 3, 4); // passes [<i32 1, i32 2,
i32 3, i32 4>]

and, if given 
1: typedef int int4  __attribute__((ext_vector_type(4)));

even OpenCL-style vectors:
11: int4 opencl0 = (int4) (1, 2, 3, 4); // passes [<i32 1, i32 2, i32 3, i32
4>]

However, Clang fails to recognise splat literals
(http://developer.apple.com/hardwaredrivers/ve/tutorial.html), e.g.

7:  vector int altivec1 = (vector int) (1); // fails [7:40: current parser
token ';']
12: int4 opencl1 = (int4) (1); // fails [12:27: current parser token ';']

Surprisingly, a slight variation with no parenthesis around the scalar literal
still fails for AltiVec vectors but works for OpenCL-style vectors:

8:  vector int altivec2 = (vector int) 1; // fails [8:38: current parser token
';']
13: int4 opencl2 = (int4) 1; // passes [splat: <i32 1, i32 1, i32 1, i32 1>]

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