diff --git a/llvm/lib/Target/Mips/MipsCallingConv.td b/llvm/lib/Target/Mips/MipsCallingConv.td index 866161bf50638..25384a3fe8de3 100644 --- a/llvm/lib/Target/Mips/MipsCallingConv.td +++ b/llvm/lib/Target/Mips/MipsCallingConv.td @@ -20,8 +20,8 @@ class CCIfSubtargetNot : CCIfSubtarget; /// Match if the original argument (before lowering) was a float. /// For example, this is true for i32's that were lowered from soft-float. -class CCIfOrigArgWasNotFloat - : CCIf<"!static_cast(&State)->WasOriginalArgFloat(ValNo)", +class CCIfOrigArgWasFloat + : CCIf<"static_cast(&State)->WasOriginalArgFloat(ValNo)", A>; /// Match if the original argument (before lowering) was a 128-bit float (i.e. @@ -134,12 +134,13 @@ def CC_MipsN : CallingConv<[ CCIfSubtargetNot<"isLittle()", CCIfInReg>>>, - // All integers (except soft-float integers) are promoted to 64-bit. - CCIfType<[i8, i16, i32], CCIfOrigArgWasNotFloat>>, + // First deal with f32s that got turned into i32s due to soft-float + CCIfType<[i32], + CCIfSubtarget<"useSoftFloat()", + CCIfOrigArgWasFloat>>>, - // The only i32's we have left are soft-float arguments. - CCIfSubtarget<"useSoftFloat()", CCIfType<[i32], - CCDelegateTo>>, + // All remaining integers are promoted to 64-bit. + CCIfType<[i8, i16, i32], CCPromoteToType>, // Integer arguments are passed in integer registers. CCIfType<[i64], CCAssignToRegWithShadow<[A0_64, A1_64, A2_64, A3_64, diff --git a/llvm/test/CodeGen/Mips/fp16-promote.ll b/llvm/test/CodeGen/Mips/fp16-promote.ll index c104ffb3c72eb..47bace9f5c03f 100644 --- a/llvm/test/CodeGen/Mips/fp16-promote.ll +++ b/llvm/test/CodeGen/Mips/fp16-promote.ll @@ -1,28 +1,51 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 -; RUN: llc -mtriple=mipsel-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-LIBCALL +; RUN: llc -mtriple=mipsel-linux-gnu < %s | FileCheck %s -check-prefix=MIPS32 +; RUN: llc -mtriple=mips64el-linux-gnu < %s | FileCheck %s -check-prefix=MIPS64 define void @test_fadd(ptr %p, ptr %q) nounwind { -; CHECK-LIBCALL-LABEL: test_fadd: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -32 -; CHECK-LIBCALL-NEXT: sdc1 $f20, 24($sp) # 8-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 16($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: move $16, $4 -; CHECK-LIBCALL-NEXT: lhu $4, 0($5) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: nop -; CHECK-LIBCALL-NEXT: lhu $4, 0($16) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: mov.s $f20, $f0 -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: add.s $f12, $f0, $f20 -; CHECK-LIBCALL-NEXT: sh $2, 0($16) -; CHECK-LIBCALL-NEXT: lw $16, 16($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: ldc1 $f20, 24($sp) # 8-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 32 +; MIPS32-LABEL: test_fadd: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -32 +; MIPS32-NEXT: sdc1 $f20, 24($sp) # 8-byte Folded Spill +; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 16($sp) # 4-byte Folded Spill +; MIPS32-NEXT: move $16, $4 +; MIPS32-NEXT: lhu $4, 0($5) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: nop +; MIPS32-NEXT: lhu $4, 0($16) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: mov.s $f20, $f0 +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: add.s $f12, $f0, $f20 +; MIPS32-NEXT: sh $2, 0($16) +; MIPS32-NEXT: lw $16, 16($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: ldc1 $f20, 24($sp) # 8-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 32 +; +; MIPS64-LABEL: test_fadd: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -32 +; MIPS64-NEXT: sdc1 $f24, 24($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $ra, 16($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: move $16, $4 +; MIPS64-NEXT: lhu $4, 0($5) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: nop +; MIPS64-NEXT: lhu $4, 0($16) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: mov.s $f24, $f0 +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: add.s $f12, $f0, $f24 +; MIPS64-NEXT: sh $2, 0($16) +; MIPS64-NEXT: ld $16, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 16($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ldc1 $f24, 24($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 32 %a = load half, ptr %p, align 2 %b = load half, ptr %q, align 2 %r = fadd half %a, %b @@ -31,282 +54,515 @@ define void @test_fadd(ptr %p, ptr %q) nounwind { } define float @test_fpext_float(ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_fpext_float: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -24 -; CHECK-LIBCALL-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: lhu $4, 0($4) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: nop -; CHECK-LIBCALL-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 24 +; MIPS32-LABEL: test_fpext_float: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -24 +; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: lhu $4, 0($4) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: nop +; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 24 +; +; MIPS64-LABEL: test_fpext_float: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -16 +; MIPS64-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: lhu $4, 0($4) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: nop +; MIPS64-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 16 %a = load half, ptr %p, align 2 %r = fpext half %a to float ret float %r } define double @test_fpext_double(ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_fpext_double: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -24 -; CHECK-LIBCALL-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: lhu $4, 0($4) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: nop -; CHECK-LIBCALL-NEXT: cvt.d.s $f0, $f0 -; CHECK-LIBCALL-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 24 +; MIPS32-LABEL: test_fpext_double: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -24 +; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: lhu $4, 0($4) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: nop +; MIPS32-NEXT: cvt.d.s $f0, $f0 +; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 24 +; +; MIPS64-LABEL: test_fpext_double: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -16 +; MIPS64-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: lhu $4, 0($4) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: nop +; MIPS64-NEXT: cvt.d.s $f0, $f0 +; MIPS64-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 16 %a = load half, ptr %p, align 2 %r = fpext half %a to double ret double %r } define void @test_fptrunc_float(float %f, ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_fptrunc_float: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -24 -; CHECK-LIBCALL-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 16($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: move $16, $5 -; CHECK-LIBCALL-NEXT: sh $2, 0($16) -; CHECK-LIBCALL-NEXT: lw $16, 16($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 24 +; MIPS32-LABEL: test_fptrunc_float: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -24 +; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 16($sp) # 4-byte Folded Spill +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: move $16, $5 +; MIPS32-NEXT: sh $2, 0($16) +; MIPS32-NEXT: lw $16, 16($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 24 +; +; MIPS64-LABEL: test_fptrunc_float: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -16 +; MIPS64-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 0($sp) # 8-byte Folded Spill +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: move $16, $5 +; MIPS64-NEXT: sh $2, 0($16) +; MIPS64-NEXT: ld $16, 0($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 16 %a = fptrunc float %f to half store half %a, ptr %p ret void } define void @test_fptrunc_double(double %d, ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_fptrunc_double: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -24 -; CHECK-LIBCALL-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 16($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: jal __truncdfhf2 -; CHECK-LIBCALL-NEXT: move $16, $6 -; CHECK-LIBCALL-NEXT: sh $2, 0($16) -; CHECK-LIBCALL-NEXT: lw $16, 16($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 24 +; MIPS32-LABEL: test_fptrunc_double: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -24 +; MIPS32-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 16($sp) # 4-byte Folded Spill +; MIPS32-NEXT: jal __truncdfhf2 +; MIPS32-NEXT: move $16, $6 +; MIPS32-NEXT: sh $2, 0($16) +; MIPS32-NEXT: lw $16, 16($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 24 +; +; MIPS64-LABEL: test_fptrunc_double: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -16 +; MIPS64-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 0($sp) # 8-byte Folded Spill +; MIPS64-NEXT: jal __truncdfhf2 +; MIPS64-NEXT: move $16, $5 +; MIPS64-NEXT: sh $2, 0($16) +; MIPS64-NEXT: ld $16, 0($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 16 %a = fptrunc double %d to half store half %a, ptr %p ret void } define <4 x float> @test_vec_fpext_float(ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_vec_fpext_float: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -32 -; CHECK-LIBCALL-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $17, 24($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: move $17, $4 -; CHECK-LIBCALL-NEXT: lhu $4, 6($5) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: move $16, $5 -; CHECK-LIBCALL-NEXT: lhu $4, 4($16) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: swc1 $f0, 12($17) -; CHECK-LIBCALL-NEXT: swc1 $f0, 8($17) -; CHECK-LIBCALL-NEXT: lhu $4, 2($16) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: nop -; CHECK-LIBCALL-NEXT: swc1 $f0, 4($17) -; CHECK-LIBCALL-NEXT: lhu $4, 0($16) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: nop -; CHECK-LIBCALL-NEXT: swc1 $f0, 0($17) -; CHECK-LIBCALL-NEXT: lw $16, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $17, 24($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 32 +; MIPS32-LABEL: test_vec_fpext_float: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -32 +; MIPS32-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $17, 24($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: move $17, $4 +; MIPS32-NEXT: lhu $4, 6($5) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: move $16, $5 +; MIPS32-NEXT: lhu $4, 4($16) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: swc1 $f0, 12($17) +; MIPS32-NEXT: swc1 $f0, 8($17) +; MIPS32-NEXT: lhu $4, 2($16) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: nop +; MIPS32-NEXT: swc1 $f0, 4($17) +; MIPS32-NEXT: lhu $4, 0($16) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: nop +; MIPS32-NEXT: swc1 $f0, 0($17) +; MIPS32-NEXT: lw $16, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $17, 24($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 32 +; +; MIPS64-LABEL: test_vec_fpext_float: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -32 +; MIPS64-NEXT: sd $ra, 24($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $18, 16($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $17, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 0($sp) # 8-byte Folded Spill +; MIPS64-NEXT: move $16, $4 +; MIPS64-NEXT: lhu $4, 2($4) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: nop +; MIPS64-NEXT: lhu $4, 6($16) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: mfc1 $17, $f0 +; MIPS64-NEXT: mfc1 $18, $f0 +; MIPS64-NEXT: lhu $4, 0($16) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: dsll $17, $17, 32 +; MIPS64-NEXT: mfc1 $1, $f0 +; MIPS64-NEXT: dsll $1, $1, 32 +; MIPS64-NEXT: dsrl $1, $1, 32 +; MIPS64-NEXT: or $17, $1, $17 +; MIPS64-NEXT: lhu $4, 4($16) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: dsll $18, $18, 32 +; MIPS64-NEXT: mfc1 $1, $f0 +; MIPS64-NEXT: dsll $1, $1, 32 +; MIPS64-NEXT: dsrl $1, $1, 32 +; MIPS64-NEXT: or $3, $1, $18 +; MIPS64-NEXT: move $2, $17 +; MIPS64-NEXT: ld $16, 0($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $17, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $18, 16($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 24($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 32 %a = load <4 x half>, ptr %p, align 8 %b = fpext <4 x half> %a to <4 x float> ret <4 x float> %b } define <4 x double> @test_vec_fpext_double(ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_vec_fpext_double: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -40 -; CHECK-LIBCALL-NEXT: sdc1 $f20, 32($sp) # 8-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $17, 24($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: move $17, $4 -; CHECK-LIBCALL-NEXT: lhu $4, 6($5) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: move $16, $5 -; CHECK-LIBCALL-NEXT: lhu $4, 4($16) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: mov.s $f20, $f0 -; CHECK-LIBCALL-NEXT: lhu $4, 2($16) -; CHECK-LIBCALL-NEXT: cvt.d.s $f0, $f0 -; CHECK-LIBCALL-NEXT: cvt.d.s $f2, $f20 -; CHECK-LIBCALL-NEXT: sdc1 $f2, 24($17) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: sdc1 $f0, 16($17) -; CHECK-LIBCALL-NEXT: cvt.d.s $f0, $f0 -; CHECK-LIBCALL-NEXT: sdc1 $f0, 8($17) -; CHECK-LIBCALL-NEXT: lhu $4, 0($16) -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: nop -; CHECK-LIBCALL-NEXT: cvt.d.s $f0, $f0 -; CHECK-LIBCALL-NEXT: sdc1 $f0, 0($17) -; CHECK-LIBCALL-NEXT: lw $16, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $17, 24($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: ldc1 $f20, 32($sp) # 8-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 40 +; MIPS32-LABEL: test_vec_fpext_double: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -40 +; MIPS32-NEXT: sdc1 $f20, 32($sp) # 8-byte Folded Spill +; MIPS32-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $17, 24($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: move $17, $4 +; MIPS32-NEXT: lhu $4, 6($5) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: move $16, $5 +; MIPS32-NEXT: lhu $4, 4($16) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: mov.s $f20, $f0 +; MIPS32-NEXT: lhu $4, 2($16) +; MIPS32-NEXT: cvt.d.s $f0, $f0 +; MIPS32-NEXT: cvt.d.s $f2, $f20 +; MIPS32-NEXT: sdc1 $f2, 24($17) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: sdc1 $f0, 16($17) +; MIPS32-NEXT: cvt.d.s $f0, $f0 +; MIPS32-NEXT: sdc1 $f0, 8($17) +; MIPS32-NEXT: lhu $4, 0($16) +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: nop +; MIPS32-NEXT: cvt.d.s $f0, $f0 +; MIPS32-NEXT: sdc1 $f0, 0($17) +; MIPS32-NEXT: lw $16, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $17, 24($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload +; MIPS32-NEXT: ldc1 $f20, 32($sp) # 8-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 40 +; +; MIPS64-LABEL: test_vec_fpext_double: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -32 +; MIPS64-NEXT: sdc1 $f24, 24($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $ra, 16($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $17, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 0($sp) # 8-byte Folded Spill +; MIPS64-NEXT: move $17, $4 +; MIPS64-NEXT: lhu $4, 6($5) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: move $16, $5 +; MIPS64-NEXT: lhu $4, 4($16) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: mov.s $f24, $f0 +; MIPS64-NEXT: lhu $4, 2($16) +; MIPS64-NEXT: cvt.d.s $f0, $f0 +; MIPS64-NEXT: cvt.d.s $f1, $f24 +; MIPS64-NEXT: sdc1 $f1, 24($17) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: sdc1 $f0, 16($17) +; MIPS64-NEXT: cvt.d.s $f0, $f0 +; MIPS64-NEXT: sdc1 $f0, 8($17) +; MIPS64-NEXT: lhu $4, 0($16) +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: nop +; MIPS64-NEXT: cvt.d.s $f0, $f0 +; MIPS64-NEXT: sdc1 $f0, 0($17) +; MIPS64-NEXT: ld $16, 0($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $17, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 16($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ldc1 $f24, 24($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 32 %a = load <4 x half>, ptr %p, align 8 %b = fpext <4 x half> %a to <4 x double> ret <4 x double> %b } define void @test_vec_fptrunc_float(<4 x float> %a, ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_vec_fptrunc_float: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -40 -; CHECK-LIBCALL-NEXT: sw $ra, 36($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $19, 32($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $18, 28($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $17, 24($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: move $16, $7 -; CHECK-LIBCALL-NEXT: move $17, $5 -; CHECK-LIBCALL-NEXT: move $18, $4 -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: mtc1 $6, $f12 -; CHECK-LIBCALL-NEXT: move $19, $2 -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: mtc1 $16, $f12 -; CHECK-LIBCALL-NEXT: mtc1 $17, $f12 -; CHECK-LIBCALL-NEXT: lw $16, 56($sp) -; CHECK-LIBCALL-NEXT: sh $2, 6($16) -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: sh $19, 4($16) -; CHECK-LIBCALL-NEXT: sh $2, 2($16) -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: mtc1 $18, $f12 -; CHECK-LIBCALL-NEXT: sh $2, 0($16) -; CHECK-LIBCALL-NEXT: lw $16, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $17, 24($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $18, 28($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $19, 32($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 36($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 40 +; MIPS32-LABEL: test_vec_fptrunc_float: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -40 +; MIPS32-NEXT: sw $ra, 36($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $19, 32($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $18, 28($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $17, 24($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: move $16, $7 +; MIPS32-NEXT: move $17, $5 +; MIPS32-NEXT: move $18, $4 +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: mtc1 $6, $f12 +; MIPS32-NEXT: move $19, $2 +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: mtc1 $16, $f12 +; MIPS32-NEXT: mtc1 $17, $f12 +; MIPS32-NEXT: lw $16, 56($sp) +; MIPS32-NEXT: sh $2, 6($16) +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: sh $19, 4($16) +; MIPS32-NEXT: sh $2, 2($16) +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: mtc1 $18, $f12 +; MIPS32-NEXT: sh $2, 0($16) +; MIPS32-NEXT: lw $16, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $17, 24($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $18, 28($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $19, 32($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 36($sp) # 4-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 40 +; +; MIPS64-LABEL: test_vec_fptrunc_float: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -48 +; MIPS64-NEXT: sd $ra, 40($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $19, 32($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $18, 24($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $17, 16($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: move $16, $6 +; MIPS64-NEXT: move $17, $5 +; MIPS64-NEXT: move $18, $4 +; MIPS64-NEXT: sll $1, $18, 0 +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: mtc1 $1, $f12 +; MIPS64-NEXT: move $19, $2 +; MIPS64-NEXT: sll $1, $17, 0 +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: mtc1 $1, $f12 +; MIPS64-NEXT: dsrl $1, $17, 32 +; MIPS64-NEXT: sll $1, $1, 0 +; MIPS64-NEXT: mtc1 $1, $f12 +; MIPS64-NEXT: sh $2, 4($16) +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: sh $19, 0($16) +; MIPS64-NEXT: sh $2, 6($16) +; MIPS64-NEXT: dsrl $1, $18, 32 +; MIPS64-NEXT: sll $1, $1, 0 +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: mtc1 $1, $f12 +; MIPS64-NEXT: sh $2, 2($16) +; MIPS64-NEXT: ld $16, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $17, 16($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $18, 24($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $19, 32($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 40($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 48 %b = fptrunc <4 x float> %a to <4 x half> store <4 x half> %b, ptr %p, align 8 ret void } define void @test_vec_fptrunc_double(<4 x double> %a, ptr %p) nounwind { -; CHECK-LIBCALL-LABEL: test_vec_fptrunc_double: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -72 -; CHECK-LIBCALL-NEXT: sw $ra, 68($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $19, 64($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $18, 60($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $17, 56($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 52($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: move $16, $5 -; CHECK-LIBCALL-NEXT: move $17, $4 -; CHECK-LIBCALL-NEXT: lw $1, 92($sp) -; CHECK-LIBCALL-NEXT: sw $1, 36($sp) -; CHECK-LIBCALL-NEXT: lw $1, 88($sp) -; CHECK-LIBCALL-NEXT: sw $1, 32($sp) -; CHECK-LIBCALL-NEXT: lw $1, 96($sp) -; CHECK-LIBCALL-NEXT: lw $2, 100($sp) -; CHECK-LIBCALL-NEXT: sw $2, 44($sp) -; CHECK-LIBCALL-NEXT: sw $1, 40($sp) -; CHECK-LIBCALL-NEXT: ldc1 $f12, 32($sp) -; CHECK-LIBCALL-NEXT: sw $7, 28($sp) -; CHECK-LIBCALL-NEXT: jal __truncdfhf2 -; CHECK-LIBCALL-NEXT: sw $6, 24($sp) -; CHECK-LIBCALL-NEXT: move $18, $2 -; CHECK-LIBCALL-NEXT: jal __truncdfhf2 -; CHECK-LIBCALL-NEXT: ldc1 $f12, 40($sp) -; CHECK-LIBCALL-NEXT: ldc1 $f12, 24($sp) -; CHECK-LIBCALL-NEXT: lw $19, 104($sp) -; CHECK-LIBCALL-NEXT: sh $2, 6($19) -; CHECK-LIBCALL-NEXT: jal __truncdfhf2 -; CHECK-LIBCALL-NEXT: sh $18, 4($19) -; CHECK-LIBCALL-NEXT: sh $2, 2($19) -; CHECK-LIBCALL-NEXT: sw $16, 20($sp) -; CHECK-LIBCALL-NEXT: sw $17, 16($sp) -; CHECK-LIBCALL-NEXT: jal __truncdfhf2 -; CHECK-LIBCALL-NEXT: ldc1 $f12, 16($sp) -; CHECK-LIBCALL-NEXT: sh $2, 0($19) -; CHECK-LIBCALL-NEXT: lw $16, 52($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $17, 56($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $18, 60($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $19, 64($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 68($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 72 +; MIPS32-LABEL: test_vec_fptrunc_double: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -72 +; MIPS32-NEXT: sw $ra, 68($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $19, 64($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $18, 60($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $17, 56($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 52($sp) # 4-byte Folded Spill +; MIPS32-NEXT: move $16, $5 +; MIPS32-NEXT: move $17, $4 +; MIPS32-NEXT: lw $1, 92($sp) +; MIPS32-NEXT: sw $1, 36($sp) +; MIPS32-NEXT: lw $1, 88($sp) +; MIPS32-NEXT: sw $1, 32($sp) +; MIPS32-NEXT: lw $1, 96($sp) +; MIPS32-NEXT: lw $2, 100($sp) +; MIPS32-NEXT: sw $2, 44($sp) +; MIPS32-NEXT: sw $1, 40($sp) +; MIPS32-NEXT: ldc1 $f12, 32($sp) +; MIPS32-NEXT: sw $7, 28($sp) +; MIPS32-NEXT: jal __truncdfhf2 +; MIPS32-NEXT: sw $6, 24($sp) +; MIPS32-NEXT: move $18, $2 +; MIPS32-NEXT: jal __truncdfhf2 +; MIPS32-NEXT: ldc1 $f12, 40($sp) +; MIPS32-NEXT: ldc1 $f12, 24($sp) +; MIPS32-NEXT: lw $19, 104($sp) +; MIPS32-NEXT: sh $2, 6($19) +; MIPS32-NEXT: jal __truncdfhf2 +; MIPS32-NEXT: sh $18, 4($19) +; MIPS32-NEXT: sh $2, 2($19) +; MIPS32-NEXT: sw $16, 20($sp) +; MIPS32-NEXT: sw $17, 16($sp) +; MIPS32-NEXT: jal __truncdfhf2 +; MIPS32-NEXT: ldc1 $f12, 16($sp) +; MIPS32-NEXT: sh $2, 0($19) +; MIPS32-NEXT: lw $16, 52($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $17, 56($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $18, 60($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $19, 64($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 68($sp) # 4-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 72 +; +; MIPS64-LABEL: test_vec_fptrunc_double: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -48 +; MIPS64-NEXT: sd $ra, 40($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $20, 32($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $19, 24($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $18, 16($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $17, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 0($sp) # 8-byte Folded Spill +; MIPS64-NEXT: move $16, $8 +; MIPS64-NEXT: move $17, $7 +; MIPS64-NEXT: move $18, $5 +; MIPS64-NEXT: move $19, $4 +; MIPS64-NEXT: jal __truncdfhf2 +; MIPS64-NEXT: dmtc1 $6, $f12 +; MIPS64-NEXT: move $20, $2 +; MIPS64-NEXT: jal __truncdfhf2 +; MIPS64-NEXT: dmtc1 $17, $f12 +; MIPS64-NEXT: dmtc1 $18, $f12 +; MIPS64-NEXT: sh $2, 6($16) +; MIPS64-NEXT: jal __truncdfhf2 +; MIPS64-NEXT: sh $20, 4($16) +; MIPS64-NEXT: sh $2, 2($16) +; MIPS64-NEXT: jal __truncdfhf2 +; MIPS64-NEXT: dmtc1 $19, $f12 +; MIPS64-NEXT: sh $2, 0($16) +; MIPS64-NEXT: ld $16, 0($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $17, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $18, 16($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $19, 24($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $20, 32($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 40($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 48 %b = fptrunc <4 x double> %a to <4 x half> store <4 x half> %b, ptr %p, align 8 ret void } define half @test_fadd_fadd(half %a, half %b, half %c) nounwind { -; CHECK-LIBCALL-LABEL: test_fadd_fadd: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, -40 -; CHECK-LIBCALL-NEXT: sdc1 $f20, 32($sp) # 8-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $17, 24($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: sw $16, 20($sp) # 4-byte Folded Spill -; CHECK-LIBCALL-NEXT: move $16, $6 -; CHECK-LIBCALL-NEXT: move $17, $4 -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: move $4, $5 -; CHECK-LIBCALL-NEXT: mov.s $f20, $f0 -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: move $4, $17 -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: add.s $f12, $f0, $f20 -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: move $4, $2 -; CHECK-LIBCALL-NEXT: mov.s $f20, $f0 -; CHECK-LIBCALL-NEXT: jal __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: move $4, $16 -; CHECK-LIBCALL-NEXT: jal __gnu_f2h_ieee -; CHECK-LIBCALL-NEXT: add.s $f12, $f20, $f0 -; CHECK-LIBCALL-NEXT: lw $16, 20($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $17, 24($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload -; CHECK-LIBCALL-NEXT: ldc1 $f20, 32($sp) # 8-byte Folded Reload -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: addiu $sp, $sp, 40 +; MIPS32-LABEL: test_fadd_fadd: +; MIPS32: # %bb.0: +; MIPS32-NEXT: addiu $sp, $sp, -40 +; MIPS32-NEXT: sdc1 $f20, 32($sp) # 8-byte Folded Spill +; MIPS32-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $17, 24($sp) # 4-byte Folded Spill +; MIPS32-NEXT: sw $16, 20($sp) # 4-byte Folded Spill +; MIPS32-NEXT: move $16, $6 +; MIPS32-NEXT: move $17, $4 +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: move $4, $5 +; MIPS32-NEXT: mov.s $f20, $f0 +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: move $4, $17 +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: add.s $f12, $f0, $f20 +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: move $4, $2 +; MIPS32-NEXT: mov.s $f20, $f0 +; MIPS32-NEXT: jal __gnu_h2f_ieee +; MIPS32-NEXT: move $4, $16 +; MIPS32-NEXT: jal __gnu_f2h_ieee +; MIPS32-NEXT: add.s $f12, $f20, $f0 +; MIPS32-NEXT: lw $16, 20($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $17, 24($sp) # 4-byte Folded Reload +; MIPS32-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload +; MIPS32-NEXT: ldc1 $f20, 32($sp) # 8-byte Folded Reload +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: addiu $sp, $sp, 40 +; +; MIPS64-LABEL: test_fadd_fadd: +; MIPS64: # %bb.0: +; MIPS64-NEXT: daddiu $sp, $sp, -32 +; MIPS64-NEXT: sdc1 $f24, 24($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $ra, 16($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $17, 8($sp) # 8-byte Folded Spill +; MIPS64-NEXT: sd $16, 0($sp) # 8-byte Folded Spill +; MIPS64-NEXT: move $16, $6 +; MIPS64-NEXT: move $17, $4 +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: sll $4, $5, 0 +; MIPS64-NEXT: mov.s $f24, $f0 +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: sll $4, $17, 0 +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: add.s $f12, $f0, $f24 +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: sll $4, $2, 0 +; MIPS64-NEXT: mov.s $f24, $f0 +; MIPS64-NEXT: jal __gnu_h2f_ieee +; MIPS64-NEXT: sll $4, $16, 0 +; MIPS64-NEXT: jal __gnu_f2h_ieee +; MIPS64-NEXT: add.s $f12, $f24, $f0 +; MIPS64-NEXT: ld $16, 0($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $17, 8($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ld $ra, 16($sp) # 8-byte Folded Reload +; MIPS64-NEXT: ldc1 $f24, 24($sp) # 8-byte Folded Reload +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: daddiu $sp, $sp, 32 %d = fadd half %a, %b %e = fadd half %d, %c ret half %e } define half @to_half(i16 %bits) nounwind { -; CHECK-LIBCALL-LABEL: to_half: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: move $2, $4 +; MIPS32-LABEL: to_half: +; MIPS32: # %bb.0: +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: move $2, $4 +; +; MIPS64-LABEL: to_half: +; MIPS64: # %bb.0: +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: sll $2, $4, 0 %f = bitcast i16 %bits to half ret half %f } define i16 @from_half(half %f) nounwind { -; CHECK-LIBCALL-LABEL: from_half: -; CHECK-LIBCALL: # %bb.0: -; CHECK-LIBCALL-NEXT: jr $ra -; CHECK-LIBCALL-NEXT: move $2, $4 +; MIPS32-LABEL: from_half: +; MIPS32: # %bb.0: +; MIPS32-NEXT: jr $ra +; MIPS32-NEXT: move $2, $4 +; +; MIPS64-LABEL: from_half: +; MIPS64: # %bb.0: +; MIPS64-NEXT: jr $ra +; MIPS64-NEXT: sll $2, $4, 0 %bits = bitcast half %f to i16 ret i16 %bits }