1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=aarch64 | FileCheck %s
3 ; RUN: llc < %s -mtriple=aarch64 -global-isel | FileCheck %s
5 define i32 @testmsws(float %x) {
6 ; CHECK-LABEL: testmsws:
7 ; CHECK: // %bb.0: // %entry
8 ; CHECK-NEXT: frintx s0, s0
9 ; CHECK-NEXT: fcvtzs x0, s0
10 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
13 %0 = tail call i64 @llvm.llrint.f32(float %x)
14 %conv = trunc i64 %0 to i32
18 define i64 @testmsxs(float %x) {
19 ; CHECK-LABEL: testmsxs:
20 ; CHECK: // %bb.0: // %entry
21 ; CHECK-NEXT: frintx s0, s0
22 ; CHECK-NEXT: fcvtzs x0, s0
25 %0 = tail call i64 @llvm.llrint.f32(float %x)
29 define i32 @testmswd(double %x) {
30 ; CHECK-LABEL: testmswd:
31 ; CHECK: // %bb.0: // %entry
32 ; CHECK-NEXT: frintx d0, d0
33 ; CHECK-NEXT: fcvtzs x0, d0
34 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
37 %0 = tail call i64 @llvm.llrint.f64(double %x)
38 %conv = trunc i64 %0 to i32
42 define i64 @testmsxd(double %x) {
43 ; CHECK-LABEL: testmsxd:
44 ; CHECK: // %bb.0: // %entry
45 ; CHECK-NEXT: frintx d0, d0
46 ; CHECK-NEXT: fcvtzs x0, d0
49 %0 = tail call i64 @llvm.llrint.f64(double %x)
53 define i32 @testmswl(fp128 %x) {
54 ; CHECK-LABEL: testmswl:
55 ; CHECK: // %bb.0: // %entry
56 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
57 ; CHECK-NEXT: .cfi_def_cfa_offset 16
58 ; CHECK-NEXT: .cfi_offset w30, -16
59 ; CHECK-NEXT: bl llrintl
60 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
61 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
64 %0 = tail call i64 @llvm.llrint.f128(fp128 %x)
65 %conv = trunc i64 %0 to i32
69 define i64 @testmsll(fp128 %x) {
70 ; CHECK-LABEL: testmsll:
71 ; CHECK: // %bb.0: // %entry
72 ; CHECK-NEXT: b llrintl
74 %0 = tail call i64 @llvm.llrint.f128(fp128 %x)
78 declare i64 @llvm.llrint.f32(float) nounwind readnone
79 declare i64 @llvm.llrint.f64(double) nounwind readnone
80 declare i64 @llvm.llrint.f128(fp128) nounwind readnone