diff --git a/flang/test/Lower/PowerPC/ppc-vec-extract-elem-order.f90 b/flang/test/Lower/PowerPC/ppc-vec-extract-elem-order.f90 index 73669c25b339e..d7d14581b4b7f 100644 --- a/flang/test/Lower/PowerPC/ppc-vec-extract-elem-order.f90 +++ b/flang/test/Lower/PowerPC/ppc-vec-extract-elem-order.f90 @@ -1,4 +1,4 @@ -! RUN: %flang_fc1 -flang-experimental-hlfir -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s +! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s ! REQUIRES: target=powerpc{{.*}} !CHECK-LABEL: vec_extract_testr4i8 @@ -27,6 +27,7 @@ subroutine vec_extract_testi8i1(arg1, arg2, r) ! LLVMIR: %[[arg2:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[arg2]], 2 ! LLVMIR: %[[sub:.*]] = sub i8 1, %[[urem]] -! LLVMIR: %[[r:.*]] = extractelement <2 x i64> %[[arg1]], i8 %[[sub]] +! LLVMIR: %[[idx:.*]] = zext i8 %[[sub]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <2 x i64> %[[arg1]], i64 %[[idx]] ! LLVMIR: store i64 %[[r]], ptr %{{[0-9]}}, align 8 end subroutine vec_extract_testi8i1 diff --git a/flang/test/Lower/PowerPC/ppc-vec-extract.f90 b/flang/test/Lower/PowerPC/ppc-vec-extract.f90 index 0f279347b6b75..32c0dcfd66013 100644 --- a/flang/test/Lower/PowerPC/ppc-vec-extract.f90 +++ b/flang/test/Lower/PowerPC/ppc-vec-extract.f90 @@ -1,5 +1,5 @@ -! RUN: %flang_fc1 -flang-experimental-hlfir -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s -! RUN: %flang_fc1 -flang-experimental-hlfir -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s +! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s +! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s ! REQUIRES: target=powerpc{{.*}} !------------- @@ -19,8 +19,9 @@ subroutine vec_extract_testf32(x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[u:.*]] = urem i8 %[[i1]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i8 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x float> %[[x]], i8 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x float> %[[x]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <4 x float> %[[x]], i64 %[[idx]] ! LLVMIR: store float %[[r]], ptr %{{[0-9]}}, align 4 r = vec_extract(x, i2) @@ -29,8 +30,9 @@ subroutine vec_extract_testf32(x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[u:.*]] = urem i16 %[[i2]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i16 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x float> %[[x]], i16 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x float> %[[x]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <4 x float> %[[x]], i64 %[[idx]] ! LLVMIR: store float %[[r]], ptr %{{[0-9]}}, align 4 r = vec_extract(x, i4) @@ -39,18 +41,19 @@ subroutine vec_extract_testf32(x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[u:.*]] = urem i32 %[[i4]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i32 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x float> %[[x]], i32 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x float> %[[x]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <4 x float> %[[x]], i64 %[[idx]] ! LLVMIR: store float %[[r]], ptr %{{[0-9]}}, align 4 r = vec_extract(x, i8) ! LLVMIR: %[[x:.*]] = load <4 x float>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[u:.*]] = urem i64 %[[i8]], 4 -! LLVMIR-BE: %[[s:.*]] = sub i64 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x float> %[[x]], i64 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x float> %[[x]], i64 %[[s]] +! LLVMIR-BE: %[[u:.*]] = urem i64 %[[i8]], 4 +! LLVMIR-BE: %[[idx:.*]] = sub i64 3, %[[u]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 4 +! LLVMIR: %[[r:.*]] = extractelement <4 x float> %[[x]], i64 %[[idx]] ! LLVMIR: store float %[[r]], ptr %{{[0-9]}}, align 4 end subroutine vec_extract_testf32 @@ -68,8 +71,9 @@ subroutine vec_extract_testf64(x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[u:.*]] = urem i8 %[[i1]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i8 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x double> %[[x]], i8 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x double> %[[x]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <2 x double> %[[x]], i64 %[[idx]] ! LLVMIR: store double %[[r]], ptr %{{[0-9]}}, align 8 r = vec_extract(x, i2) @@ -78,8 +82,9 @@ subroutine vec_extract_testf64(x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[u:.*]] = urem i16 %[[i2]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i16 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x double> %[[x]], i16 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x double> %[[x]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <2 x double> %[[x]], i64 %[[idx]] ! LLVMIR: store double %[[r]], ptr %{{[0-9]}}, align 8 @@ -89,18 +94,19 @@ subroutine vec_extract_testf64(x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[u:.*]] = urem i32 %[[i4]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i32 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x double> %[[x]], i32 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x double> %[[x]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <2 x double> %[[x]], i64 %[[idx]] ! LLVMIR: store double %[[r]], ptr %{{[0-9]}}, align 8 r = vec_extract(x, i8) ! LLVMIR: %[[x:.*]] = load <2 x double>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[u:.*]] = urem i64 %[[i8]], 2 -! LLVMIR-BE: %[[s:.*]] = sub i64 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x double> %[[x]], i64 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x double> %[[x]], i64 %[[s]] +! LLVMIR-BE: %[[u:.*]] = urem i64 %[[i8]], 2 +! LLVMIR-BE: %[[idx:.*]] = sub i64 1, %[[u]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 2 +! LLVMIR: %[[r:.*]] = extractelement <2 x double> %[[x]], i64 %[[idx]] ! LLVMIR: store double %[[r]], ptr %{{[0-9]}}, align 8 end subroutine vec_extract_testf64 @@ -118,8 +124,9 @@ subroutine vec_extract_testi8(x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[u:.*]] = urem i8 %[[i1]], 16 ! LLVMIR-BE: %[[s:.*]] = sub i8 15, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i8 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <16 x i8> %[[x]], i64 %[[idx]] ! LLVMIR: store i8 %[[r]], ptr %{{[0-9]}}, align 1 r = vec_extract(x, i2) @@ -128,8 +135,9 @@ subroutine vec_extract_testi8(x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[u:.*]] = urem i16 %[[i2]], 16 ! LLVMIR-BE: %[[s:.*]] = sub i16 15, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i16 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <16 x i8> %[[x]], i64 %[[idx]] ! LLVMIR: store i8 %[[r]], ptr %{{[0-9]}}, align 1 r = vec_extract(x, i4) @@ -138,18 +146,19 @@ subroutine vec_extract_testi8(x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[u:.*]] = urem i32 %[[i4]], 16 ! LLVMIR-BE: %[[s:.*]] = sub i32 15, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i32 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <16 x i8> %[[x]], i64 %[[idx]] ! LLVMIR: store i8 %[[r]], ptr %{{[0-9]}}, align 1 r = vec_extract(x, i8) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[u:.*]] = urem i64 %[[i8]], 16 -! LLVMIR-BE: %[[s:.*]] = sub i64 15, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i64 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <16 x i8> %[[x]], i64 %[[s]] +! LLVMIR-BE: %[[u:.*]] = urem i64 %[[i8]], 16 +! LLVMIR-BE: %[[idx:.*]] = sub i64 15, %[[u]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 16 +! LLVMIR: %[[r:.*]] = extractelement <16 x i8> %[[x]], i64 %[[idx]] ! LLVMIR: store i8 %[[r]], ptr %{{[0-9]}}, align 1 end subroutine vec_extract_testi8 @@ -167,8 +176,9 @@ subroutine vec_extract_testi16(x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[u:.*]] = urem i8 %[[i1]], 8 ! LLVMIR-BE: %[[s:.*]] = sub i8 7, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i8 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <8 x i16> %[[x]], i64 %[[idx]] ! LLVMIR: store i16 %[[r]], ptr %{{[0-9]}}, align 2 r = vec_extract(x, i2) @@ -177,8 +187,9 @@ subroutine vec_extract_testi16(x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[u:.*]] = urem i16 %[[i2]], 8 ! LLVMIR-BE: %[[s:.*]] = sub i16 7, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i16 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <8 x i16> %[[x]], i64 %[[idx]] ! LLVMIR: store i16 %[[r]], ptr %{{[0-9]}}, align 2 r = vec_extract(x, i4) @@ -187,18 +198,19 @@ subroutine vec_extract_testi16(x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[u:.*]] = urem i32 %[[i4]], 8 ! LLVMIR-BE: %[[s:.*]] = sub i32 7, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i32 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <8 x i16> %[[x]], i64 %[[idx]] ! LLVMIR: store i16 %[[r]], ptr %{{[0-9]}}, align 2 r = vec_extract(x, i8) ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[u:.*]] = urem i64 %[[i8]], 8 -! LLVMIR-BE: %[[s:.*]] = sub i64 7, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i64 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <8 x i16> %[[x]], i64 %[[s]] +! LLVMIR-BE: %[[u:.*]] = urem i64 %[[i8]], 8 +! LLVMIR-BE: %[[idx:.*]] = sub i64 7, %[[u]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 8 +! LLVMIR: %[[r:.*]] = extractelement <8 x i16> %[[x]], i64 %[[idx]] ! LLVMIR: store i16 %[[r]], ptr %{{[0-9]}}, align 2 end subroutine vec_extract_testi16 @@ -216,8 +228,9 @@ subroutine vec_extract_testi32(x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[u:.*]] = urem i8 %[[i1]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i8 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i8 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <4 x i32> %[[x]], i64 %[[idx]] ! LLVMIR: store i32 %[[r]], ptr %{{[0-9]}}, align 4 r = vec_extract(x, i2) @@ -226,8 +239,9 @@ subroutine vec_extract_testi32(x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[u:.*]] = urem i16 %[[i2]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i16 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i16 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <4 x i32> %[[x]], i64 %[[idx]] ! LLVMIR: store i32 %[[r]], ptr %{{[0-9]}}, align 4 r = vec_extract(x, i4) @@ -236,18 +250,19 @@ subroutine vec_extract_testi32(x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[u:.*]] = urem i32 %[[i4]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i32 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i32 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <4 x i32> %[[x]], i64 %[[idx]] ! LLVMIR: store i32 %[[r]], ptr %{{[0-9]}}, align 4 r = vec_extract(x, i8) ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[u:.*]] = urem i64 %[[i8]], 4 -! LLVMIR-BE: %[[s:.*]] = sub i64 3, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i64 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <4 x i32> %[[x]], i64 %[[s]] +! LLVMIR-BE: %[[u:.*]] = urem i64 %[[i8]], 4 +! LLVMIR-BE: %[[idx:.*]] = sub i64 3, %[[u]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 4 +! LLVMIR: %[[r:.*]] = extractelement <4 x i32> %[[x]], i64 %[[idx]] ! LLVMIR: store i32 %[[r]], ptr %{{[0-9]}}, align 4 end subroutine vec_extract_testi32 @@ -265,8 +280,9 @@ subroutine vec_extract_testi64(x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[u:.*]] = urem i8 %[[i1]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i8 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i8 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <2 x i64> %[[x]], i64 %[[idx]] ! LLVMIR: store i64 %[[r]], ptr %{{[0-9]}}, align 8 r = vec_extract(x, i2) @@ -275,8 +291,9 @@ subroutine vec_extract_testi64(x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[u:.*]] = urem i16 %[[i2]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i16 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i16 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <2 x i64> %[[x]], i64 %[[idx]] ! LLVMIR: store i64 %[[r]], ptr %{{[0-9]}}, align 8 r = vec_extract(x, i4) @@ -285,17 +302,18 @@ subroutine vec_extract_testi64(x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[u:.*]] = urem i32 %[[i4]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i32 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i32 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[u]] to i64 +! LLVMIR: %[[r:.*]] = extractelement <2 x i64> %[[x]], i64 %[[idx]] ! LLVMIR: store i64 %[[r]], ptr %{{[0-9]}}, align 8 r = vec_extract(x, i8) ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[u:.*]] = urem i64 %[[i8]], 2 -! LLVMIR-BE: %[[s:.*]] = sub i64 1, %[[u]] -! LLVMIR-LE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i64 %[[u]] -! LLVMIR-BE: %[[r:.*]] = extractelement <2 x i64> %[[x]], i64 %[[s]] +! LLVMIR-BE: %[[u:.*]] = urem i64 %[[i8]], 2 +! LLVMIR-BE: %[[idx:.*]] = sub i64 1, %[[u]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 2 +! LLVMIR: %[[r:.*]] = extractelement <2 x i64> %[[x]], i64 %[[idx]] ! LLVMIR: store i64 %[[r]], ptr %{{[0-9]}}, align 8 end subroutine vec_extract_testi64 diff --git a/flang/test/Lower/PowerPC/ppc-vec-insert-elem-order.f90 b/flang/test/Lower/PowerPC/ppc-vec-insert-elem-order.f90 index f64df46f170ab..b30065d74e46b 100644 --- a/flang/test/Lower/PowerPC/ppc-vec-insert-elem-order.f90 +++ b/flang/test/Lower/PowerPC/ppc-vec-insert-elem-order.f90 @@ -1,4 +1,4 @@ -! RUN: %flang_fc1 -flang-experimental-hlfir -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s +! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s ! REQUIRES: target=powerpc{{.*}} !CHECK-LABEL: vec_insert_testf32i64 @@ -31,6 +31,7 @@ subroutine vec_insert_testi64i8(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 2 ! LLVMIR: %[[sub:.*]] = sub i8 1, %[[urem]] -! LLVMIR: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i8 %[[sub]] +! LLVMIR: %[[idx:.*]] = zext i8 %[[sub]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x i64> %[[r]], ptr %{{[0-9]}}, align 16 end subroutine vec_insert_testi64i8 diff --git a/flang/test/Lower/PowerPC/ppc-vec-insert.f90 b/flang/test/Lower/PowerPC/ppc-vec-insert.f90 index dd57fcc67be08..26bc7fc114cec 100644 --- a/flang/test/Lower/PowerPC/ppc-vec-insert.f90 +++ b/flang/test/Lower/PowerPC/ppc-vec-insert.f90 @@ -1,5 +1,5 @@ -! RUN: %flang_fc1 -flang-experimental-hlfir -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s -! RUN: %flang_fc1 -flang-experimental-hlfir -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s +! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s +! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s ! REQUIRES: target=powerpc{{.*}} ! vec_insert @@ -20,8 +20,9 @@ subroutine vec_insert_testf32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i8 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i8 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x float> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i2) @@ -31,8 +32,9 @@ subroutine vec_insert_testf32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[urem:.*]] = urem i16 %[[i2]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i16 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i16 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x float> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i4) @@ -42,8 +44,9 @@ subroutine vec_insert_testf32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[urem:.*]] = urem i32 %[[i4]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i32 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i32 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x float> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i8) @@ -51,10 +54,10 @@ subroutine vec_insert_testf32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[v:.*]] = load float, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[x:.*]] = load <4 x float>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[urem:.*]] = urem i64 %[[i8]], 4 -! LLVMIR-BE: %[[s:.*]] = sub i64 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i64 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i64 %[[s]] +! LLVMIR-BE: %[[urem:.*]] = urem i64 %[[i8]], 4 +! LLVMIR-BE: %[[idx:.*]] = sub i64 3, %[[urem]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 4 +! LLVMIR: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x float> %[[r]], ptr %{{[0-9]}}, align 16 end subroutine vec_insert_testf32 @@ -74,8 +77,9 @@ subroutine vec_insert_testf64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i8 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i8 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x double> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i2) @@ -85,8 +89,9 @@ subroutine vec_insert_testf64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[urem:.*]] = urem i16 %[[i2]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i16 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i16 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x double> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i4) @@ -96,8 +101,9 @@ subroutine vec_insert_testf64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[urem:.*]] = urem i32 %[[i4]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i32 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i32 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x double> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i8) @@ -105,10 +111,10 @@ subroutine vec_insert_testf64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[v:.*]] = load double, ptr %{{[0-9]}}, align 8 ! LLVMIR: %[[x:.*]] = load <2 x double>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[urem:.*]] = urem i64 %[[i8]], 2 -! LLVMIR-BE: %[[s:.*]] = sub i64 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i64 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i64 %[[s]] +! LLVMIR-BE: %[[urem:.*]] = urem i64 %[[i8]], 2 +! LLVMIR-BE: %[[idx:.*]] = sub i64 1, %[[urem]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 2 +! LLVMIR: %[[r:.*]] = insertelement <2 x double> %[[x]], double %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x double> %[[r]], ptr %{{[0-9]}}, align 16 end subroutine vec_insert_testf64 @@ -128,8 +134,9 @@ subroutine vec_insert_testi8(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 16 ! LLVMIR-BE: %[[s:.*]] = sub i8 15, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i8 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i64 %[[idx]] ! LLVMIR: store <16 x i8> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i2) @@ -139,8 +146,9 @@ subroutine vec_insert_testi8(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[urem:.*]] = urem i16 %[[i2]], 16 ! LLVMIR-BE: %[[s:.*]] = sub i16 15, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i16 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i64 %[[idx]] ! LLVMIR: store <16 x i8> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i4) @@ -150,8 +158,9 @@ subroutine vec_insert_testi8(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[urem:.*]] = urem i32 %[[i4]], 16 ! LLVMIR-BE: %[[s:.*]] = sub i32 15, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i32 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i64 %[[idx]] ! LLVMIR: store <16 x i8> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i8) @@ -159,10 +168,10 @@ subroutine vec_insert_testi8(v, x, i1, i2, i4, i8) ! LLVMIR: %[[v:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[urem:.*]] = urem i64 %[[i8]], 16 -! LLVMIR-BE: %[[s:.*]] = sub i64 15, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i64 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i64 %[[s]] +! LLVMIR-BE: %[[urem:.*]] = urem i64 %[[i8]], 16 +! LLVMIR-BE: %[[idx:.*]] = sub i64 15, %[[urem]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 16 +! LLVMIR: %[[r:.*]] = insertelement <16 x i8> %[[x]], i8 %[[v]], i64 %[[idx]] ! LLVMIR: store <16 x i8> %[[r]], ptr %{{[0-9]}}, align 16 end subroutine vec_insert_testi8 @@ -182,8 +191,9 @@ subroutine vec_insert_testi16(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 8 ! LLVMIR-BE: %[[s:.*]] = sub i8 7, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i8 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i64 %[[idx]] ! LLVMIR: store <8 x i16> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i2) @@ -193,8 +203,9 @@ subroutine vec_insert_testi16(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[urem:.*]] = urem i16 %[[i2]], 8 ! LLVMIR-BE: %[[s:.*]] = sub i16 7, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i16 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i64 %[[idx]] ! LLVMIR: store <8 x i16> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i4) @@ -204,8 +215,9 @@ subroutine vec_insert_testi16(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[urem:.*]] = urem i32 %[[i4]], 8 ! LLVMIR-BE: %[[s:.*]] = sub i32 7, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i32 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i64 %[[idx]] ! LLVMIR: store <8 x i16> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i8) @@ -213,10 +225,10 @@ subroutine vec_insert_testi16(v, x, i1, i2, i4, i8) ! LLVMIR: %[[v:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[urem:.*]] = urem i64 %[[i8]], 8 -! LLVMIR-BE: %[[s:.*]] = sub i64 7, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i64 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i64 %[[s]] +! LLVMIR-BE: %[[urem:.*]] = urem i64 %[[i8]], 8 +! LLVMIR-BE: %[[idx:.*]] = sub i64 7, %[[urem]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 8 +! LLVMIR: %[[r:.*]] = insertelement <8 x i16> %[[x]], i16 %[[v]], i64 %[[idx]] ! LLVMIR: store <8 x i16> %[[r]], ptr %{{[0-9]}}, align 16 end subroutine vec_insert_testi16 @@ -236,8 +248,9 @@ subroutine vec_insert_testi32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i8 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i8 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x i32> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i2) @@ -247,8 +260,9 @@ subroutine vec_insert_testi32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[urem:.*]] = urem i16 %[[i2]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i16 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i16 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x i32> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i4) @@ -258,8 +272,9 @@ subroutine vec_insert_testi32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[urem:.*]] = urem i32 %[[i4]], 4 ! LLVMIR-BE: %[[s:.*]] = sub i32 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i32 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x i32> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i8) @@ -267,10 +282,10 @@ subroutine vec_insert_testi32(v, x, i1, i2, i4, i8) ! LLVMIR: %[[v:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[urem:.*]] = urem i64 %[[i8]], 4 -! LLVMIR-BE: %[[s:.*]] = sub i64 3, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i64 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i64 %[[s]] +! LLVMIR-BE: %[[urem:.*]] = urem i64 %[[i8]], 4 +! LLVMIR-BE: %[[idx:.*]] = sub i64 3, %[[urem]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 4 +! LLVMIR: %[[r:.*]] = insertelement <4 x i32> %[[x]], i32 %[[v]], i64 %[[idx]] ! LLVMIR: store <4 x i32> %[[r]], ptr %{{[0-9]}}, align 16 end subroutine vec_insert_testi32 @@ -290,8 +305,9 @@ subroutine vec_insert_testi64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i8 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i8 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i8 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i8 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i8 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x i64> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i2) @@ -301,8 +317,9 @@ subroutine vec_insert_testi64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i2:.*]] = load i16, ptr %{{[0-9]}}, align 2 ! LLVMIR: %[[urem:.*]] = urem i16 %[[i2]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i16 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i16 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i16 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i16 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i16 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x i64> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i4) @@ -312,8 +329,9 @@ subroutine vec_insert_testi64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[i4:.*]] = load i32, ptr %{{[0-9]}}, align 4 ! LLVMIR: %[[urem:.*]] = urem i32 %[[i4]], 2 ! LLVMIR-BE: %[[s:.*]] = sub i32 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i32 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i32 %[[s]] +! LLVMIR-BE: %[[idx:.*]] = zext i32 %[[s]] to i64 +! LLVMIR-LE: %[[idx:.*]] = zext i32 %[[urem]] to i64 +! LLVMIR: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x i64> %[[r]], ptr %{{[0-9]}}, align 16 r = vec_insert(v, x, i8) @@ -321,9 +339,9 @@ subroutine vec_insert_testi64(v, x, i1, i2, i4, i8) ! LLVMIR: %[[v:.*]] = load i64, ptr %{{[0-9]}}, align 8 ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8 -! LLVMIR: %[[urem:.*]] = urem i64 %[[i8]], 2 -! LLVMIR-BE: %[[s:.*]] = sub i64 1, %[[urem]] -! LLVMIR-LE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i64 %[[urem]] -! LLVMIR-BE: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i64 %[[s]] +! LLVMIR-BE: %[[urem:.*]] = urem i64 %[[i8]], 2 +! LLVMIR-BE: %[[idx:.*]] = sub i64 1, %[[urem]] +! LLVMIR-LE: %[[idx:.*]] = urem i64 %[[i8]], 2 +! LLVMIR: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i64 %[[idx]] ! LLVMIR: store <2 x i64> %[[r]], ptr %{{[0-9]}}, align 16 end subroutine vec_insert_testi64 diff --git a/flang/test/Lower/PowerPC/ppc-vec-splat-elem-order.f90 b/flang/test/Lower/PowerPC/ppc-vec-splat-elem-order.f90 index 50604e1f720f3..ca8c0c3f6f1d8 100644 --- a/flang/test/Lower/PowerPC/ppc-vec-splat-elem-order.f90 +++ b/flang/test/Lower/PowerPC/ppc-vec-splat-elem-order.f90 @@ -19,7 +19,7 @@ subroutine vec_splat_testu8i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 -! LLVMIR: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i16 15 +! LLVMIR: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 15 ! LLVMIR: %[[ins:.*]] = insertelement <16 x i8> poison, i8 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <16 x i8> %[[ins]], <16 x i8> poison, <16 x i32> zeroinitializer ! LLVMIR: store <16 x i8> %[[y]], ptr %{{[0-9]}}, align 16 diff --git a/flang/test/Lower/PowerPC/ppc-vec-splat.f90 b/flang/test/Lower/PowerPC/ppc-vec-splat.f90 index f3c1f19d5877d..55614c75d1ad8 100644 --- a/flang/test/Lower/PowerPC/ppc-vec-splat.f90 +++ b/flang/test/Lower/PowerPC/ppc-vec-splat.f90 @@ -1,5 +1,5 @@ -! RUN: %flang_fc1 -flang-experimental-hlfir -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s -! RUN: %flang_fc1 -flang-experimental-hlfir -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s +! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s +! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s ! REQUIRES: target=powerpc{{.*}} !---------------- @@ -12,8 +12,8 @@ subroutine vec_splat_testi8i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i8 15 +! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 15 ! LLVMIR: %[[ins:.*]] = insertelement <16 x i8> poison, i8 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <16 x i8> %[[ins]], <16 x i8> poison, <16 x i32> zeroinitializer ! LLVMIR: store <16 x i8> %[[y]], ptr %{{[0-9]}}, align 16 @@ -25,8 +25,8 @@ subroutine vec_splat_testi8i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i16 15 +! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 15 ! LLVMIR: %[[ins:.*]] = insertelement <16 x i8> poison, i8 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <16 x i8> %[[ins]], <16 x i8> poison, <16 x i32> zeroinitializer ! LLVMIR: store <16 x i8> %[[y]], ptr %{{[0-9]}}, align 16 @@ -38,8 +38,8 @@ subroutine vec_splat_testi8i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i32 15 +! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 15 ! LLVMIR: %[[ins:.*]] = insertelement <16 x i8> poison, i8 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <16 x i8> %[[ins]], <16 x i8> poison, <16 x i32> zeroinitializer ! LLVMIR: store <16 x i8> %[[y]], ptr %{{[0-9]}}, align 16 @@ -64,8 +64,8 @@ subroutine vec_splat_testi16i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i8 7 +! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 7 ! LLVMIR: %[[ins:.*]] = insertelement <8 x i16> poison, i16 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <8 x i16> %[[ins]], <8 x i16> poison, <8 x i32> zeroinitializer ! LLVMIR: store <8 x i16> %[[y]], ptr %{{[0-9]}}, align 16 @@ -77,8 +77,8 @@ subroutine vec_splat_testi16i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i16 7 +! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 7 ! LLVMIR: %[[ins:.*]] = insertelement <8 x i16> poison, i16 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <8 x i16> %[[ins]], <8 x i16> poison, <8 x i32> zeroinitializer ! LLVMIR: store <8 x i16> %[[y]], ptr %{{[0-9]}}, align 16 @@ -90,8 +90,8 @@ subroutine vec_splat_testi16i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i32 7 +! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 7 ! LLVMIR: %[[ins:.*]] = insertelement <8 x i16> poison, i16 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <8 x i16> %[[ins]], <8 x i16> poison, <8 x i32> zeroinitializer ! LLVMIR: store <8 x i16> %[[y]], ptr %{{[0-9]}}, align 16 @@ -116,8 +116,8 @@ subroutine vec_splat_testi32i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i8 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x i32> poison, i32 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x i32> %[[ins]], <4 x i32> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x i32> %[[y]], ptr %{{[0-9]}}, align 16 @@ -129,8 +129,8 @@ subroutine vec_splat_testi32i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i16 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x i32> poison, i32 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x i32> %[[ins]], <4 x i32> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x i32> %[[y]], ptr %{{[0-9]}}, align 16 @@ -142,8 +142,8 @@ subroutine vec_splat_testi32i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i32 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x i32> poison, i32 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x i32> %[[ins]], <4 x i32> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x i32> %[[y]], ptr %{{[0-9]}}, align 16 @@ -168,8 +168,8 @@ subroutine vec_splat_testi64i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i8 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x i64> poison, i64 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x i64> %[[ins]], <2 x i64> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x i64> %[[y]], ptr %{{[0-9]}}, align 16 @@ -181,8 +181,8 @@ subroutine vec_splat_testi64i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i16 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x i64> poison, i64 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x i64> %[[ins]], <2 x i64> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x i64> %[[y]], ptr %{{[0-9]}}, align 16 @@ -194,8 +194,8 @@ subroutine vec_splat_testi64i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i32 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x i64> poison, i64 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x i64> %[[ins]], <2 x i64> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x i64> %[[y]], ptr %{{[0-9]}}, align 16 @@ -220,8 +220,8 @@ subroutine vec_splat_testf32i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <4 x float>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i8 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x float> poison, float %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x float> %[[ins]], <4 x float> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x float> %[[y]], ptr %{{[0-9]}}, align 16 @@ -233,8 +233,8 @@ subroutine vec_splat_testf32i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <4 x float>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i16 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x float> poison, float %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x float> %[[ins]], <4 x float> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x float> %[[y]], ptr %{{[0-9]}}, align 16 @@ -246,8 +246,8 @@ subroutine vec_splat_testf32i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <4 x float>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i32 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x float> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x float> poison, float %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x float> %[[ins]], <4 x float> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x float> %[[y]], ptr %{{[0-9]}}, align 16 @@ -272,8 +272,8 @@ subroutine vec_splat_testf64i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <2 x double>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i8 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x double> poison, double %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x double> %[[ins]], <2 x double> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x double> %[[y]], ptr %{{[0-9]}}, align 16 @@ -285,8 +285,8 @@ subroutine vec_splat_testf64i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <2 x double>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i16 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x double> poison, double %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x double> %[[ins]], <2 x double> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x double> %[[y]], ptr %{{[0-9]}}, align 16 @@ -298,8 +298,8 @@ subroutine vec_splat_testf64i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <2 x double>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i32 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x double> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x double> poison, double %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x double> %[[ins]], <2 x double> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x double> %[[y]], ptr %{{[0-9]}}, align 16 @@ -324,8 +324,8 @@ subroutine vec_splat_testu8i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i8 15 +! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 15 ! LLVMIR: %[[ins:.*]] = insertelement <16 x i8> poison, i8 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <16 x i8> %[[ins]], <16 x i8> poison, <16 x i32> zeroinitializer ! LLVMIR: store <16 x i8> %[[y]], ptr %{{[0-9]}}, align 16 @@ -337,8 +337,8 @@ subroutine vec_splat_testu8i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i16 15 +! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 15 ! LLVMIR: %[[ins:.*]] = insertelement <16 x i8> poison, i8 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <16 x i8> %[[ins]], <16 x i8> poison, <16 x i32> zeroinitializer ! LLVMIR: store <16 x i8> %[[y]], ptr %{{[0-9]}}, align 16 @@ -350,8 +350,8 @@ subroutine vec_splat_testu8i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <16 x i8>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i32 15 +! LLVMIR-LE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <16 x i8> %[[x]], i64 15 ! LLVMIR: %[[ins:.*]] = insertelement <16 x i8> poison, i8 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <16 x i8> %[[ins]], <16 x i8> poison, <16 x i32> zeroinitializer ! LLVMIR: store <16 x i8> %[[y]], ptr %{{[0-9]}}, align 16 @@ -376,8 +376,8 @@ subroutine vec_splat_testu16i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i8 7 +! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 7 ! LLVMIR: %[[ins:.*]] = insertelement <8 x i16> poison, i16 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <8 x i16> %[[ins]], <8 x i16> poison, <8 x i32> zeroinitializer ! LLVMIR: store <8 x i16> %[[y]], ptr %{{[0-9]}}, align 16 @@ -389,8 +389,8 @@ subroutine vec_splat_testu16i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i16 7 +! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 7 ! LLVMIR: %[[ins:.*]] = insertelement <8 x i16> poison, i16 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <8 x i16> %[[ins]], <8 x i16> poison, <8 x i32> zeroinitializer ! LLVMIR: store <8 x i16> %[[y]], ptr %{{[0-9]}}, align 16 @@ -402,8 +402,8 @@ subroutine vec_splat_testu16i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <8 x i16>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i32 7 +! LLVMIR-LE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <8 x i16> %[[x]], i64 7 ! LLVMIR: %[[ins:.*]] = insertelement <8 x i16> poison, i16 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <8 x i16> %[[ins]], <8 x i16> poison, <8 x i32> zeroinitializer ! LLVMIR: store <8 x i16> %[[y]], ptr %{{[0-9]}}, align 16 @@ -428,8 +428,8 @@ subroutine vec_splat_testu32i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i8 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x i32> poison, i32 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x i32> %[[ins]], <4 x i32> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x i32> %[[y]], ptr %{{[0-9]}}, align 16 @@ -441,8 +441,8 @@ subroutine vec_splat_testu32i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i16 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x i32> poison, i32 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x i32> %[[ins]], <4 x i32> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x i32> %[[y]], ptr %{{[0-9]}}, align 16 @@ -454,8 +454,8 @@ subroutine vec_splat_testu32i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <4 x i32>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i32 3 +! LLVMIR-LE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <4 x i32> %[[x]], i64 3 ! LLVMIR: %[[ins:.*]] = insertelement <4 x i32> poison, i32 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <4 x i32> %[[ins]], <4 x i32> poison, <4 x i32> zeroinitializer ! LLVMIR: store <4 x i32> %[[y]], ptr %{{[0-9]}}, align 16 @@ -480,8 +480,8 @@ subroutine vec_splat_testu64i8(x) y = vec_splat(x, 0_1) ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i8 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i8 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x i64> poison, i64 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x i64> %[[ins]], <2 x i64> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x i64> %[[y]], ptr %{{[0-9]}}, align 16 @@ -493,8 +493,8 @@ subroutine vec_splat_testu64i16(x) y = vec_splat(x, 0_2) ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i16 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i16 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x i64> poison, i64 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x i64> %[[ins]], <2 x i64> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x i64> %[[y]], ptr %{{[0-9]}}, align 16 @@ -506,8 +506,8 @@ subroutine vec_splat_testu64i32(x) y = vec_splat(x, 0_4) ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16 -! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i32 0 -! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i32 1 +! LLVMIR-LE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 0 +! LLVMIR-BE: %[[ele:.*]] = extractelement <2 x i64> %[[x]], i64 1 ! LLVMIR: %[[ins:.*]] = insertelement <2 x i64> poison, i64 %[[ele]], i32 0 ! LLVMIR: %[[y:.*]] = shufflevector <2 x i64> %[[ins]], <2 x i64> poison, <2 x i32> zeroinitializer ! LLVMIR: store <2 x i64> %[[y]], ptr %{{[0-9]}}, align 16