Page MenuHomePhabricator

[RISCV] Improve i32 UADDSAT/USUBSAT on RV64.
ClosedPublic

Authored by craig.topper on Mar 16 2021, 12:33 AM.

Details

Summary

The default promotion uses zero extends that become shifts. We
cam use sign extend instead which is better for RISCV.

I've used two different implementations based on whether we
have minu/maxu instructions.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 16 2021, 12:33 AM
craig.topper requested review of this revision.Mar 16 2021, 12:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2021, 12:33 AM
Herald added a subscriber: MaskRay. · View Herald Transcript

LGTM.

llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3529

Nit: British spelling :)

luismarques accepted this revision.Mar 16 2021, 5:45 AM
This revision is now accepted and ready to land.Mar 16 2021, 5:45 AM
craig.topper added inline comments.Mar 16 2021, 6:59 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3529

Yeah I copied and pasted it from one of the other cases. Figured it was best to be consistent.

luismarques added inline comments.Mar 16 2021, 7:06 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3529

Yeah I copied and pasted it from one of the other cases. Figured it was best to be consistent.

Oh, right. I see it's all @asb's original fault :)
Good call. Keep it consistent, and no point in polluting the git blame history changing the others trivially.

This revision was automatically updated to reflect the committed changes.