[AArch64] Prefer SVE2.2 zeroing forms of certain instructions with an all-true predic...
[llvm-project.git] / clang / test / CodeGen / LoongArch / lsx / builtin-approximate.c
blob39fa1663db349b0cba038cc3b6d31ebe76608573
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple loongarch64 -target-feature +lsx -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s
4 typedef float v4f32 __attribute__ ((vector_size(16), aligned(16)));
5 typedef double v2f64 __attribute__ ((vector_size(16), aligned(16)));
7 // CHECK-LABEL: @vfrecipe_s
8 // CHECK-NEXT: entry:
9 // CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <4 x float>
10 // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.loongarch.lsx.vfrecipe.s(<4 x float> [[TMP0]])
11 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to i128
12 // CHECK-NEXT: ret i128 [[TMP2]]
14 v4f32 vfrecipe_s (v4f32 _1) { return __builtin_lsx_vfrecipe_s (_1); }
15 // CHECK-LABEL: @vfrecipe_d
16 // CHECK-NEXT: entry:
17 // CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <2 x double>
18 // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.loongarch.lsx.vfrecipe.d(<2 x double> [[TMP0]])
19 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to i128
20 // CHECK-NEXT: ret i128 [[TMP2]]
22 v2f64 vfrecipe_d (v2f64 _1) { return __builtin_lsx_vfrecipe_d (_1); }
23 // CHECK-LABEL: @vfrsqrte_s
24 // CHECK-NEXT: entry:
25 // CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <4 x float>
26 // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.loongarch.lsx.vfrsqrte.s(<4 x float> [[TMP0]])
27 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to i128
28 // CHECK-NEXT: ret i128 [[TMP2]]
30 v4f32 vfrsqrte_s (v4f32 _1) { return __builtin_lsx_vfrsqrte_s (_1); }
31 // CHECK-LABEL: @vfrsqrte_d
32 // CHECK-NEXT: entry:
33 // CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <2 x double>
34 // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.loongarch.lsx.vfrsqrte.d(<2 x double> [[TMP0]])
35 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to i128
36 // CHECK-NEXT: ret i128 [[TMP2]]
38 v2f64 vfrsqrte_d (v2f64 _1) { return __builtin_lsx_vfrsqrte_d (_1); }