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
Current codegen:
Expected codegen (on a cpu with BMI2):
#41772 does it for
rorxgodbolt: https://godbolt.org/z/8zGbYe
/cc @tannergooding
category:cq
theme:codegen
skill-level:beginner
cost:small