1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32,FP32
3 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -mattr=+fp64,+mips32r2 -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32,FP64
5 define float @float_in_fpr(float %a, float %b) {
6 ; MIPS32-LABEL: float_in_fpr:
7 ; MIPS32: # %bb.0: # %entry
8 ; MIPS32-NEXT: mov.s $f0, $f14
15 define double @double_in_fpr(double %a, double %b) {
16 ; MIPS32-LABEL: double_in_fpr:
17 ; MIPS32: # %bb.0: # %entry
18 ; MIPS32-NEXT: mov.d $f0, $f14
25 define float @float_in_gpr(i32 %a, float %b) {
26 ; MIPS32-LABEL: float_in_gpr:
27 ; MIPS32: # %bb.0: # %entry
28 ; MIPS32-NEXT: mtc1 $5, $f0
35 define double @double_in_gpr(i32 %a, double %b) {
36 ; FP32-LABEL: double_in_gpr:
37 ; FP32: # %bb.0: # %entry
38 ; FP32-NEXT: mtc1 $6, $f0
39 ; FP32-NEXT: mtc1 $7, $f1
43 ; FP64-LABEL: double_in_gpr:
44 ; FP64: # %bb.0: # %entry
45 ; FP64-NEXT: mtc1 $6, $f0
46 ; FP64-NEXT: mthc1 $7, $f0
53 define float @call_float_in_fpr(float %a, float %b) {
54 ; MIPS32-LABEL: call_float_in_fpr:
55 ; MIPS32: # %bb.0: # %entry
56 ; MIPS32-NEXT: addiu $sp, $sp, -24
57 ; MIPS32-NEXT: .cfi_def_cfa_offset 24
58 ; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
59 ; MIPS32-NEXT: .cfi_offset 31, -4
60 ; MIPS32-NEXT: jal float_in_fpr
62 ; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
63 ; MIPS32-NEXT: addiu $sp, $sp, 24
67 %call = call float @float_in_fpr(float %a, float %b)
71 define double @call_double_in_fpr(double %a, double %b) {
72 ; MIPS32-LABEL: call_double_in_fpr:
73 ; MIPS32: # %bb.0: # %entry
74 ; MIPS32-NEXT: addiu $sp, $sp, -24
75 ; MIPS32-NEXT: .cfi_def_cfa_offset 24
76 ; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
77 ; MIPS32-NEXT: .cfi_offset 31, -4
78 ; MIPS32-NEXT: jal double_in_fpr
80 ; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
81 ; MIPS32-NEXT: addiu $sp, $sp, 24
85 %call = call double @double_in_fpr(double %a, double %b)
89 define float @call_float_in_gpr(i32 %a, float %b) {
90 ; MIPS32-LABEL: call_float_in_gpr:
91 ; MIPS32: # %bb.0: # %entry
92 ; MIPS32-NEXT: addiu $sp, $sp, -24
93 ; MIPS32-NEXT: .cfi_def_cfa_offset 24
94 ; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
95 ; MIPS32-NEXT: .cfi_offset 31, -4
96 ; MIPS32-NEXT: jal float_in_gpr
98 ; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
99 ; MIPS32-NEXT: addiu $sp, $sp, 24
100 ; MIPS32-NEXT: jr $ra
103 %call = call float @float_in_gpr(i32 %a, float %b)
108 define double @call_double_in_gpr(i32 %a, double %b) {
109 ; MIPS32-LABEL: call_double_in_gpr:
110 ; MIPS32: # %bb.0: # %entry
111 ; MIPS32-NEXT: addiu $sp, $sp, -24
112 ; MIPS32-NEXT: .cfi_def_cfa_offset 24
113 ; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
114 ; MIPS32-NEXT: .cfi_offset 31, -4
115 ; MIPS32-NEXT: jal double_in_gpr
117 ; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
118 ; MIPS32-NEXT: addiu $sp, $sp, 24
119 ; MIPS32-NEXT: jr $ra
122 %call = call double @double_in_gpr(i32 %a, double %b)