Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips4 -mattr=+soft-float -O1 \
      2 ; RUN:     -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
      3 ; RUN:     %s -check-prefixes=ALL,C_CC_FMT,PRER6,NOT-R2R6
      4 ; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips64 -mattr=+soft-float -O1 \
      5 ; RUN:     -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
      6 ; RUN:     %s -check-prefixes=ALL,C_CC_FMT,PRER6,NOT-R2R6
      7 ; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips64r2 -mattr=+soft-float \
      8 ; RUN:     -O1 -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
      9 ; RUN:     %s -check-prefixes=ALL,C_CC_FMT,PRER6,R2R6
     10 ; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips64r6 -mattr=+soft-float \
     11 ; RUN:     -O1 -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
     12 ; RUN:     %s -check-prefixes=ALL,CMP_CC_FMT,R6,R2R6
     13 
     14 @gld0 = external global fp128
     15 @gld1 = external global fp128
     16 @gld2 = external global fp128
     17 @gf1 = external global float
     18 @gd1 = external global double
     19 
     20 ; ALL-LABEL: addLD:
     21 ; ALL: ld $25, %call16(__addtf3)
     22 
     23 define fp128 @addLD() {
     24 entry:
     25   %0 = load fp128, fp128* @gld0, align 16
     26   %1 = load fp128, fp128* @gld1, align 16
     27   %add = fadd fp128 %0, %1
     28   ret fp128 %add
     29 }
     30 
     31 ; ALL-LABEL: subLD:
     32 ; ALL: ld $25, %call16(__subtf3)
     33 
     34 define fp128 @subLD() {
     35 entry:
     36   %0 = load fp128, fp128* @gld0, align 16
     37   %1 = load fp128, fp128* @gld1, align 16
     38   %sub = fsub fp128 %0, %1
     39   ret fp128 %sub
     40 }
     41 
     42 ; ALL-LABEL: mulLD:
     43 ; ALL: ld $25, %call16(__multf3)
     44 
     45 define fp128 @mulLD() {
     46 entry:
     47   %0 = load fp128, fp128* @gld0, align 16
     48   %1 = load fp128, fp128* @gld1, align 16
     49   %mul = fmul fp128 %0, %1
     50   ret fp128 %mul
     51 }
     52 
     53 ; ALL-LABEL: divLD:
     54 ; ALL: ld $25, %call16(__divtf3)
     55 
     56 define fp128 @divLD() {
     57 entry:
     58   %0 = load fp128, fp128* @gld0, align 16
     59   %1 = load fp128, fp128* @gld1, align 16
     60   %div = fdiv fp128 %0, %1
     61   ret fp128 %div
     62 }
     63 
     64 ; ALL-LABEL: conv_LD_char:
     65 ; ALL: ld $25, %call16(__floatsitf)
     66 
     67 define fp128 @conv_LD_char(i8 signext %a) {
     68 entry:
     69   %conv = sitofp i8 %a to fp128
     70   ret fp128 %conv
     71 }
     72 
     73 ; ALL-LABEL: conv_LD_short:
     74 ; ALL: ld $25, %call16(__floatsitf)
     75 
     76 define fp128 @conv_LD_short(i16 signext %a) {
     77 entry:
     78   %conv = sitofp i16 %a to fp128
     79   ret fp128 %conv
     80 }
     81 
     82 ; ALL-LABEL: conv_LD_int:
     83 ; ALL: ld $25, %call16(__floatsitf)
     84 
     85 define fp128 @conv_LD_int(i32 %a) {
     86 entry:
     87   %conv = sitofp i32 %a to fp128
     88   ret fp128 %conv
     89 }
     90 
     91 ; ALL-LABEL: conv_LD_LL:
     92 ; ALL: ld $25, %call16(__floatditf)
     93 
     94 define fp128 @conv_LD_LL(i64 %a) {
     95 entry:
     96   %conv = sitofp i64 %a to fp128
     97   ret fp128 %conv
     98 }
     99 
    100 ; ALL-LABEL: conv_LD_UChar:
    101 ; ALL: ld $25, %call16(__floatunsitf)
    102 
    103 define fp128 @conv_LD_UChar(i8 zeroext %a) {
    104 entry:
    105   %conv = uitofp i8 %a to fp128
    106   ret fp128 %conv
    107 }
    108 
    109 ; ALL-LABEL: conv_LD_UShort:
    110 ; ALL: ld $25, %call16(__floatunsitf)
    111 
    112 define fp128 @conv_LD_UShort(i16 zeroext %a) {
    113 entry:
    114   %conv = uitofp i16 %a to fp128
    115   ret fp128 %conv
    116 }
    117 
    118 ; ALL-LABEL: conv_LD_UInt:
    119 ; ALL: ld $25, %call16(__floatunsitf)
    120 
    121 define fp128 @conv_LD_UInt(i32 signext %a) {
    122 entry:
    123   %conv = uitofp i32 %a to fp128
    124   ret fp128 %conv
    125 }
    126 
    127 ; ALL-LABEL: conv_LD_ULL:
    128 ; ALL: ld $25, %call16(__floatunditf)
    129 
    130 define fp128 @conv_LD_ULL(i64 %a) {
    131 entry:
    132   %conv = uitofp i64 %a to fp128
    133   ret fp128 %conv
    134 }
    135 
    136 ; ALL-LABEL: conv_char_LD:
    137 ; ALL: ld $25, %call16(__fixtfsi)
    138 
    139 define signext i8 @conv_char_LD(fp128 %a) {
    140 entry:
    141   %conv = fptosi fp128 %a to i8
    142   ret i8 %conv
    143 }
    144 
    145 ; ALL-LABEL: conv_short_LD:
    146 ; ALL: ld $25, %call16(__fixtfsi)
    147 
    148 define signext i16 @conv_short_LD(fp128 %a) {
    149 entry:
    150   %conv = fptosi fp128 %a to i16
    151   ret i16 %conv
    152 }
    153 
    154 ; ALL-LABEL: conv_int_LD:
    155 ; ALL: ld $25, %call16(__fixtfsi)
    156 
    157 define i32 @conv_int_LD(fp128 %a) {
    158 entry:
    159   %conv = fptosi fp128 %a to i32
    160   ret i32 %conv
    161 }
    162 
    163 ; ALL-LABEL: conv_LL_LD:
    164 ; ALL: ld $25, %call16(__fixtfdi)
    165 
    166 define i64 @conv_LL_LD(fp128 %a) {
    167 entry:
    168   %conv = fptosi fp128 %a to i64
    169   ret i64 %conv
    170 }
    171 
    172 ; ALL-LABEL: conv_UChar_LD:
    173 ; ALL: ld $25, %call16(__fixtfsi)
    174 
    175 define zeroext i8 @conv_UChar_LD(fp128 %a) {
    176 entry:
    177   %conv = fptoui fp128 %a to i8
    178   ret i8 %conv
    179 }
    180 
    181 ; ALL-LABEL: conv_UShort_LD:
    182 ; ALL: ld $25, %call16(__fixtfsi)
    183 
    184 define zeroext i16 @conv_UShort_LD(fp128 %a) {
    185 entry:
    186   %conv = fptoui fp128 %a to i16
    187   ret i16 %conv
    188 }
    189 
    190 ; ALL-LABEL: conv_UInt_LD:
    191 ; ALL: ld $25, %call16(__fixunstfsi)
    192 
    193 define i32 @conv_UInt_LD(fp128 %a) {
    194 entry:
    195   %conv = fptoui fp128 %a to i32
    196   ret i32 %conv
    197 }
    198 
    199 ; ALL-LABEL: conv_ULL_LD:
    200 ; ALL: ld $25, %call16(__fixunstfdi)
    201 
    202 define i64 @conv_ULL_LD(fp128 %a) {
    203 entry:
    204   %conv = fptoui fp128 %a to i64
    205   ret i64 %conv
    206 }
    207 
    208 ; ALL-LABEL: conv_LD_float:
    209 ; ALL: ld $25, %call16(__extendsftf2)
    210 
    211 define fp128 @conv_LD_float(float %a) {
    212 entry:
    213   %conv = fpext float %a to fp128
    214   ret fp128 %conv
    215 }
    216 
    217 ; ALL-LABEL: conv_LD_double:
    218 ; ALL: ld $25, %call16(__extenddftf2)
    219 
    220 define fp128 @conv_LD_double(double %a) {
    221 entry:
    222   %conv = fpext double %a to fp128
    223   ret fp128 %conv
    224 }
    225 
    226 ; ALL-LABEL: conv_float_LD:
    227 ; ALL: ld $25, %call16(__trunctfsf2)
    228 
    229 define float @conv_float_LD(fp128 %a) {
    230 entry:
    231   %conv = fptrunc fp128 %a to float
    232   ret float %conv
    233 }
    234 
    235 ; ALL-LABEL: conv_double_LD:
    236 ; ALL: ld $25, %call16(__trunctfdf2)
    237 
    238 define double @conv_double_LD(fp128 %a) {
    239 entry:
    240   %conv = fptrunc fp128 %a to double
    241   ret double %conv
    242 }
    243 
    244 ; ALL-LABEL:             libcall1_fabsl:
    245 ; NOT-R2R6-DAG: ld      $[[R0:[0-9]+]], 8($[[R4:[0-9]+]])
    246 ; NOT-R2R6-DAG: daddiu  $[[R1:[0-9]+]], $zero, 1
    247 ; NOT-R2R6-DAG: dsll    $[[R2:[0-9]+]], $[[R1]], 63
    248 ; NOT-R2R6-DAG: daddiu  $[[R3:[0-9]+]], $[[R2]], -1
    249 ; NOT-R2R6-DAG: and     $4, $[[R0]], $[[R3]]
    250 ; NOT-R2R6-DAG: ld      $2, 0($[[R4]])
    251 
    252 ; R2R6-DAG: ld     $[[R0:[0-9]+]], 0($[[R3:[0-9]+]])
    253 ; R2R6-DAG: ld     $[[R1:[0-9]+]], 8($[[R3]])
    254 ; R2R6-DAG: dextm  $[[R2:[0-9]+]], $[[R1]], 0, 63
    255 
    256 define fp128 @libcall1_fabsl() {
    257 entry:
    258   %0 = load fp128, fp128* @gld0, align 16
    259   %call = tail call fp128 @fabsl(fp128 %0) nounwind readnone
    260   ret fp128 %call
    261 }
    262 
    263 declare fp128 @fabsl(fp128) #1
    264 
    265 ; ALL-LABEL: libcall1_ceill:
    266 ; ALL: ld $25, %call16(ceill)
    267 
    268 define fp128 @libcall1_ceill() {
    269 entry:
    270   %0 = load fp128, fp128* @gld0, align 16
    271   %call = tail call fp128 @ceill(fp128 %0) nounwind readnone
    272   ret fp128 %call
    273 }
    274 
    275 declare fp128 @ceill(fp128) #1
    276 
    277 ; ALL-LABEL: libcall1_sinl:
    278 ; ALL: ld $25, %call16(sinl)
    279 
    280 define fp128 @libcall1_sinl() {
    281 entry:
    282   %0 = load fp128, fp128* @gld0, align 16
    283   %call = tail call fp128 @sinl(fp128 %0) nounwind
    284   ret fp128 %call
    285 }
    286 
    287 declare fp128 @sinl(fp128) #2
    288 
    289 ; ALL-LABEL: libcall1_cosl:
    290 ; ALL: ld $25, %call16(cosl)
    291 
    292 define fp128 @libcall1_cosl() {
    293 entry:
    294   %0 = load fp128, fp128* @gld0, align 16
    295   %call = tail call fp128 @cosl(fp128 %0) nounwind
    296   ret fp128 %call
    297 }
    298 
    299 declare fp128 @cosl(fp128) #2
    300 
    301 ; ALL-LABEL: libcall1_expl:
    302 ; ALL: ld $25, %call16(expl)
    303 
    304 define fp128 @libcall1_expl() {
    305 entry:
    306   %0 = load fp128, fp128* @gld0, align 16
    307   %call = tail call fp128 @expl(fp128 %0) nounwind
    308   ret fp128 %call
    309 }
    310 
    311 declare fp128 @expl(fp128) #2
    312 
    313 ; ALL-LABEL: libcall1_exp2l:
    314 ; ALL: ld $25, %call16(exp2l)
    315 
    316 define fp128 @libcall1_exp2l() {
    317 entry:
    318   %0 = load fp128, fp128* @gld0, align 16
    319   %call = tail call fp128 @exp2l(fp128 %0) nounwind
    320   ret fp128 %call
    321 }
    322 
    323 declare fp128 @exp2l(fp128) #2
    324 
    325 ; ALL-LABEL: libcall1_logl:
    326 ; ALL: ld $25, %call16(logl)
    327 
    328 define fp128 @libcall1_logl() {
    329 entry:
    330   %0 = load fp128, fp128* @gld0, align 16
    331   %call = tail call fp128 @logl(fp128 %0) nounwind
    332   ret fp128 %call
    333 }
    334 
    335 declare fp128 @logl(fp128) #2
    336 
    337 ; ALL-LABEL: libcall1_log2l:
    338 ; ALL: ld $25, %call16(log2l)
    339 
    340 define fp128 @libcall1_log2l() {
    341 entry:
    342   %0 = load fp128, fp128* @gld0, align 16
    343   %call = tail call fp128 @log2l(fp128 %0) nounwind
    344   ret fp128 %call
    345 }
    346 
    347 declare fp128 @log2l(fp128) #2
    348 
    349 ; ALL-LABEL: libcall1_log10l:
    350 ; ALL: ld $25, %call16(log10l)
    351 
    352 define fp128 @libcall1_log10l() {
    353 entry:
    354   %0 = load fp128, fp128* @gld0, align 16
    355   %call = tail call fp128 @log10l(fp128 %0) nounwind
    356   ret fp128 %call
    357 }
    358 
    359 declare fp128 @log10l(fp128) #2
    360 
    361 ; ALL-LABEL: libcall1_nearbyintl:
    362 ; ALL: ld $25, %call16(nearbyintl)
    363 
    364 define fp128 @libcall1_nearbyintl() {
    365 entry:
    366   %0 = load fp128, fp128* @gld0, align 16
    367   %call = tail call fp128 @nearbyintl(fp128 %0) nounwind readnone
    368   ret fp128 %call
    369 }
    370 
    371 declare fp128 @nearbyintl(fp128) #1
    372 
    373 ; ALL-LABEL: libcall1_floorl:
    374 ; ALL: ld $25, %call16(floorl)
    375 
    376 define fp128 @libcall1_floorl() {
    377 entry:
    378   %0 = load fp128, fp128* @gld0, align 16
    379   %call = tail call fp128 @floorl(fp128 %0) nounwind readnone
    380   ret fp128 %call
    381 }
    382 
    383 declare fp128 @floorl(fp128) #1
    384 
    385 ; ALL-LABEL: libcall1_sqrtl:
    386 ; ALL: ld $25, %call16(sqrtl)
    387 
    388 define fp128 @libcall1_sqrtl() {
    389 entry:
    390   %0 = load fp128, fp128* @gld0, align 16
    391   %call = tail call fp128 @sqrtl(fp128 %0) nounwind
    392   ret fp128 %call
    393 }
    394 
    395 declare fp128 @sqrtl(fp128) #2
    396 
    397 ; ALL-LABEL: libcall1_rintl:
    398 ; ALL: ld $25, %call16(rintl)
    399 
    400 define fp128 @libcall1_rintl() {
    401 entry:
    402   %0 = load fp128, fp128* @gld0, align 16
    403   %call = tail call fp128 @rintl(fp128 %0) nounwind readnone
    404   ret fp128 %call
    405 }
    406 
    407 declare fp128 @rintl(fp128) #1
    408 
    409 ; ALL-LABEL: libcall_powil:
    410 ; ALL: ld $25, %call16(__powitf2)
    411 
    412 define fp128 @libcall_powil(fp128 %a, i32 %b) {
    413 entry:
    414   %0 = tail call fp128 @llvm.powi.f128(fp128 %a, i32 %b)
    415   ret fp128 %0
    416 }
    417 
    418 declare fp128 @llvm.powi.f128(fp128, i32) #3
    419 
    420 ; ALL-LABEL:     libcall2_copysignl:
    421 ; NOT-R2R6-DAG: daddiu $[[R2:[0-9]+]], $zero, 1
    422 ; NOT-R2R6-DAG: dsll   $[[R3:[0-9]+]], $[[R2]], 63
    423 ; ALL-DAG:      ld     $[[R0:[0-9]+]], %got_disp(gld1)
    424 ; ALL-DAG:      ld     $[[R1:[0-9]+]], 8($[[R0]])
    425 ; NOT-R2R6-DAG: and    $[[R4:[0-9]+]], $[[R1]], $[[R3]]
    426 ; ALL-DAG:      ld     $[[R5:[0-9]+]], %got_disp(gld0)
    427 ; ALL-DAG:      ld     $[[R6:[0-9]+]], 8($[[R5]])
    428 ; R2R6:         dinsu  $[[R0:[0-9]+]], $[[R1:[0-9]+]], 63, 1
    429 ; NOT-R2R6-DAG: daddiu $[[R7:[0-9]+]], $[[R3]], -1
    430 ; NOT-R2R6-DAG: and    $[[R8:[0-9]+]], $[[R6]], $[[R7]]
    431 ; NOT-R2R6-DAG: or     $4, $[[R8]], $[[R4]]
    432 ; ALL-DAG:      ld     $2, 0($[[R5]])
    433 
    434 define fp128 @libcall2_copysignl() {
    435 entry:
    436   %0 = load fp128, fp128* @gld0, align 16
    437   %1 = load fp128, fp128* @gld1, align 16
    438   %call = tail call fp128 @copysignl(fp128 %0, fp128 %1) nounwind readnone
    439   ret fp128 %call
    440 }
    441 
    442 declare fp128 @copysignl(fp128, fp128) #1
    443 
    444 ; ALL-LABEL: libcall2_powl:
    445 ; ALL: ld $25, %call16(powl)
    446 
    447 define fp128 @libcall2_powl() {
    448 entry:
    449   %0 = load fp128, fp128* @gld0, align 16
    450   %1 = load fp128, fp128* @gld1, align 16
    451   %call = tail call fp128 @powl(fp128 %0, fp128 %1) nounwind
    452   ret fp128 %call
    453 }
    454 
    455 declare fp128 @powl(fp128, fp128) #2
    456 
    457 ; ALL-LABEL: libcall2_fmodl:
    458 ; ALL: ld $25, %call16(fmodl)
    459 
    460 define fp128 @libcall2_fmodl() {
    461 entry:
    462   %0 = load fp128, fp128* @gld0, align 16
    463   %1 = load fp128, fp128* @gld1, align 16
    464   %call = tail call fp128 @fmodl(fp128 %0, fp128 %1) nounwind
    465   ret fp128 %call
    466 }
    467 
    468 declare fp128 @fmodl(fp128, fp128) #2
    469 
    470 ; ALL-LABEL: libcall3_fmal:
    471 ; ALL: ld $25, %call16(fmal)
    472 
    473 define fp128 @libcall3_fmal() {
    474 entry:
    475   %0 = load fp128, fp128* @gld0, align 16
    476   %1 = load fp128, fp128* @gld2, align 16
    477   %2 = load fp128, fp128* @gld1, align 16
    478   %3 = tail call fp128 @llvm.fma.f128(fp128 %0, fp128 %2, fp128 %1)
    479   ret fp128 %3
    480 }
    481 
    482 declare fp128 @llvm.fma.f128(fp128, fp128, fp128) #4
    483 
    484 ; ALL-LABEL: cmp_lt:
    485 ; ALL: ld $25, %call16(__lttf2)
    486 
    487 define i32 @cmp_lt(fp128 %a, fp128 %b) {
    488 entry:
    489   %cmp = fcmp olt fp128 %a, %b
    490   %conv = zext i1 %cmp to i32
    491   ret i32 %conv
    492 }
    493 
    494 ; ALL-LABEL: cmp_le:
    495 ; ALL: ld $25, %call16(__letf2)
    496 
    497 define i32 @cmp_le(fp128 %a, fp128 %b) {
    498 entry:
    499   %cmp = fcmp ole fp128 %a, %b
    500   %conv = zext i1 %cmp to i32
    501   ret i32 %conv
    502 }
    503 
    504 ; ALL-LABEL: cmp_gt:
    505 ; ALL: ld $25, %call16(__gttf2)
    506 
    507 define i32 @cmp_gt(fp128 %a, fp128 %b) {
    508 entry:
    509   %cmp = fcmp ogt fp128 %a, %b
    510   %conv = zext i1 %cmp to i32
    511   ret i32 %conv
    512 }
    513 
    514 ; ALL-LABEL: cmp_ge:
    515 ; ALL: ld $25, %call16(__getf2)
    516 
    517 define i32 @cmp_ge(fp128 %a, fp128 %b) {
    518 entry:
    519   %cmp = fcmp oge fp128 %a, %b
    520   %conv = zext i1 %cmp to i32
    521   ret i32 %conv
    522 }
    523 
    524 ; ALL-LABEL: cmp_eq:
    525 ; ALL: ld $25, %call16(__eqtf2)
    526 
    527 define i32 @cmp_eq(fp128 %a, fp128 %b) {
    528 entry:
    529   %cmp = fcmp oeq fp128 %a, %b
    530   %conv = zext i1 %cmp to i32
    531   ret i32 %conv
    532 }
    533 
    534 ; ALL-LABEL: cmp_ne:
    535 ; ALL: ld $25, %call16(__netf2)
    536 
    537 define i32 @cmp_ne(fp128 %a, fp128 %b) {
    538 entry:
    539   %cmp = fcmp une fp128 %a, %b
    540   %conv = zext i1 %cmp to i32
    541   ret i32 %conv
    542 }
    543 
    544 ; ALL-LABEL: load_LD_LD:
    545 ; ALL: ld $[[R0:[0-9]+]], %got_disp(gld1)
    546 ; ALL: ld $2, 0($[[R0]])
    547 ; ALL: ld $4, 8($[[R0]])
    548 
    549 define fp128 @load_LD_LD() {
    550 entry:
    551   %0 = load fp128, fp128* @gld1, align 16
    552   ret fp128 %0
    553 }
    554 
    555 ; ALL-LABEL: load_LD_float:
    556 ; ALL:   ld   $[[R0:[0-9]+]], %got_disp(gf1)
    557 ; ALL:   lw   $4, 0($[[R0]])
    558 ; ALL:   ld   $25, %call16(__extendsftf2)
    559 ; PRER6: jalr $25
    560 ; R6:    jalrc $25
    561 
    562 define fp128 @load_LD_float() {
    563 entry:
    564   %0 = load float, float* @gf1, align 4
    565   %conv = fpext float %0 to fp128
    566   ret fp128 %conv
    567 }
    568 
    569 ; ALL-LABEL: load_LD_double:
    570 ; ALL:   ld   $[[R0:[0-9]+]], %got_disp(gd1)
    571 ; ALL:   ld   $4, 0($[[R0]])
    572 ; ALL:   ld   $25, %call16(__extenddftf2)
    573 ; PRER6: jalr $25
    574 ; R6:    jalrc $25
    575 
    576 define fp128 @load_LD_double() {
    577 entry:
    578   %0 = load double, double* @gd1, align 8
    579   %conv = fpext double %0 to fp128
    580   ret fp128 %conv
    581 }
    582 
    583 ; ALL-LABEL: store_LD_LD:
    584 ; ALL: ld $[[R0:[0-9]+]], %got_disp(gld1)
    585 ; ALL: ld $[[R2:[0-9]+]], 8($[[R0]])
    586 ; ALL: ld $[[R3:[0-9]+]], %got_disp(gld0)
    587 ; ALL: sd $[[R2]], 8($[[R3]])
    588 ; ALL: ld $[[R1:[0-9]+]], 0($[[R0]])
    589 ; ALL: sd $[[R1]], 0($[[R3]])
    590 
    591 define void @store_LD_LD() {
    592 entry:
    593   %0 = load fp128, fp128* @gld1, align 16
    594   store fp128 %0, fp128* @gld0, align 16
    595   ret void
    596 }
    597 
    598 ; ALL-LABEL: store_LD_float:
    599 ; ALL:   ld   $[[R0:[0-9]+]], %got_disp(gld1)
    600 ; ALL:   ld   $4, 0($[[R0]])
    601 ; ALL:   ld   $5, 8($[[R0]])
    602 ; ALL:   ld   $25, %call16(__trunctfsf2)
    603 ; PRER6: jalr $25
    604 ; R6:    jalrc $25
    605 ; ALL:   ld   $[[R1:[0-9]+]], %got_disp(gf1)
    606 ; ALL:   sw   $2, 0($[[R1]])
    607 
    608 define void @store_LD_float() {
    609 entry:
    610   %0 = load fp128, fp128* @gld1, align 16
    611   %conv = fptrunc fp128 %0 to float
    612   store float %conv, float* @gf1, align 4
    613   ret void
    614 }
    615 
    616 ; ALL-LABEL: store_LD_double:
    617 ; ALL:   ld   $[[R0:[0-9]+]], %got_disp(gld1)
    618 ; ALL:   ld   $4, 0($[[R0]])
    619 ; ALL:   ld   $5, 8($[[R0]])
    620 ; ALL:   ld   $25, %call16(__trunctfdf2)
    621 ; PRER6: jalr $25
    622 ; R6:    jalrc $25
    623 ; ALL:   ld   $[[R1:[0-9]+]], %got_disp(gd1)
    624 ; ALL:   sd   $2, 0($[[R1]])
    625 
    626 define void @store_LD_double() {
    627 entry:
    628   %0 = load fp128, fp128* @gld1, align 16
    629   %conv = fptrunc fp128 %0 to double
    630   store double %conv, double* @gd1, align 8
    631   ret void
    632 }
    633 
    634 ; ALL-LABEL: select_LD:
    635 ; C_CC_FMT:      movn $8, $6, $4
    636 ; C_CC_FMT:      movn $9, $7, $4
    637 ; C_CC_FMT:      move $2, $8
    638 ; C_CC_FMT:      move $4, $9
    639 
    640 ; FIXME: This sll works around an implementation detail in the code generator
    641 ;        (setcc's result is i32 so bits 32-63 are undefined). It's not really
    642 ;        needed.
    643 ; CMP_CC_FMT-DAG: sll $[[CC:[0-9]+]], $4, 0
    644 ; CMP_CC_FMT-DAG: seleqz $[[EQ1:[0-9]+]], $8, $[[CC]]
    645 ; CMP_CC_FMT-DAG: selnez $[[NE1:[0-9]+]], $6, $[[CC]]
    646 ; CMP_CC_FMT-DAG: or $2, $[[NE1]], $[[EQ1]]
    647 ; CMP_CC_FMT-DAG: seleqz $[[EQ2:[0-9]+]], $9, $[[CC]]
    648 ; CMP_CC_FMT-DAG: selnez $[[NE2:[0-9]+]], $7, $[[CC]]
    649 ; CMP_CC_FMT-DAG: or $4, $[[NE2]], $[[EQ2]]
    650 
    651 define fp128 @select_LD(i32 signext %a, i64, fp128 %b, fp128 %c) {
    652 entry:
    653   %tobool = icmp ne i32 %a, 0
    654   %cond = select i1 %tobool, fp128 %b, fp128 %c
    655   ret fp128 %cond
    656 }
    657 
    658 ; ALL-LABEL: selectCC_LD:
    659 ; ALL:           move $[[R0:[0-9]+]], $11
    660 ; ALL:           move $[[R1:[0-9]+]], $10
    661 ; ALL:           move $[[R2:[0-9]+]], $9
    662 ; ALL:           move $[[R3:[0-9]+]], $8
    663 ; ALL:           ld   $25, %call16(__gttf2)($gp)
    664 ; PRER6:         jalr $25
    665 ; R6:            jalrc $25
    666 
    667 ; C_CC_FMT:      slti $[[CC:[0-9]+]], $2, 1
    668 ; C_CC_FMT:      movz $[[R1]], $[[R3]], $[[CC]]
    669 ; C_CC_FMT:      movz $[[R0]], $[[R2]], $[[CC]]
    670 ; C_CC_FMT:      move $2, $[[R1]]
    671 ; C_CC_FMT:      move $4, $[[R0]]
    672 
    673 ; CMP_CC_FMT:    slt $[[CC:[0-9]+]], $zero, $2
    674 ; CMP_CC_FMT:    seleqz $[[EQ1:[0-9]+]], $[[R1]], $[[CC]]
    675 ; CMP_CC_FMT:    selnez $[[NE1:[0-9]+]], $[[R3]], $[[CC]]
    676 ; CMP_CC_FMT:    or $2, $[[NE1]], $[[EQ1]]
    677 ; CMP_CC_FMT:    seleqz $[[EQ2:[0-9]+]], $[[R0]], $[[CC]]
    678 ; CMP_CC_FMT:    selnez $[[NE2:[0-9]+]], $[[R2]], $[[CC]]
    679 ; CMP_CC_FMT:    or $4, $[[NE2]], $[[EQ2]]
    680 
    681 define fp128 @selectCC_LD(fp128 %a, fp128 %b, fp128 %c, fp128 %d) {
    682 entry:
    683   %cmp = fcmp ogt fp128 %a, %b
    684   %cond = select i1 %cmp, fp128 %c, fp128 %d
    685   ret fp128 %cond
    686 }
    687