-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-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 SuperPMItenet-performancePerformance related issuePerformance related issue
Milestone
Description
int Shlx(int x, int y) => x << y;
int Sarx(int x, int y) => x >> y;
uint Shrx(uint x, int y) => x >> y;Current codegen:
; Method Tests:Shlx(int,int):int
mov eax, ecx
mov ecx, edx
shl eax, cl
ret
; Method Tests:Sarx(int,int):int
mov eax, ecx
mov ecx, edx
sar eax, cl
ret
; Method Tests:Shrx(int,int):int
mov eax, ecx
mov ecx, edx
shr eax, cl
ret Expected codegen (on a cpu with BMI2):
; Method Tests:Shlx(int,int):int
shlx eax, ecx, edx
ret
; Method Tests:Sarx(int,int):int
sarx eax, ecx, edx
ret
; Method Tests:Shrx(int,int):int
shrx eax, ecx, edx
ret #41772 does it for rorx
godbolt: https://godbolt.org/z/8zGbYe
/cc @tannergooding
category:cq
theme:codegen
skill-level:beginner
cost:small
tannergooding, hez2010, strangeman375, gfoidl, rameel and 2 more
Metadata
Metadata
Assignees
Labels
area-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 SuperPMItenet-performancePerformance related issuePerformance related issue