This is an archive of the discontinued LLVM Phabricator instance.

[X86] Model MXCSR for all AVX512 instructions
ClosedPublic

Authored by pengfei on Dec 1 2019, 6:10 PM.

Details

Summary

Model MXCSR for all AVX512 instructions

Diff Detail

Event Timeline

pengfei created this revision.Dec 1 2019, 6:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2019, 6:10 PM

My biggest concern here is that the SAE and implicit rounding instructions are all marked as mayRaiseExceptions which is incorrect.

llvm/lib/Target/X86/X86InstrInfo.cpp
1764–1765

Use getNumExplicitOperands() - 1 instead.

pengfei updated this revision to Diff 231651.Dec 2 2019, 2:12 AM
pengfei marked an inline comment as done.

Address review comments.

Removed MXCSR and mayRaiseExceptions from SAE opcodes.

llvm/lib/Target/X86/X86InstrInfo.cpp
1764–1765

Thanks!

I think SAE instructions and embedded rounding instructions still read the DAZ and FTZ bits from MXCSR

This comment was removed by pengfei.

I think SAE instructions and embedded rounding instructions still read the DAZ and FTZ bits from MXCSR

I think so, but currently we don't model DAZ and FTZ, right?

The comment in X86RegisterInfo.td says that, but where was that discussed?

I think SAE instructions and embedded rounding instructions still read the DAZ and FTZ bits from MXCSR

I think so, but currently we don't model DAZ and FTZ, right?

The comment in X86RegisterInfo.td says that, but where was that discussed?

You are correct, we do need to model DAZ and FTZ. I think I commented "not modeled" just for simplification. I will commit a patch to model them.

craig.topper added inline comments.Dec 2 2019, 8:51 PM
llvm/lib/Target/X86/X86InstrAVX512.td
7121

Don't we need to suppress MXCSR and exceptions here

llvm/lib/Target/X86/X86InstrInfo.cpp
1764–1765

Is this line longer than 80 columns?

pengfei updated this revision to Diff 231819.Dec 2 2019, 9:31 PM
pengfei marked an inline comment as done.

Address review comments.

pengfei marked an inline comment as done.Dec 2 2019, 9:31 PM
pengfei added inline comments.
llvm/lib/Target/X86/X86InstrAVX512.td
7121

Yes, I missed it. Thanks!

llvm/lib/Target/X86/X86InstrInfo.cpp
1764–1765

Fixed, thanks!

This revision is now accepted and ready to land.Dec 3 2019, 2:48 PM
This revision was automatically updated to reflect the committed changes.
llvm/test/CodeGen/X86/domain-reassignment.mir