This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Implement intrinsics for mtfsf[i]
ClosedPublic

Authored by nemanjai on Jul 13 2021, 7:09 PM.

Details

Reviewers
ZhangKang
qiucf
Group Reviewers
Restricted Project
Commits
rG35a18a981f6b: [PowerPC] Implement intrinsics for mtfsf[i]
Summary

This provides intrinsics for emitting instructions that set the FPSCR (mtfsf/mtfsfi).

The patch also conservatively marks the rounding mode as an implicit def for both since they both may set the rounding mode depending on the operands.

Diff Detail

Event Timeline

nemanjai created this revision.Jul 13 2021, 7:09 PM
nemanjai requested review of this revision.Jul 13 2021, 7:09 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 13 2021, 7:09 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nemanjai added inline comments.Jul 13 2021, 7:17 PM
llvm/lib/Target/PowerPC/PPCInstrInfo.td
4489

@ZhangKang You modified this code most recently. Please provide your opinion here.

qiucf accepted this revision.Jul 14 2021, 7:58 PM
qiucf added a subscriber: qiucf.

The PPC instructions tablegen part looks good to me.

llvm/include/llvm/IR/IntrinsicsPowerPC.td
1642

If mtfsf was changed, mtfsfi mtfsb0 mtfsb1 should also be changed?

This revision is now accepted and ready to land.Jul 14 2021, 7:58 PM
nemanjai added inline comments.Jul 16 2021, 8:07 AM
llvm/include/llvm/IR/IntrinsicsPowerPC.td
1642

There is no need for custom code generation for those. The reason we had to change mtfsf is because we need to take an integer and convert it to a double (and not a bitcast, but a uinttofp which I found a bit surprising).

This revision was landed with ongoing or failed builds.Jul 16 2021, 2:26 PM
This revision was automatically updated to reflect the committed changes.