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
7 define void @test1(float* %a, float* %b) nounwind {
9 ; RV32: # %bb.0: # %entry
10 ; RV32-NEXT: lw a1, 0(a1)
11 ; RV32-NEXT: lui a2, 524288
12 ; RV32-NEXT: xor a1, a1, a2
13 ; RV32-NEXT: sw a1, 0(a0)
17 ; RV64: # %bb.0: # %entry
18 ; RV64-NEXT: addi a2, zero, 1
19 ; RV64-NEXT: slli a2, a2, 31
20 ; RV64-NEXT: lw a1, 0(a1)
21 ; RV64-NEXT: xor a1, a1, a2
22 ; RV64-NEXT: sw a1, 0(a0)
25 %0 = load float, float* %b
27 store float %neg, float* %a
31 define void @test2(double* %a, double* %b) nounwind {
33 ; RV32: # %bb.0: # %entry
34 ; RV32-NEXT: lw a2, 4(a1)
35 ; RV32-NEXT: lw a1, 0(a1)
36 ; RV32-NEXT: sw a1, 0(a0)
37 ; RV32-NEXT: lui a1, 524288
38 ; RV32-NEXT: xor a1, a2, a1
39 ; RV32-NEXT: sw a1, 4(a0)
43 ; RV64: # %bb.0: # %entry
44 ; RV64-NEXT: addi a2, zero, -1
45 ; RV64-NEXT: slli a2, a2, 63
46 ; RV64-NEXT: ld a1, 0(a1)
47 ; RV64-NEXT: xor a1, a1, a2
48 ; RV64-NEXT: sd a1, 0(a0)
51 %0 = load double, double* %b
53 store double %neg, double* %a
57 define void @test3(fp128* %a, fp128* %b) nounwind {
59 ; RV32: # %bb.0: # %entry
60 ; RV32-NEXT: lw a2, 12(a1)
61 ; RV32-NEXT: lw a3, 4(a1)
62 ; RV32-NEXT: lw a4, 0(a1)
63 ; RV32-NEXT: lw a1, 8(a1)
64 ; RV32-NEXT: sw a1, 8(a0)
65 ; RV32-NEXT: sw a4, 0(a0)
66 ; RV32-NEXT: sw a3, 4(a0)
67 ; RV32-NEXT: lui a1, 524288
68 ; RV32-NEXT: xor a1, a2, a1
69 ; RV32-NEXT: sw a1, 12(a0)
73 ; RV64: # %bb.0: # %entry
74 ; RV64-NEXT: ld a2, 8(a1)
75 ; RV64-NEXT: ld a1, 0(a1)
76 ; RV64-NEXT: sd a1, 0(a0)
77 ; RV64-NEXT: addi a1, zero, -1
78 ; RV64-NEXT: slli a1, a1, 63
79 ; RV64-NEXT: xor a1, a2, a1
80 ; RV64-NEXT: sd a1, 8(a0)
83 %0 = load fp128, fp128* %b
85 store fp128 %neg, fp128* %a