Details
Diff Detail
Event Timeline
i64 mul on riscv32 is omitted, since 6-10 extra instruction are generated, not sure if it is a win against calling __muldi3.
This is the best form I can tune now, the best trade among int128, int64 and int32. It generated optimized code for most of them,
except some cases are left not covered,
- rv32 with M extension: not sure if is a real win since some HW multiplier has quite low lantency, even to 2 cycles.
- i128 mul on rv32: the generated code is too large, not sure if it is better than calling __multi3
- -(1<<m)-(1<<n): more NEGS are generated than other (1<<m)±(1<<n), so it may not be optimal than quick HW multipliers.
Shall we commit current form first? Then I will go on with the hard cases in the future.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
3831 | Is the first part of this just !Imm.isSignedIntN(12)? And 0 != (Imm & High) is !Imm.isIntN(11)? |
llvm/test/CodeGen/RISCV/mul.ll | ||
---|---|---|
952 | Please pre-commit these test cases and rebase this patch. |
llvm/test/CodeGen/RISCV/mul.ll | ||
---|---|---|
952 | The test cases are commited to |
llvm/test/CodeGen/RISCV/mul.ll | ||
---|---|---|
952 | Please rebase and mark that as a parent of this revision. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
3822–3823 | Please refrain from using unicode |
LGTM. Please write a description of the changes in the the commit message when you commit this.
Please refrain from using unicode