Page MenuHomePhabricator

[FPEnv][X86] Implement lowering of llvm.set.rounding
Needs ReviewPublic

Authored by sepavloff on Feb 17 2020, 10:26 AM.

Diff Detail

Event Timeline

sepavloff created this revision.Feb 17 2020, 10:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2020, 10:26 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper added inline comments.Feb 17 2020, 10:50 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
25989

Why do we need an APInt?

26058

Why do we need an APInt?

26072

Removed commented out code.

30294

Where did FNSTSW16r come from? I deleted that recently.

llvm/lib/Target/X86/X86ISelLowering.h
663

STMXCSR/LDMXCSR aren't used.

craig.topper added inline comments.Feb 17 2020, 11:14 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
25973

I have no idea why FLT_ROUNDS calls TFI.getStackAlignment() to get the second parameter here. It should just be 4.

Modified patch according to reviewer's notes

sepavloff marked 7 inline comments as done.Feb 18 2020, 12:00 AM
sepavloff added inline comments.
llvm/lib/Target/X86/X86ISelLowering.cpp
25973

Changed here but implementation of LowerFLT_ROUNDS_ was not changed.

RKSimon added inline comments.Feb 18 2020, 6:45 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
30294

FNSTSW16r was removed at D73863, but FNSTCW16m stayed

@sepavloff - what's happening with this?

sepavloff updated this revision to Diff 260283.Mon, Apr 27, 4:55 AM
sepavloff marked an inline comment as done.

Rebased patch

@sepavloff - what's happening with this?

It is still needed. This patch depends on D74729. Next steps, like support in frontend (as fesetround) and lowering on other platforms make sense only after destiny of these patches will be determined.

The motivation for this work is implementation of a pragma that would set/restore rounding mode without need to call fesetround.

kpn added a subscriber: kpn.Mon, Apr 27, 10:32 AM