1 ! 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
2 ! REQUIRES: target=powerpc{{.*}}
4 !CHECK-LABEL: vec_insert_testf32i64
5 subroutine vec_insert_testf32i64(v
, x
, i8
)
10 r
= vec_insert(v
, x
, i8
)
12 ! LLVMIR: %[[v:.*]] = load float, ptr %{{[0-9]}}, align 4
13 ! LLVMIR: %[[x:.*]] = load <4 x float>, ptr %{{[0-9]}}, align 16
14 ! LLVMIR: %[[i8:.*]] = load i64, ptr %{{[0-9]}}, align 8
15 ! LLVMIR: %[[urem:.*]] = urem i64 %[[i8]], 4
16 ! LLVMIR: %[[sub:.*]] = sub i64 3, %[[urem]]
17 ! LLVMIR: %[[r:.*]] = insertelement <4 x float> %[[x]], float %[[v]], i64 %[[sub]]
18 ! LLVMIR: store <4 x float> %[[r]], ptr %{{[0-9]}}, align 16
19 end subroutine vec_insert_testf32i64
21 !CHECK-LABEL: vec_insert_testi64i8
22 subroutine vec_insert_testi64i8(v
, x
, i1
, i2
, i4
, i8
)
24 vector(integer(8)) :: x
25 vector(integer(8)) :: r
27 r
= vec_insert(v
, x
, i1
)
29 ! LLVMIR: %[[v:.*]] = load i64, ptr %{{[0-9]}}, align 8
30 ! LLVMIR: %[[x:.*]] = load <2 x i64>, ptr %{{[0-9]}}, align 16
31 ! LLVMIR: %[[i1:.*]] = load i8, ptr %{{[0-9]}}, align 1
32 ! LLVMIR: %[[urem:.*]] = urem i8 %[[i1]], 2
33 ! LLVMIR: %[[sub:.*]] = sub i8 1, %[[urem]]
34 ! LLVMIR: %[[r:.*]] = insertelement <2 x i64> %[[x]], i64 %[[v]], i8 %[[sub]]
35 ! LLVMIR: store <2 x i64> %[[r]], ptr %{{[0-9]}}, align 16
36 end subroutine vec_insert_testi64i8