Page MenuHomePhabricator

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

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



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

Diff Detail

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

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

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.

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.Tue, Nov 26, 9:42 PM
LiuChen3 updated this revision to Diff 231178.
LiuChen3 added a reviewer: pengfei.

Add option to the tests.

craig.topper added inline comments.Fri, Nov 29, 1:58 PM

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.Sun, Dec 1, 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.Thu, Dec 5, 3:55 PM
This revision was automatically updated to reflect the committed changes.