Skip to content

Commit

Permalink
[LoongArch] Add definitions and feature 'frecipe' for FP approximatio…
Browse files Browse the repository at this point in the history
…n intrinsics/builtins (#78962)

This PR adds definitions and 'frecipe' feature for FP approximation
intrinsics/builtins. In additions, this adds and complements relative
testcases.
  • Loading branch information
Ami-zhang committed Jan 23, 2024
1 parent 86f0547 commit fcb8342
Show file tree
Hide file tree
Showing 26 changed files with 548 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/include/clang/Basic/BuiltinsLoongArchBase.def
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ TARGET_BUILTIN(__builtin_loongarch_iocsrwr_d, "vUWiUi", "nc", "64bit")

TARGET_BUILTIN(__builtin_loongarch_lddir_d, "WiWiIUWi", "nc", "64bit")
TARGET_BUILTIN(__builtin_loongarch_ldpte_d, "vWiIUWi", "nc", "64bit")

TARGET_BUILTIN(__builtin_loongarch_frecipe_s, "ff", "nc", "f,frecipe")
TARGET_BUILTIN(__builtin_loongarch_frecipe_d, "dd", "nc", "d,frecipe")
TARGET_BUILTIN(__builtin_loongarch_frsqrte_s, "ff", "nc", "f,frecipe")
TARGET_BUILTIN(__builtin_loongarch_frsqrte_d, "dd", "nc", "d,frecipe")
6 changes: 6 additions & 0 deletions clang/include/clang/Basic/BuiltinsLoongArchLASX.def
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,15 @@ TARGET_BUILTIN(__builtin_lasx_xvfsqrt_d, "V4dV4d", "nc", "lasx")
TARGET_BUILTIN(__builtin_lasx_xvfrecip_s, "V8fV8f", "nc", "lasx")
TARGET_BUILTIN(__builtin_lasx_xvfrecip_d, "V4dV4d", "nc", "lasx")

TARGET_BUILTIN(__builtin_lasx_xvfrecipe_s, "V8fV8f", "nc", "lasx,frecipe")
TARGET_BUILTIN(__builtin_lasx_xvfrecipe_d, "V4dV4d", "nc", "lasx,frecipe")

TARGET_BUILTIN(__builtin_lasx_xvfrsqrt_s, "V8fV8f", "nc", "lasx")
TARGET_BUILTIN(__builtin_lasx_xvfrsqrt_d, "V4dV4d", "nc", "lasx")

TARGET_BUILTIN(__builtin_lasx_xvfrsqrte_s, "V8fV8f", "nc", "lasx,frecipe")
TARGET_BUILTIN(__builtin_lasx_xvfrsqrte_d, "V4dV4d", "nc", "lasx,frecipe")

TARGET_BUILTIN(__builtin_lasx_xvfcvtl_s_h, "V8fV16s", "nc", "lasx")
TARGET_BUILTIN(__builtin_lasx_xvfcvth_s_h, "V8fV16s", "nc", "lasx")
TARGET_BUILTIN(__builtin_lasx_xvfcvtl_d_s, "V4dV8f", "nc", "lasx")
Expand Down
6 changes: 6 additions & 0 deletions clang/include/clang/Basic/BuiltinsLoongArchLSX.def
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,15 @@ TARGET_BUILTIN(__builtin_lsx_vfsqrt_d, "V2dV2d", "nc", "lsx")
TARGET_BUILTIN(__builtin_lsx_vfrecip_s, "V4fV4f", "nc", "lsx")
TARGET_BUILTIN(__builtin_lsx_vfrecip_d, "V2dV2d", "nc", "lsx")

TARGET_BUILTIN(__builtin_lsx_vfrecipe_s, "V4fV4f", "nc", "lsx,frecipe")
TARGET_BUILTIN(__builtin_lsx_vfrecipe_d, "V2dV2d", "nc", "lsx,frecipe")

TARGET_BUILTIN(__builtin_lsx_vfrsqrt_s, "V4fV4f", "nc", "lsx")
TARGET_BUILTIN(__builtin_lsx_vfrsqrt_d, "V2dV2d", "nc", "lsx")

TARGET_BUILTIN(__builtin_lsx_vfrsqrte_s, "V4fV4f", "nc", "lsx,frecipe")
TARGET_BUILTIN(__builtin_lsx_vfrsqrte_d, "V2dV2d", "nc", "lsx,frecipe")

TARGET_BUILTIN(__builtin_lsx_vfcvtl_s_h, "V4fV8s", "nc", "lsx")
TARGET_BUILTIN(__builtin_lsx_vfcvtl_d_s, "V2dV4f", "nc", "lsx")

Expand Down
12 changes: 12 additions & 0 deletions clang/lib/Headers/larchintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ extern __inline void
((void)__builtin_loongarch_ldpte_d((long int)(_1), (_2)))
#endif

#define __frecipe_s(/*float*/ _1) \
(float)__builtin_loongarch_frecipe_s((float)_1)

#define __frecipe_d(/*double*/ _1) \
(double)__builtin_loongarch_frecipe_d((double)_1)

#define __frsqrte_s(/*float*/ _1) \
(float)__builtin_loongarch_frsqrte_s((float)_1)

#define __frsqrte_d(/*double*/ _1) \
(double)__builtin_loongarch_frsqrte_d((double)_1)

#ifdef __cplusplus
}
#endif
Expand Down
24 changes: 24 additions & 0 deletions clang/lib/Headers/lasxintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,18 @@ extern __inline
return (__m256d)__builtin_lasx_xvfrecip_d((v4f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256
__lasx_xvfrecipe_s(__m256 _1) {
return (__m256)__builtin_lasx_xvfrecipe_s((v8f32)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256d
__lasx_xvfrecipe_d(__m256d _1) {
return (__m256d)__builtin_lasx_xvfrecipe_d((v4f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256
__lasx_xvfrint_s(__m256 _1) {
Expand All @@ -1750,6 +1762,18 @@ extern __inline
return (__m256d)__builtin_lasx_xvfrsqrt_d((v4f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256
__lasx_xvfrsqrte_s(__m256 _1) {
return (__m256)__builtin_lasx_xvfrsqrte_s((v8f32)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256d
__lasx_xvfrsqrte_d(__m256d _1) {
return (__m256d)__builtin_lasx_xvfrsqrte_d((v4f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256
__lasx_xvflogb_s(__m256 _1) {
Expand Down
24 changes: 24 additions & 0 deletions clang/lib/Headers/lsxintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,18 @@ extern __inline
return (__m128d)__builtin_lsx_vfrecip_d((v2f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128
__lsx_vfrecipe_s(__m128 _1) {
return (__m128)__builtin_lsx_vfrecipe_s((v4f32)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128d
__lsx_vfrecipe_d(__m128d _1) {
return (__m128d)__builtin_lsx_vfrecipe_d((v2f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128
__lsx_vfrint_s(__m128 _1) {
Expand All @@ -1800,6 +1812,18 @@ extern __inline
return (__m128d)__builtin_lsx_vfrsqrt_d((v2f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128
__lsx_vfrsqrte_s(__m128 _1) {
return (__m128)__builtin_lsx_vfrsqrte_s((v4f32)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128d
__lsx_vfrsqrte_d(__m128d _1) {
return (__m128d)__builtin_lsx_vfrsqrte_d((v2f64)_1);
}

extern __inline
__attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128
__lsx_vflogb_s(__m128 _1) {
Expand Down
45 changes: 45 additions & 0 deletions clang/test/CodeGen/LoongArch/builtin-dbl-approximate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
// RUN: %clang_cc1 -triple loongarch32 -target-feature +d -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple loongarch64 -target-feature +d -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s

#include <larchintrin.h>

// CHECK-LABEL: @frecipe_d
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.loongarch.frecipe.d(double [[A:%.*]])
// CHECK-NEXT: ret double [[TMP0]]
//
double frecipe_d (double _1)
{
return __builtin_loongarch_frecipe_d (_1);
}

// CHECK-LABEL: @frsqrte_d
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.loongarch.frsqrte.d(double [[A:%.*]])
// CHECK-NEXT: ret double [[TMP0]]
//
double frsqrte_d (double _1)
{
return __builtin_loongarch_frsqrte_d (_1);
}

// CHECK-LABEL: @frecipe_d_alia
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.loongarch.frecipe.d(double [[A:%.*]])
// CHECK-NEXT: ret double [[TMP0]]
//
double frecipe_d_alia (double _1)
{
return __frecipe_d (_1);
}

// CHECK-LABEL: @frsqrte_d_alia
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.loongarch.frsqrte.d(double [[A:%.*]])
// CHECK-NEXT: ret double [[TMP0]]
//
double frsqrte_d_alia (double _1)
{
return __frsqrte_d (_1);
}
45 changes: 45 additions & 0 deletions clang/test/CodeGen/LoongArch/builtin-flt-approximate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
// RUN: %clang_cc1 -triple loongarch32 -target-feature +f -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple loongarch64 -target-feature +f -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s

#include <larchintrin.h>

// CHECK-LABEL: @frecipe_s
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.loongarch.frecipe.s(float [[A:%.*]])
// CHECK-NEXT: ret float [[TMP0]]
//
float frecipe_s (float _1)
{
return __builtin_loongarch_frecipe_s (_1);
}

// CHECK-LABEL: @frsqrte_s
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.loongarch.frsqrte.s(float [[A:%.*]])
// CHECK-NEXT: ret float [[TMP0]]
//
float frsqrte_s (float _1)
{
return __builtin_loongarch_frsqrte_s (_1);
}

// CHECK-LABEL: @frecipe_s_alia
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.loongarch.frecipe.s(float [[A:%.*]])
// CHECK-NEXT: ret float [[TMP0]]
//
float frecipe_s_alia (float _1)
{
return __frecipe_s (_1);
}

// CHECK-LABEL: @frsqrte_s_alia
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.loongarch.frsqrte.s(float [[A:%.*]])
// CHECK-NEXT: ret float [[TMP0]]
//
float frsqrte_s_alia (float _1)
{
return __frsqrte_s (_1);
}
21 changes: 21 additions & 0 deletions clang/test/CodeGen/LoongArch/intrinsic-la64-error.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
// RUN: %clang_cc1 -triple loongarch64 -emit-llvm -S -verify %s -o /dev/null
// RUN: not %clang_cc1 -triple loongarch64 -DFEATURE_CHECK -emit-llvm %s -o /dev/null 2>&1 \
// RUN: | FileCheck %s

#include <larchintrin.h>

#ifdef FEATURE_CHECK
void test_feature(unsigned long *v_ul, int *v_i, float a, double b) {
// CHECK: error: '__builtin_loongarch_cacop_w' needs target feature 32bit
__builtin_loongarch_cacop_w(1, v_ul[0], 1024);
// CHECK: error: '__builtin_loongarch_movfcsr2gr' needs target feature f
v_i[0] = __builtin_loongarch_movfcsr2gr(1);
// CHECK: error: '__builtin_loongarch_movgr2fcsr' needs target feature f
__builtin_loongarch_movgr2fcsr(1, v_i[1]);
// CHECK: error: '__builtin_loongarch_frecipe_s' needs target feature f,frecipe
float f1 = __builtin_loongarch_frecipe_s(a);
// CHECK: error: '__builtin_loongarch_frsqrte_s' needs target feature f,frecipe
float f2 = __builtin_loongarch_frsqrte_s(a);
// CHECK: error: '__builtin_loongarch_frecipe_d' needs target feature d,frecipe
double d1 = __builtin_loongarch_frecipe_d(b);
// CHECK: error: '__builtin_loongarch_frsqrte_d' needs target feature d,frecipe
double d2 = __builtin_loongarch_frsqrte_d(b);
}
#endif

void csrrd_d(int a) {
__builtin_loongarch_csrrd_d(16384); // expected-error {{argument value 16384 is outside the valid range [0, 16383]}}
__builtin_loongarch_csrrd_d(-1); // expected-error {{argument value 4294967295 is outside the valid range [0, 16383]}}
Expand Down
37 changes: 37 additions & 0 deletions clang/test/CodeGen/LoongArch/lasx/builtin-approximate-alias.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple loongarch64 -target-feature +lasx -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s

#include <lasxintrin.h>

// CHECK-LABEL: @xvfrecipe_s(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <8 x float>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x float> @llvm.loongarch.lasx.xvfrecipe.s(<8 x float> [[_1]])
// CHECK-NEXT: store <8 x float> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v8f32 xvfrecipe_s(v8f32 _1) { return __lasx_xvfrecipe_s(_1); }
// CHECK-LABEL: @xvfrecipe_d(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <4 x double>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x double> @llvm.loongarch.lasx.xvfrecipe.d(<4 x double> [[_1]])
// CHECK-NEXT: store <4 x double> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v4f64 xvfrecipe_d(v4f64 _1) { return __lasx_xvfrecipe_d(_1); }
// CHECK-LABEL: @xvfrsqrte_s(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <8 x float>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x float> @llvm.loongarch.lasx.xvfrsqrte.s(<8 x float> [[_1]])
// CHECK-NEXT: store <8 x float> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v8f32 xvfrsqrte_s(v8f32 _1) { return __lasx_xvfrsqrte_s(_1); }
// CHECK-LABEL: @xvfrsqrte_d(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <4 x double>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x double> @llvm.loongarch.lasx.xvfrsqrte.d(<4 x double> [[_1]])
// CHECK-NEXT: store <4 x double> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v4f64 xvfrsqrte_d(v4f64 _1) { return __lasx_xvfrsqrte_d(_1); }
38 changes: 38 additions & 0 deletions clang/test/CodeGen/LoongArch/lasx/builtin-approximate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple loongarch64 -target-feature +lasx -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s

typedef float v8f32 __attribute__((vector_size(32), aligned(32)));
typedef double v4f64 __attribute__((vector_size(32), aligned(32)));

// CHECK-LABEL: @xvfrecipe_s
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <8 x float>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x float> @llvm.loongarch.lasx.xvfrecipe.s(<8 x float> [[_1]])
// CHECK-NEXT: store <8 x float> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v8f32 xvfrecipe_s(v8f32 _1) { return __builtin_lasx_xvfrecipe_s(_1); }
// CHECK-LABEL: @xvfrecipe_d
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <4 x double>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x double> @llvm.loongarch.lasx.xvfrecipe.d(<4 x double> [[_1]])
// CHECK-NEXT: store <4 x double> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v4f64 xvfrecipe_d(v4f64 _1) { return __builtin_lasx_xvfrecipe_d(_1); }
// CHECK-LABEL: @xvfrsqrte_s
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <8 x float>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x float> @llvm.loongarch.lasx.xvfrsqrte.s(<8 x float> [[_1]])
// CHECK-NEXT: store <8 x float> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v8f32 xvfrsqrte_s(v8f32 _1) { return __builtin_lasx_xvfrsqrte_s(_1); }
// CHECK-LABEL: @xvfrsqrte_d
// CHECK-NEXT: entry:
// CHECK-NEXT: [[_1:%.*]] = load <4 x double>, ptr [[TMP0:%.*]], align 32, !tbaa [[TBAA2:![0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x double> @llvm.loongarch.lasx.xvfrsqrte.d(<4 x double> [[_1]])
// CHECK-NEXT: store <4 x double> [[TMP1]], ptr [[AGG_RESULT:%.*]], align 32, !tbaa [[TBAA2]]
// CHECK-NEXT: ret void
//
v4f64 xvfrsqrte_d(v4f64 _1) { return __builtin_lasx_xvfrsqrte_d(_1); }
37 changes: 37 additions & 0 deletions clang/test/CodeGen/LoongArch/lsx/builtin-approximate-alias.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple loongarch64 -target-feature +lsx -target-feature +frecipe -O2 -emit-llvm %s -o - | FileCheck %s

#include <lsxintrin.h>

// CHECK-LABEL: @vfrecipe_s(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <4 x float>
// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.loongarch.lsx.vfrecipe.s(<4 x float> [[TMP0]])
// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to i128
// CHECK-NEXT: ret i128 [[TMP2]]
//
v4f32 vfrecipe_s(v4f32 _1) { return __lsx_vfrecipe_s(_1); }
// CHECK-LABEL: @vfrecipe_d(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <2 x double>
// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.loongarch.lsx.vfrecipe.d(<2 x double> [[TMP0]])
// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to i128
// CHECK-NEXT: ret i128 [[TMP2]]
//
v2f64 vfrecipe_d(v2f64 _1) { return __lsx_vfrecipe_d(_1); }
// CHECK-LABEL: @vfrsqrte_s(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <4 x float>
// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.loongarch.lsx.vfrsqrte.s(<4 x float> [[TMP0]])
// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to i128
// CHECK-NEXT: ret i128 [[TMP2]]
//
v4f32 vfrsqrte_s(v4f32 _1) { return __lsx_vfrsqrte_s(_1); }
// CHECK-LABEL: @vfrsqrte_d(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[_1_COERCE:%.*]] to <2 x double>
// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.loongarch.lsx.vfrsqrte.d(<2 x double> [[TMP0]])
// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to i128
// CHECK-NEXT: ret i128 [[TMP2]]
//
v2f64 vfrsqrte_d(v2f64 _1) { return __lsx_vfrsqrte_d(_1); }

0 comments on commit fcb8342

Please sign in to comment.