This is an archive of the discontinued LLVM Phabricator instance.

[7/8][RISCV] Add rounding mode control variant for conversion intrinsics between floating-point and integer
ClosedPublic

Authored by eopXD on Jul 6 2023, 11:02 AM.

Details

Summary

Depends on D154634

For the cover letter of the patch-set, please checkout D154628.

This is the 7th patch of the patch-set. This patch includes change to
vfcvt_x_f, vfcvt_xu_f, vfwcvt_x_f, vfwcvt_xu_f, vfncvt_x_f, vfncvt_xu_f
vfcvt_f_x, vfcvt_f_xu, vfncvt_f_x vfncvt_f_xu, vfncvt_f_f

Diff Detail

Event Timeline

eopXD created this revision.Jul 6 2023, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 11:02 AM
eopXD requested review of this revision.Jul 6 2023, 11:02 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 6 2023, 11:02 AM
eopXD retitled this revision from [RISCV] Add rounding mode control variant for conversion intrinsics between floating-point and integer to [7/8][RISCV] Add rounding mode control variant for conversion intrinsics between floating-point and integer.Jul 6 2023, 11:11 AM
eopXD edited the summary of this revision. (Show Details)
craig.topper added inline comments.Jul 6 2023, 12:18 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
6578

These don't need rounding mode. As the spec ssys "A double-width IEEE floating-point value can always represent a single-width integer exactly." Not sure why they had an FRM use before.

I'm also very unsure why PseudoVFWCVT_RM_F_XU and PseudoVFWCVT_RM_F_X exist.

6579

VFWCVT_F_F doesn't need rounding mode.

craig.topper added inline comments.Jul 6 2023, 1:23 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
6578
eopXD updated this revision to Diff 538012.Jul 7 2023, 12:14 AM
eopXD marked 3 inline comments as done.

Remove rounding mode variant of vfwcvt.f.f

eopXD edited the summary of this revision. (Show Details)Jul 7 2023, 12:16 AM
eopXD edited the summary of this revision. (Show Details)Jul 7 2023, 12:47 AM
eopXD updated this revision to Diff 538016.Jul 7 2023, 1:07 AM

Remove rounding mode variant of vfwcvt.f.x, vfwcvt.f.xu
Add out-of-range semantic check and its corresponding test cases for the intrinsics added.

craig.topper added inline comments.Jul 10 2023, 1:55 PM
llvm/test/CodeGen/RISCV/rvv/ceil-vp.ll
24 ↗(On Diff #538016)

This is concerning. This means the vfcvt.f.x.v is getting the modified rounding mode from fsrmi a0, 3. I think its functionally ok due to the inputs involved, but it still shouldn't be happening. Is the vfcvt.f.x.v missing its FRM implicit dependency for DYN?

eopXD updated this revision to Diff 539473.Jul 12 2023, 3:34 AM

Change:

  • Rebase upon latest main and updated parent revisions
This revision is now accepted and ready to land.Jul 12 2023, 10:20 AM
This revision was landed with ongoing or failed builds.Jul 13 2023, 12:54 AM
This revision was automatically updated to reflect the committed changes.