This is the following patch of D68854.
This patch adds basic operations of X87 instructions, including +, -, *, / , fp extensions and fp truncations.
Paths
| Differential D68857
[X86] Add strict fp support for operations of X87 instructions ClosedPublic Authored by LiuChen3 on Oct 10 2019, 8:03 PM.
Details Summary This is the following patch of D68854. This patch adds basic operations of X87 instructions, including +, -, *, / , fp extensions and fp truncations.
Diff Detail Event TimelineLiuChen3 added reviewers: cameron.mcinally, craig.topper, RKSimon, andrew.w.kaylor, uweigand, kpn, spatel.Oct 10 2019, 8:13 PM
LiuChen3 added inline comments.
Comment Actions Rebase and change the name of tests in fp-strict-scalar.ll . Add a test file which only process 80-bit long double type, because tests for 80-bit FP is complex to put into fp-strict-scalar.ll without changing the '–check-prefix'.
Comment Actions I think we need to re-evaluate our testing strategy here. These tests pass on trunk without any of the other changes. I was going to suggest adding -stop-after=finalize-isel so we could check the fpexcept bit, but the mutating code preserves the fpexcept bit from the strict fp node we mutated. So I'm not sure how we can tell that this patch works correctly. Comment Actions How about we add a command line option to SelectionDAGISel to disable the mutation code and pass that option on the tests? Comment Actions
I think it's reasonable. Comment Actions The new tests and test renames can be done as an NFC commit - then please rebase this patch Comment Actions
Sorry, I am not clear of what you mean. Do you mean I should make a new patch to add these tests? The tests in my current patch is not just renamed, but also doing functional test. I think it's better to keep them together. Comment Actions
I've updated/added the tests in rG5aaca2355ec2 (matching Craig's changes in rG0cc12b8a8310) - the changes were an NFC cleanup and don't require a new patch. Please can you now rebase? Comment Actions
I have rebase. Thanks. Comment Actions Rebase. Comment Actions
STRICT_FP_ROUND should only be Custom on a 64-bit target. This probably only works because LegalizeDAG bailed out of ExpandNode due to strictfp mutation being disabled. And there is no libcall support for STRICT_FP_ROUND so LegalizeDAG gave up and just left the node alone.
Comment Actions
OK. Thanks for your help. Comment Actions Pengfei has helped me commit the test cases. LiuChen3 added inline comments.
This revision is now accepted and ready to land.Nov 26 2019, 10:48 AM Closed by commit rGcfce8f2cfba4: [X86] Add strict fp support for operations of X87 instructions (authored by craig.topper). · Explain WhyNov 26 2019, 11:08 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 230999 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrFPStack.td
llvm/test/CodeGen/X86/fp-strict-scalar.ll
llvm/test/CodeGen/X86/fp80-strict-scalar.ll
|
This isn't the right check for the fp80 operations. They're independent of sse.