aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/LoongArch/builtin-flt-approximate.c
blob: 47bb47084364b8baf89d274813820a723b7d298c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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);
}