1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d -target-abi ilp32d -verify-machineinstrs \
3 ; RUN: < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d -target-abi lp64d -verify-machineinstrs \
5 ; RUN: < %s | FileCheck %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+zdinx -target-abi ilp32 -verify-machineinstrs \
7 ; RUN: < %s | FileCheck --check-prefix=CHECKRV32ZDINX %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+zdinx -target-abi lp64 -verify-machineinstrs \
9 ; RUN: < %s | FileCheck --check-prefix=CHECKRV64ZDINX %s
11 define zeroext i1 @double_is_nan(double %a) nounwind {
12 ; CHECK-LABEL: double_is_nan:
14 ; CHECK-NEXT: feq.d a0, fa0, fa0
15 ; CHECK-NEXT: xori a0, a0, 1
18 ; CHECKRV32ZDINX-LABEL: double_is_nan:
19 ; CHECKRV32ZDINX: # %bb.0:
20 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
21 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
22 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
23 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
24 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
25 ; CHECKRV32ZDINX-NEXT: feq.d a0, a0, a0
26 ; CHECKRV32ZDINX-NEXT: xori a0, a0, 1
27 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
28 ; CHECKRV32ZDINX-NEXT: ret
30 ; CHECKRV64ZDINX-LABEL: double_is_nan:
31 ; CHECKRV64ZDINX: # %bb.0:
32 ; CHECKRV64ZDINX-NEXT: feq.d a0, a0, a0
33 ; CHECKRV64ZDINX-NEXT: xori a0, a0, 1
34 ; CHECKRV64ZDINX-NEXT: ret
35 %1 = fcmp uno double %a, 0.000000e+00
39 define zeroext i1 @double_not_nan(double %a) nounwind {
40 ; CHECK-LABEL: double_not_nan:
42 ; CHECK-NEXT: feq.d a0, fa0, fa0
45 ; CHECKRV32ZDINX-LABEL: double_not_nan:
46 ; CHECKRV32ZDINX: # %bb.0:
47 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
48 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
49 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
50 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
51 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
52 ; CHECKRV32ZDINX-NEXT: feq.d a0, a0, a0
53 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
54 ; CHECKRV32ZDINX-NEXT: ret
56 ; CHECKRV64ZDINX-LABEL: double_not_nan:
57 ; CHECKRV64ZDINX: # %bb.0:
58 ; CHECKRV64ZDINX-NEXT: feq.d a0, a0, a0
59 ; CHECKRV64ZDINX-NEXT: ret
60 %1 = fcmp ord double %a, 0.000000e+00