This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add missing FP build attribute tests.
Needs ReviewPublic

Authored by chatur01 on Dec 4 2014, 1:36 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

The test file test/CodeGen/ARM/build-attributes.ll was missing several floating-point build attribute tests. The intention of this patch is that for each CPU / architecture currently tested, there are now tests that make sure the following attributes are sufficiently checked,

    
* Tag_ABI_FP_rounding
* Tag_ABI_FP_denormal
* Tag_ABI_FP_exceptions
* Tag_ABI_FP_user_exceptions
* Tag_ABI_FP_number_model

Also in this commit, the -unsafe-fp-math flag has been augmented with the full suite of flags Clang sends to LLVM when you pass -ffast-math to Clang. That is, -unsafe-fp-math has been changed to -enable-unsafe-fp-math -disable-fp-elim -enable-no-infs-fp-math -enable-no-nans-fp-math -fp-contract=fast. I made the mistake of thinking LLVM's -unsafe-fp-math was the equivalent of Clang's -ffast-math originally, and because the fast maths tests I originally had were scant, I didn't realise my error.

The only attribute test here that wasn't tested at all before is FP_user_exceptions. The rationale for this attribute's value selection follows that of GCC. By default for all targets, the attribute is zero. If -fsignaling-nans is specified, set the attribute to one. The "set the attribute to one" check isn't in this patch, because LLVM doesn't appear to have any flag for signaling NaNs. Clang has an -fsignaling-nans flag, but it's unsupported.

The comment in ARMAsmPrinter is unrelated to meat of this patch, but it didn't some worth an extra patch.

Diff Detail

Event Timeline

chatur01 retitled this revision from to [ARM] Add missing FP build attribute tests..
chatur01 updated this object.
chatur01 edited the test plan for this revision. (Show Details)
chatur01 set the repository for this revision to rL LLVM.
chatur01 added a subscriber: Unknown Object (MLST).

Hi Charlie,

I think this looks reasonable.

Cheers.

Tim.

Thanks for looking Tim, committed as r223454.