Page MenuHomePhabricator

[LoongArch] Add fp_to_sint support for soft floating point
ClosedPublic

Authored by gonglingqin on Sep 26 2022, 7:43 PM.

Diff Detail

Event Timeline

gonglingqin created this revision.Sep 26 2022, 7:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 7:43 PM
gonglingqin requested review of this revision.Sep 26 2022, 7:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 7:43 PM

Should we add test cases for long double?

If I understand correctly, the code added can also handle long double, and long double is soft even with FPU.

Should we add test cases for long double?

If I understand correctly, the code added can also handle long double, and long double is soft even with FPU.

Thanks for the suggestion, I will add test cases.

With this patch added, can llvm/test/CodeGen/Generic/fp_to_int.ll pass now?

Address @xry111's comments.

With this patch added, can llvm/test/CodeGen/Generic/fp_to_int.ll pass now?

Yes, llvm/test/CodeGen/Generic/fp_to_int.ll passed

xen0n accepted this revision.Sep 27 2022, 1:41 AM

This one was easy port from RISCV ;-)

BTW I saw in the RISCV port suport for softening fptoui too, are you handling that case later or is it unnecessary for LoongArch?

This revision is now accepted and ready to land.Sep 27 2022, 1:41 AM

This one was easy port from RISCV ;-)

BTW I saw in the RISCV port suport for softening fptoui too, are you handling that case later or is it unnecessary for LoongArch?

Thanks for your review. This is unnecessary for fptoui, because LoongArch has implemented this function with the help of the common layer.

This revision was landed with ongoing or failed builds.Sep 28 2022, 7:27 PM
This revision was automatically updated to reflect the committed changes.