Index: lib/Target/Mips/MipsCCState.cpp =================================================================== --- lib/Target/Mips/MipsCCState.cpp +++ lib/Target/Mips/MipsCCState.cpp @@ -26,8 +26,8 @@ "ceill", "copysignl", "cosl", "exp2l", "expl", "floorl", "fmal", "fmodl", "log10l", "log2l", "logl", "nearbyintl", - "powl", "rintl", "sinl", "sqrtl", - "truncl"}; + "powl", "rintl", "roundl", "sinl", + "sqrtl", "truncl"}; // Check that LibCalls is sorted alphabetically. auto Comp = [](const char *S1, const char *S2) { return strcmp(S1, S2) < 0; }; Index: test/CodeGen/Mips/roundl-call.ll =================================================================== --- /dev/null +++ test/CodeGen/Mips/roundl-call.ll @@ -0,0 +1,26 @@ +; RUN: llc -march=mips64el -mcpu=mips64 -target-abi=n64 < %s | FileCheck %s +; RUN: llc -march=mips64el -mcpu=mips64r2 -target-abi=n64 < %s | FileCheck %s +; RUN: llc -march=mips64el -mcpu=mips64r3 -target-abi=n64 < %s | FileCheck %s +; RUN: llc -march=mips64el -mcpu=mips64r6 -target-abi=n64 < %s | FileCheck %s + +define i32 @main() #0 { +entry: +; CHECK-LABEL: main: +; CHECK: ld $25, %call16(roundl)($gp) +; CHECK: sdc1 $f2, 8($fp) +; CHECK: sdc1 $f0, 0($fp) + %retval = alloca i32, align 4 + %x = alloca fp128, align 16 + %y = alloca fp128, align 16 + store i32 0, i32* %retval, align 4 + %0 = load fp128, fp128* %x, align 16 + %call = call fp128 @roundl(fp128 %0) #2 + store fp128 %call, fp128* %y, align 16 + ret i32 0 +} + +declare fp128 @roundl(fp128) #1 + +attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="mips64r6" "target-features"="+mips64r6" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="mips64r6" "target-features"="+mips64r6" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #2 = { nounwind readnone }