This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add strict fp support for instructions fadd/fsub/fmul/fdiv
ClosedPublic

Authored by LiuChen3 on Oct 9 2019, 8:07 PM.

Details

Summary

This is the following patch of D68686. It adds strict node support for instructions fadd/fsub/fmul/fdiv

Event Timeline

pengfei created this revision.Oct 9 2019, 8:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2019, 8:07 PM
craig.topper added inline comments.Oct 9 2019, 8:21 PM
llvm/lib/Target/X86/X86InstrAVX512.td
5394

These are scalar instructions, but you didn't make f32/f64 Legal in X86ISelLowering.cpp

pengfei updated this revision to Diff 224245.Oct 9 2019, 10:09 PM

Add test case for scalar instructions.

pengfei marked an inline comment as done.Oct 9 2019, 10:10 PM
pengfei updated this revision to Diff 224248.Oct 9 2019, 10:19 PM

Rename scalar test file to fp-strict-scalar.

pengfei updated this revision to Diff 224806.Oct 13 2019, 8:16 PM

Add the missing attributes #0 = { strictfp }

craig.topper added inline comments.Oct 30 2019, 1:19 PM
llvm/lib/Target/X86/X86ISelLowering.cpp
746

If SSE isn't enabled, isn't this broken for f32. Similar for SSE2 and f64?

pengfei marked an inline comment as done.Oct 31 2019, 1:42 AM
pengfei added inline comments.
llvm/lib/Target/X86/X86ISelLowering.cpp
746

I don't think it will break X87 types, but it does seems to be weird that legalize X87 strict nodes at the same time before X87 patches.
I'd like to commit this patch after D68857 and remove the common code in that patch. And it's probable, because I need to model AVX instructions before commiting this patch.

LiuChen3 commandeered this revision.Nov 26 2019, 9:42 PM
LiuChen3 updated this revision to Diff 231178.
LiuChen3 added a reviewer: pengfei.

Rebase.
Add option to the tests.

craig.topper added inline comments.Nov 29 2019, 1:58 PM
llvm/lib/Target/X86/X86InstrSSE.td
2730–2733

Are there tests for this? There's also AVX512_scalar_math_fp_patterns that would need to be updated too.

LiuChen3 updated this revision to Diff 231638.Dec 1 2019, 9:49 PM

Adding testcase for scalar_math_patterns and AVX512_scalar_math_fp_patterns.
Moving setOperationAction(ISD::STRICT_FADD/STRICT_FSUB/STRICT_FDIV/STRICT_FMUL, MVT::v2f64, Legal) into SSE2 judgment statement.

This revision is now accepted and ready to land.Dec 5 2019, 3:55 PM
This revision was automatically updated to reflect the committed changes.