This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][builtins][MIPS] Add test-cases for mips16 wrappers for float arithmetic, comparison & conversion
Needs ReviewPublic

Authored by farazs on Jul 10 2014, 2:39 AM.

Details

Reviewers
samsonov
Summary

This patch adds unit test cases for mips16 wrappers for floating-point arithmetic, comparison and type-conversion operations.

Background: mips16 code is not aware of floating point registers and call-conventions. For platforms that support floating point operations, mips16 code resorts to calling an appropriate low-level wrapper function with the float arguments in general purpose registers. The low-level function copies the arguments to FP registers, performs the operation and returns the result to the caller in a GP register. For some operations, test results are compared either against pre-calculated reference output, while for others, the corresponding soft-float implementation is used as reference.

Test cases are provided for the following wrappers:
Arithmetic(single & double precision): add, sub, mul, div
Comparison(single & double precision): eq, ne, gt, ge, lt, le, unord
Type conversions:

To signed integer: fix_truncXfsi
To float: floatunsiXf, floatsiXf
Within float formats: truncdfsf, extendsfdf

Diff Detail

Event Timeline

farazs updated this revision to Diff 11251.Jul 10 2014, 2:39 AM
farazs retitled this revision from to [compiler-rt][builtins][MIPS] Add test-cases for mips16 wrappers for float arithmetic, comparison & conversion.
farazs updated this object.
farazs edited the test plan for this revision. (Show Details)
farazs added a reviewer: samsonov.
farazs set the repository for this revision to rL LLVM.
farazs added subscribers: Unknown Object (MLST), dsanders.
samsonov added inline comments.Jul 10 2014, 4:39 PM
test/builtins/Unit/mips/mips16_cmpdf2_test.c
19

Who defines this substitution?

Sorry for the long silence, been away from work for a while. Response below.

test/builtins/Unit/mips/mips16_cmpdf2_test.c
19

No one yet! I am hoping %clang_builtins would be defined by the test-framework, whenever the builtins testsuite is ported to LIT. That line is just a placeholder for now.

samsonov added inline comments.Sep 25 2014, 10:45 AM
test/builtins/Unit/mips/mips16_cmpdf2_test.c
19

Well, I'd rather not commit the test cases until they can actually be run. Defining this and providing lit-config substitution shouldn't be hard.

farazs added inline comments.Sep 25 2014, 8:34 PM
test/builtins/Unit/mips/mips16_cmpdf2_test.c
19

The intention of this line was to document that these specific test-cases need to be compiled with the option '-mips16'. I'll just remove the offending lines, they seem to cause unnecessary confusion.
Thanks.

farazs updated this revision to Diff 14092.Sep 25 2014, 8:40 PM

Removed run-spec lines from all tests, since the LIT configuration for builtins is not in place yet.

samsonov edited edge metadata.Sep 26 2014, 1:45 PM

Hm, I actually meant that it would be nice to add support for running builtins tests (or at least this pack of MIPS tests) under lit. Otherwise these files will just stay there unsupported and broken.

farazs added a comment.EditedSep 29 2014, 5:14 AM

Well, sgundapa remarked that he was working on a lit configuration for builtins, here. It would be nice to have the framework at hand, but strictly speaking that is a parallel activity to the addition of unit tests.

By the way, the feature implementation for these tests is also still under review.

sdkie edited edge metadata.Nov 4 2014, 3:16 AM
sdkie added a subscriber: sdkie.