-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Priority:3Work that is nice to haveWork that is nice to havearch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization
Milestone
Description
Right now the body of the following method
public static long BigMul(int a, int b)
{
return ((long)a) * b;
}is compiled by the JIT as two sign extensions sxtw followed by mul instruction:
G_M36318_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp,#-16]!
910003FD mov fp, sp
;; bbWeight=1 PerfScore 1.50
G_M36318_IG02: ;; offset=0008H
93407C00 sxtw x0, w0
93407C21 sxtw x1, w1
9B017C00 mul x0, x0, x1
;; bbWeight=1 PerfScore 3.00
G_M36318_IG03: ;; offset=0014H
A8C17BFD ldp fp, lr, [sp],#16
D65F03C0 ret lrAs @TamarChristinaArm pointed out in #47362 that could be simplified down to
smull x0, w0, w1The same applies to unsigned version of the method
public static ulong BigMul(uint a, uint b)
{
return ((ulong)a) * b;
}that should be compiled to
umull x0, w0, w1TamarChristinaArm and pentp
Metadata
Metadata
Assignees
Labels
Priority:3Work that is nice to haveWork that is nice to havearch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization
Type
Projects
Status
Done