1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32 %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64 %s
6 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
7 ; RUN: | FileCheck -check-prefix=NOLIB %s
8 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
9 ; RUN: | FileCheck -check-prefix=NOLIB %s
11 define void @test1(float* %a, float* %b) {
13 ; RV32: # %bb.0: # %entry
14 ; RV32-NEXT: lw a1, 0(a1)
15 ; RV32-NEXT: lui a2, 524288
16 ; RV32-NEXT: xor a1, a1, a2
17 ; RV32-NEXT: sw a1, 0(a0)
21 ; RV64: # %bb.0: # %entry
22 ; RV64-NEXT: addi a2, zero, 1
23 ; RV64-NEXT: slli a2, a2, 31
24 ; RV64-NEXT: lw a1, 0(a1)
25 ; RV64-NEXT: xor a1, a1, a2
26 ; RV64-NEXT: sw a1, 0(a0)
31 ; NOLIB-NOT: call __subsf3
33 %0 = load float, float* %b
35 store float %neg, float* %a
39 define void @test2(double* %a, double* %b) {
41 ; RV32: # %bb.0: # %entry
42 ; RV32-NEXT: lw a2, 4(a1)
43 ; RV32-NEXT: lw a1, 0(a1)
44 ; RV32-NEXT: sw a1, 0(a0)
45 ; RV32-NEXT: lui a1, 524288
46 ; RV32-NEXT: xor a1, a2, a1
47 ; RV32-NEXT: sw a1, 4(a0)
51 ; RV64: # %bb.0: # %entry
52 ; RV64-NEXT: addi a2, zero, -1
53 ; RV64-NEXT: slli a2, a2, 63
54 ; RV64-NEXT: ld a1, 0(a1)
55 ; RV64-NEXT: xor a1, a1, a2
56 ; RV64-NEXT: sd a1, 0(a0)
61 ; NOLIB-NOT: call __subdf3
63 %0 = load double, double* %b
65 store double %neg, double* %a
69 define void @test3(fp128* %a, fp128* %b) {
71 ; RV32: # %bb.0: # %entry
72 ; RV32-NEXT: lw a2, 12(a1)
73 ; RV32-NEXT: lw a3, 0(a1)
74 ; RV32-NEXT: lw a4, 4(a1)
75 ; RV32-NEXT: lw a1, 8(a1)
76 ; RV32-NEXT: sw a1, 8(a0)
77 ; RV32-NEXT: sw a4, 4(a0)
78 ; RV32-NEXT: sw a3, 0(a0)
79 ; RV32-NEXT: lui a1, 524288
80 ; RV32-NEXT: xor a1, a2, a1
81 ; RV32-NEXT: sw a1, 12(a0)
85 ; RV64: # %bb.0: # %entry
86 ; RV64-NEXT: ld a2, 8(a1)
87 ; RV64-NEXT: ld a1, 0(a1)
88 ; RV64-NEXT: sd a1, 0(a0)
89 ; RV64-NEXT: addi a1, zero, -1
90 ; RV64-NEXT: slli a1, a1, 63
91 ; RV64-NEXT: xor a1, a2, a1
92 ; RV64-NEXT: sd a1, 8(a0)
97 ; NOLIB-NOT: call __subtf3
99 %0 = load fp128, fp128* %b
101 store fp128 %neg, fp128* %a