[llvm-bugs] [Bug 31161] New: Crash when using vector long long or vector double operator manipulation with altivec

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 25 00:17:06 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31161

            Bug ID: 31161
           Summary: Crash when using vector long long or vector double
                    operator manipulation with altivec
           Product: clang
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: westion717 at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

int main(){
    vector long long a = {1,2};
    vector long long b = {1,2};
    vector double c = {1.1,2.1};
    vector double d = {1.1,2.1};

    if(a<b);
    if(a>b);
    if(a==b);

    if(c<d);
    if(c>d);
    if(c==d);

}

it crashes.

As vector int and vector float work well. It should call related llvm builtins.

example.C
int main(){
    vector int a = {1,2};
    vector int  b = {1,2};
    vector float c = {1.1,2.1};
    vector float  d = {1.1,2.1};

    if(a<b);
    if(a>b);
    if(a==b);

    if(c<d);
    if(c>d);
    if(c==d);

}

cat example.ll | grep llvm.
  %8 = call i32 @llvm.ppc.altivec.vcmpgtsw.p(i32 2, <4 x i32> %7, <4 x i32> %6)
  %13 = call i32 @llvm.ppc.altivec.vcmpgtsw.p(i32 2, <4 x i32> %11, <4 x i32>
%12)
  %18 = call i32 @llvm.ppc.altivec.vcmpequw.p(i32 2, <4 x i32> %16, <4 x i32>
%17)
  %23 = call i32 @llvm.ppc.altivec.vcmpgtfp.p(i32 2, <4 x float> %22, <4 x
float> %21)
  %28 = call i32 @llvm.ppc.altivec.vcmpgtfp.p(i32 2, <4 x float> %26, <4 x
float> %27)
  %33 = call i32 @llvm.ppc.altivec.vcmpeqfp.p(i32 2, <4 x float> %31, <4 x
float> %32)
declare i32 @llvm.ppc.altivec.vcmpgtsw.p(i32, <4 x i32>, <4 x i32>) #1
declare i32 @llvm.ppc.altivec.vcmpequw.p(i32, <4 x i32>, <4 x i32>) #1
declare i32 @llvm.ppc.altivec.vcmpgtfp.p(i32, <4 x float>, <4 x float>) #1
declare i32 @llvm.ppc.altivec.vcmpeqfp.p(i32, <4 x float>, <4 x float>) #1

-- 
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/20161125/8398cac8/attachment.html>


More information about the llvm-bugs mailing list