1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -target-abi ilp32f -mattr=+f < %s \
3 ; RUN: | FileCheck --check-prefix=RV32F %s
4 ; RUN: llc -mtriple=riscv32 -target-abi ilp32d -mattr=+f,+d < %s \
5 ; RUN: | FileCheck --check-prefix=RV32D %s
6 ; RUN: llc -mtriple=riscv64 -target-abi lp64f -mattr=+f < %s \
7 ; RUN: | FileCheck --check-prefix=RV64F %s
8 ; RUN: llc -mtriple=riscv64 -target-abi lp64d -mattr=+f,+d < %s \
9 ; RUN: | FileCheck --check-prefix=RV64D %s
11 define float @f32_positive_zero(float *%pf) nounwind {
12 ; RV32F-LABEL: f32_positive_zero:
14 ; RV32F-NEXT: fmv.w.x fa0, zero
17 ; RV32D-LABEL: f32_positive_zero:
19 ; RV32D-NEXT: fmv.w.x fa0, zero
22 ; RV64F-LABEL: f32_positive_zero:
24 ; RV64F-NEXT: fmv.w.x fa0, zero
27 ; RV64D-LABEL: f32_positive_zero:
29 ; RV64D-NEXT: fmv.w.x fa0, zero
34 define float @f32_negative_zero(float *%pf) nounwind {
35 ; RV32F-LABEL: f32_negative_zero:
37 ; RV32F-NEXT: lui a0, %hi(.LCPI1_0)
38 ; RV32F-NEXT: flw fa0, %lo(.LCPI1_0)(a0)
41 ; RV32D-LABEL: f32_negative_zero:
43 ; RV32D-NEXT: lui a0, %hi(.LCPI1_0)
44 ; RV32D-NEXT: flw fa0, %lo(.LCPI1_0)(a0)
47 ; RV64F-LABEL: f32_negative_zero:
49 ; RV64F-NEXT: lui a0, %hi(.LCPI1_0)
50 ; RV64F-NEXT: flw fa0, %lo(.LCPI1_0)(a0)
53 ; RV64D-LABEL: f32_negative_zero:
55 ; RV64D-NEXT: lui a0, %hi(.LCPI1_0)
56 ; RV64D-NEXT: flw fa0, %lo(.LCPI1_0)(a0)
61 define double @f64_positive_zero(double *%pd) nounwind {
62 ; RV32F-LABEL: f64_positive_zero:
64 ; RV32F-NEXT: mv a0, zero
65 ; RV32F-NEXT: mv a1, zero
68 ; RV32D-LABEL: f64_positive_zero:
70 ; RV32D-NEXT: fcvt.d.w fa0, zero
73 ; RV64F-LABEL: f64_positive_zero:
75 ; RV64F-NEXT: mv a0, zero
78 ; RV64D-LABEL: f64_positive_zero:
80 ; RV64D-NEXT: fmv.d.x fa0, zero
85 define double @f64_negative_zero(double *%pd) nounwind {
86 ; RV32F-LABEL: f64_negative_zero:
88 ; RV32F-NEXT: lui a1, 524288
89 ; RV32F-NEXT: mv a0, zero
92 ; RV32D-LABEL: f64_negative_zero:
94 ; RV32D-NEXT: lui a0, %hi(.LCPI3_0)
95 ; RV32D-NEXT: fld fa0, %lo(.LCPI3_0)(a0)
98 ; RV64F-LABEL: f64_negative_zero:
100 ; RV64F-NEXT: addi a0, zero, -1
101 ; RV64F-NEXT: slli a0, a0, 63
104 ; RV64D-LABEL: f64_negative_zero:
106 ; RV64D-NEXT: lui a0, %hi(.LCPI3_0)
107 ; RV64D-NEXT: fld fa0, %lo(.LCPI3_0)(a0)