brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · 947c8b1 Raw
107 lines · plain
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" %s2! REQUIRES: target=powerpc{{.*}}3 4!----------------------5! vec_st6!----------------------7! CHECK-LABEL: vec_st_test8subroutine vec_st_test(arg1, arg2, arg3)9  vector(integer(2)) :: arg110  integer(4) :: arg211  vector(integer(2)) :: arg312  call vec_st(arg1, arg2, arg3)13 14! LLVMIR: %[[arg1:.*]] = load <8 x i16>, ptr %0, align 1615! LLVMIR: %[[arg2:.*]] = load i32, ptr %1, align 416! LLVMIR: %[[addr:.*]] = getelementptr i8, ptr %2, i32 %[[arg2]]17! LLVMIR: %[[bc:.*]] = bitcast <8 x i16> %[[arg1]] to <4 x i32>18! LLVMIR: %[[shf:.*]] = shufflevector <4 x i32> %[[bc]], <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>19! LLVMIR:  call void @llvm.ppc.altivec.stvx(<4 x i32> %[[shf]], ptr %[[addr]])20end subroutine vec_st_test21 22!----------------------23! vec_ste24!----------------------25! CHECK-LABEL: vec_ste_test26subroutine vec_ste_test(arg1, arg2, arg3)27  vector(real(4)) :: arg128  integer(4) :: arg229  real(4) :: arg330  call vec_ste(arg1, arg2, arg3)31 32! LLVMIR: %[[arg1:.*]] = load <4 x float>, ptr %0, align 1633! LLVMIR: %[[arg2:.*]] = load i32, ptr %1, align 434! LLVMIR: %[[addr]] = getelementptr i8, ptr %2, i32 %[[arg2]]35! LLVMIR: %[[bc:.*]] = bitcast <4 x float> %[[arg1]] to <4 x i32>36! LLVMIR: %[[shf:.*]] = shufflevector <4 x i32> %[[bc]], <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>37! LLVMIR: call void @llvm.ppc.altivec.stvewx(<4 x i32> %[[shf]], ptr %[[addr]])38end subroutine vec_ste_test39 40!----------------------41! vec_xst42!----------------------43! CHECK-LABEL: vec_xst_test44subroutine vec_xst_test(arg1, arg2, arg3)45  vector(integer(4)) :: arg146  integer(4) :: arg247  vector(integer(4)) :: arg348  call vec_xst(arg1, arg2, arg3)49 50! LLVMIR: %[[arg1:.*]] = load <4 x i32>, ptr %0, align 1651! LLVMIR: %[[arg2:.*]] = load i32, ptr %1, align 452! LLVMIR: %[[trg:.*]] = getelementptr i8, ptr %2, i32 %[[arg2]]53! LLVMIR: %[[src:.*]] = shufflevector <4 x i32> %[[arg1]], <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>54! LLVMIR:  store <4 x i32> %[[src]], ptr %[[trg]], align 1655end subroutine vec_xst_test56 57!----------------------58! vec_xstd259!----------------------60! CHECK-LABEL: vec_xstd2_test61subroutine vec_xstd2_test(arg1, arg2, arg3, i)62  vector(real(4)) :: arg163  integer(2) :: arg264  vector(real(4)) :: arg3(*)65  integer(4) :: i66  call vec_xstd2(arg1, arg2, arg3(i))67 68! LLVMIR: %[[i:.*]] = load i32, ptr %3, align 469! LLVMIR: %[[iext:.*]] = sext i32 %[[i]] to i6470! LLVMIR: %[[isub:.*]] = sub nsw i64 %[[iext]], 171! LLVMIR: %[[imul1:.*]] = mul nsw i64 %[[isub]], 172! LLVMIR: %[[imul2:.*]] = mul nsw i64 %[[imul1]], 173! LLVMIR: %[[iadd:.*]] = add nsw i64 %[[imul2]], 074! LLVMIR: %[[gep1:.*]] = getelementptr <4 x float>, ptr %2, i64 %[[iadd]]75! LLVMIR: %[[arg1:.*]] = load <4 x float>, ptr %0, align 1676! LLVMIR: %[[arg2:.*]] = load i16, ptr %1, align 277! LLVMIR: %[[gep2:.*]] = getelementptr i8, ptr %[[gep1]], i16 %[[arg2]]78! LLVMIR: %[[src:.*]] = bitcast <4 x float> %[[arg1]] to <2 x i64>79! LLVMIR: %[[shf:.*]] = shufflevector <2 x i64> %[[src]], <2 x i64> undef, <2 x i32> <i32 1, i32 0>80! LLVMIR: store <2 x i64> %[[shf]], ptr %[[gep2]], align 1681end subroutine vec_xstd2_test82 83!----------------------84! vec_xstw485!----------------------86! CHECK-LABEL: vec_xstw4_test87subroutine vec_xstw4_test(arg1, arg2, arg3, i)88  vector(real(4)) :: arg189  integer(2) :: arg290  vector(real(4)) :: arg3(*)91  integer(4) :: i92  call vec_xstw4(arg1, arg2, arg3(i))93 94! LLVMIR: %[[i:.*]] = load i32, ptr %3, align 495! LLVMIR: %[[iext:.*]] = sext i32 %[[i]] to i6496! LLVMIR: %[[isub:.*]] = sub nsw i64 %[[iext]], 197! LLVMIR: %[[imul1:.*]] = mul nsw i64 %[[isub]], 198! LLVMIR: %[[imul2:.*]] = mul nsw i64 %[[imul1]], 199! LLVMIR: %[[iadd:.*]] = add nsw i64 %[[imul2]], 0100! LLVMIR: %[[gep1:.*]] = getelementptr <4 x float>, ptr %2, i64 %[[iadd]]101! LLVMIR: %[[arg1:.*]] = load <4 x float>, ptr %0, align 16102! LLVMIR: %[[arg2:.*]] = load i16, ptr %1, align 2103! LLVMIR: %[[gep2:.*]] = getelementptr i8, ptr %[[gep1]], i16 %[[arg2]]104! LLVMIR: %[[src:.*]] = shufflevector <4 x float> %[[arg1]], <4 x float> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>105! LLVMIR: store <4 x float> %[[src]], ptr %[[gep2]], align 16106end subroutine vec_xstw4_test107