reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
  189
  190
  191
  192
  193
  194
  195
  196
  197
  198
  199
  200
  201
  202
  203
  204
  205
  206
  207
  208
  209
  210
  211
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py

; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP32
; RUN: llc -O0 -mtriple=mipsel-linux-gnu -mattr=+fp64,+mips32r2 -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP64

define float @float_in_fpr(float %a, float %b) {
  ; FP32-LABEL: name: float_in_fpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $f12, $f14
  ; FP32:   [[COPY:%[0-9]+]]:_(s32) = COPY $f12
  ; FP32:   [[COPY1:%[0-9]+]]:_(s32) = COPY $f14
  ; FP32:   $f0 = COPY [[COPY1]](s32)
  ; FP32:   RetRA implicit $f0
  ; FP64-LABEL: name: float_in_fpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $f12, $f14
  ; FP64:   [[COPY:%[0-9]+]]:_(s32) = COPY $f12
  ; FP64:   [[COPY1:%[0-9]+]]:_(s32) = COPY $f14
  ; FP64:   $f0 = COPY [[COPY1]](s32)
  ; FP64:   RetRA implicit $f0
entry:
  ret float %b
}

define double @double_in_fpr(double %a, double %b) {
  ; FP32-LABEL: name: double_in_fpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $d6, $d7
  ; FP32:   [[COPY:%[0-9]+]]:_(s64) = COPY $d6
  ; FP32:   [[COPY1:%[0-9]+]]:_(s64) = COPY $d7
  ; FP32:   $d0 = COPY [[COPY1]](s64)
  ; FP32:   RetRA implicit $d0
  ; FP64-LABEL: name: double_in_fpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $d12_64, $d14_64
  ; FP64:   [[COPY:%[0-9]+]]:_(s64) = COPY $d12_64
  ; FP64:   [[COPY1:%[0-9]+]]:_(s64) = COPY $d14_64
  ; FP64:   $d0_64 = COPY [[COPY1]](s64)
  ; FP64:   RetRA implicit $d0_64
entry:
  ret double %b
}

define float @float_in_gpr(i32 %a, float %b) {
  ; FP32-LABEL: name: float_in_gpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $a0, $a1
  ; FP32:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP32:   [[MTC1_:%[0-9]+]]:fgr32(s32) = MTC1 $a1
  ; FP32:   $f0 = COPY [[MTC1_]](s32)
  ; FP32:   RetRA implicit $f0
  ; FP64-LABEL: name: float_in_gpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $a0, $a1
  ; FP64:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP64:   [[MTC1_:%[0-9]+]]:fgr32(s32) = MTC1 $a1
  ; FP64:   $f0 = COPY [[MTC1_]](s32)
  ; FP64:   RetRA implicit $f0
entry:
  ret float %b
}

define double @double_in_gpr(i32 %a, double %b) {
  ; FP32-LABEL: name: double_in_gpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $a0, $a2, $a3
  ; FP32:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP32:   [[BuildPairF64_:%[0-9]+]]:afgr64(s64) = BuildPairF64 $a2, $a3
  ; FP32:   $d0 = COPY [[BuildPairF64_]](s64)
  ; FP32:   RetRA implicit $d0
  ; FP64-LABEL: name: double_in_gpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $a0, $a2, $a3
  ; FP64:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP64:   [[BuildPairF64_64_:%[0-9]+]]:fgr64(s64) = BuildPairF64_64 $a2, $a3
  ; FP64:   $d0_64 = COPY [[BuildPairF64_64_]](s64)
  ; FP64:   RetRA implicit $d0_64
entry:
  ret double %b
}

define float @call_float_in_fpr(float %a, float %b) {
  ; FP32-LABEL: name: call_float_in_fpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $f12, $f14
  ; FP32:   [[COPY:%[0-9]+]]:_(s32) = COPY $f12
  ; FP32:   [[COPY1:%[0-9]+]]:_(s32) = COPY $f14
  ; FP32:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $f12 = COPY [[COPY]](s32)
  ; FP32:   $f14 = COPY [[COPY1]](s32)
  ; FP32:   JAL @float_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit $f14, implicit-def $f0
  ; FP32:   [[COPY2:%[0-9]+]]:_(s32) = COPY $f0
  ; FP32:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $f0 = COPY [[COPY2]](s32)
  ; FP32:   RetRA implicit $f0
  ; FP64-LABEL: name: call_float_in_fpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $f12, $f14
  ; FP64:   [[COPY:%[0-9]+]]:_(s32) = COPY $f12
  ; FP64:   [[COPY1:%[0-9]+]]:_(s32) = COPY $f14
  ; FP64:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $f12 = COPY [[COPY]](s32)
  ; FP64:   $f14 = COPY [[COPY1]](s32)
  ; FP64:   JAL @float_in_fpr, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $f12, implicit $f14, implicit-def $f0
  ; FP64:   [[COPY2:%[0-9]+]]:_(s32) = COPY $f0
  ; FP64:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $f0 = COPY [[COPY2]](s32)
  ; FP64:   RetRA implicit $f0
entry:
  %call = call float @float_in_fpr(float %a, float %b)
  ret float %call
}

