[PATCH] D17760: [mips] Fix an issue with long double when function roundl is defined

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 05:46:50 PST 2016


dsanders added a comment.

>   #include <math.h>

>    

>   int main() {

>     long double x, y;

>     y = roundl(x);

>     return 0;

>   }


The majority of the function is dead code and x is uninitialized.

>   clang -static -O0 --target=mips64-img-linux-gnu -EL -mcpu=mips64r6 -mabi=64 -mhard-float -no-integrated-as --gcc-toolchain=/home/rtrk/mips-toolchain/mips-img-linux-gnu/2015.01-7 -S -emit-llvm roundl-test.c

> 

> Then we generate assembler code from roundl-call.ll with llc:

> 

>   llc -march=mips64el -mcpu=mips64r3 -target-abi=n64 -O2 < roundl-call.ll


I notice these two commands use different CPU's and that the ISA's for the two are incompatible.


================
Comment at: test/CodeGen/Mips/roundl-call.ll:1
@@ +1,2 @@
+; RUN: llc -march=mips64el -mcpu=mips64   -target-abi=n64 < %s | FileCheck %s
+; RUN: llc -march=mips64el -mcpu=mips64r2 -target-abi=n64 < %s | FileCheck %s
----------------
Can you put calling convention tests in test/CodeGen/Mips/cconv/?

return-hard-fp128.ll and arguments-hard-fp128.ll are the fp128 hard-float tests. Could you test in a similar way to those two?
In particular:
* We need to cover N32.
* We need to ensure that soft-float still works correctly.
* We don't need to test mips64r2/mips64r3 explicitly since there's no difference compared to mips64.
* We should eliminate as much unnecessary code as possible. There's usually no need for alloca's, loads, stores, attributes, etc. in these tests.


http://reviews.llvm.org/D17760





More information about the llvm-commits mailing list