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

Why do we need an APInt?


Why do we need an APInt?


Removed commented out code.


Where did FNSTSW16r come from? I deleted that recently.


STMXCSR/LDMXCSR aren't used.

craig.topper added inline comments.Feb 17 2020, 11:14 AM

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.

Changed here but implementation of LowerFLT_ROUNDS_ was not changed.

RKSimon added inline comments.Feb 18 2020, 6:45 AM

FNSTSW16r was removed at D73863, but FNSTCW16m stayed

@sepavloff - what's happening with this?

sepavloff updated this revision to Diff 260283.Apr 27 2020, 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.Apr 27 2020, 10:32 AM