define double @call_double_in_fpr(double %a, double %b) {
  ; FP32-LABEL: name: call_double_in_fpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $d6, $d7
  ; FP32:   [[COPY:%[0-9]+]]:_(s64) = COPY $d6
  ; FP32:   [[COPY1:%[0-9]+]]:_(s64) = COPY $d7
  ; FP32:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $d6 = COPY [[COPY]](s64)
  ; FP32:   $d7 = COPY [[COPY1]](s64)
  ; FP32:   JAL @double_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit $d7, implicit-def $d0
  ; FP32:   [[COPY2:%[0-9]+]]:_(s64) = COPY $d0
  ; FP32:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $d0 = COPY [[COPY2]](s64)
  ; FP32:   RetRA implicit $d0
  ; FP64-LABEL: name: call_double_in_fpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $d12_64, $d14_64
  ; FP64:   [[COPY:%[0-9]+]]:_(s64) = COPY $d12_64
  ; FP64:   [[COPY1:%[0-9]+]]:_(s64) = COPY $d14_64
  ; FP64:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $d12_64 = COPY [[COPY]](s64)
  ; FP64:   $d14_64 = COPY [[COPY1]](s64)
  ; FP64:   JAL @double_in_fpr, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $d12_64, implicit $d14_64, implicit-def $d0_64
  ; FP64:   [[COPY2:%[0-9]+]]:_(s64) = COPY $d0_64
  ; FP64:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $d0_64 = COPY [[COPY2]](s64)
  ; FP64:   RetRA implicit $d0_64
entry:
  %call = call double @double_in_fpr(double %a, double %b)
  ret double %call
}

define float @call_float_in_gpr(i32 %a, float %b) {
  ; FP32-LABEL: name: call_float_in_gpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $a0, $a1
  ; FP32:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP32:   [[MTC1_:%[0-9]+]]:fgr32(s32) = MTC1 $a1
  ; FP32:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $a0 = COPY [[COPY]](s32)
  ; FP32:   $a1 = MFC1 [[MTC1_]](s32)
  ; FP32:   JAL @float_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $f0
  ; FP32:   [[COPY1:%[0-9]+]]:_(s32) = COPY $f0
  ; FP32:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $f0 = COPY [[COPY1]](s32)
  ; FP32:   RetRA implicit $f0
  ; FP64-LABEL: name: call_float_in_gpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $a0, $a1
  ; FP64:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP64:   [[MTC1_:%[0-9]+]]:fgr32(s32) = MTC1 $a1
  ; FP64:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $a0 = COPY [[COPY]](s32)
  ; FP64:   $a1 = MFC1 [[MTC1_]](s32)
  ; FP64:   JAL @float_in_gpr, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $f0
  ; FP64:   [[COPY1:%[0-9]+]]:_(s32) = COPY $f0
  ; FP64:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $f0 = COPY [[COPY1]](s32)
  ; FP64:   RetRA implicit $f0
entry:
  %call = call float @float_in_gpr(i32 %a, float %b)
  ret float %call
}


define double @call_double_in_gpr(i32 %a, double %b) {
  ; FP32-LABEL: name: call_double_in_gpr
  ; FP32: bb.1.entry:
  ; FP32:   liveins: $a0, $a2, $a3
  ; FP32:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP32:   [[BuildPairF64_:%[0-9]+]]:afgr64(s64) = BuildPairF64 $a2, $a3
  ; FP32:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $a0 = COPY [[COPY]](s32)
  ; FP32:   $a3 = ExtractElementF64 [[BuildPairF64_]](s64), 1
  ; FP32:   $a2 = ExtractElementF64 [[BuildPairF64_]](s64), 0
  ; FP32:   JAL @double_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $d0
  ; FP32:   [[COPY1:%[0-9]+]]:_(s64) = COPY $d0
  ; FP32:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP32:   $d0 = COPY [[COPY1]](s64)
  ; FP32:   RetRA implicit $d0
  ; FP64-LABEL: name: call_double_in_gpr
  ; FP64: bb.1.entry:
  ; FP64:   liveins: $a0, $a2, $a3
  ; FP64:   [[COPY:%[0-9]+]]:_(s32) = COPY $a0
  ; FP64:   [[BuildPairF64_64_:%[0-9]+]]:fgr64(s64) = BuildPairF64_64 $a2, $a3
  ; FP64:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $a0 = COPY [[COPY]](s32)
  ; FP64:   $a3 = ExtractElementF64_64 [[BuildPairF64_64_]](s64), 1
  ; FP64:   $a2 = ExtractElementF64_64 [[BuildPairF64_64_]](s64), 0
  ; FP64:   JAL @double_in_gpr, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $d0_64
  ; FP64:   [[COPY1:%[0-9]+]]:_(s64) = COPY $d0_64
  ; FP64:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
  ; FP64:   $d0_64 = COPY [[COPY1]](s64)
  ; FP64:   RetRA implicit $d0_64
entry:
  %call = call double @double_in_gpr(i32 %a, double %b)
  ret double %call
}