• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -global-isel -mtriple=x86_64-linux-gnu < %s | FileCheck %s
3
4; FIXME: Calling convention lowering fails
5; define half @roundeven_f16(half %x) {
6;   %roundeven = call half @llvm.roundeven.f16(half %x)
7;   ret half %roundeven
8; }
9
10define float @roundeven_f32(float %x) {
11; CHECK-LABEL: roundeven_f32:
12; CHECK:       # %bb.0:
13; CHECK-NEXT:    pushq %rax
14; CHECK-NEXT:    .cfi_def_cfa_offset 16
15; CHECK-NEXT:    callq roundevenf
16; CHECK-NEXT:    popq %rax
17; CHECK-NEXT:    .cfi_def_cfa_offset 8
18; CHECK-NEXT:    retq
19  %roundeven = call float @llvm.roundeven.f32(float %x)
20  ret float %roundeven
21}
22
23define double @roundeven_f64(double %x) {
24; CHECK-LABEL: roundeven_f64:
25; CHECK:       # %bb.0:
26; CHECK-NEXT:    pushq %rax
27; CHECK-NEXT:    .cfi_def_cfa_offset 16
28; CHECK-NEXT:    callq roundeven
29; CHECK-NEXT:    popq %rax
30; CHECK-NEXT:    .cfi_def_cfa_offset 8
31; CHECK-NEXT:    retq
32  %roundeven = call double @llvm.roundeven.f64(double %x)
33  ret double %roundeven
34}
35
36; FIXME: Insert fails
37; define x86_fp80 @roundeven_fp80(x86_fp80 %x) {
38;   %roundeven = call x86_fp80 @llvm.roundeven.f80(x86_fp80 %x)
39;   ret x86_fp80 %roundeven
40; }
41
42define fp128 @roundeven_f128(fp128 %x) {
43; CHECK-LABEL: roundeven_f128:
44; CHECK:       # %bb.0:
45; CHECK-NEXT:    pushq %rax
46; CHECK-NEXT:    .cfi_def_cfa_offset 16
47; CHECK-NEXT:    callq roundevenl
48; CHECK-NEXT:    popq %rax
49; CHECK-NEXT:    .cfi_def_cfa_offset 8
50; CHECK-NEXT:    retq
51  %roundeven = call fp128 @llvm.roundeven.f128(fp128 %x)
52  ret fp128 %roundeven
53}
54
55; FIXME: Fails on build_vector
56; define <4 x float> @roundeven_v4f32(<4 x float> %x) {
57;   %roundeven = call <4 x float> @llvm.roundeven.v4f32(<4 x float> %x)
58;   ret <4 x float> %roundeven
59; }
60
61declare half @llvm.roundeven.f16(half) #0
62declare float @llvm.roundeven.f32(float) #0
63declare <4 x float> @llvm.roundeven.v4f32(<4 x float>) #0
64declare double @llvm.roundeven.f64(double) #0
65declare x86_fp80 @llvm.roundeven.f80(x86_fp80) #0
66declare fp128 @llvm.roundeven.f128(fp128) #0
67
68attributes #0 = { nounwind readnone speculatable willreturn }
69