Skip to content

Instantly share code, notes, and snippets.

@Const-me
Created March 12, 2021 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Const-me/ce7f7677cbb9f43efe74aeeadb75deb1 to your computer and use it in GitHub Desktop.
Save Const-me/ce7f7677cbb9f43efe74aeeadb75deb1 to your computer and use it in GitHub Desktop.
static class C
{
static int div2(int i)
{
return i / 2;
}
}
; Core CLR v5.0.321.7212 on amd64
C.div2(Int32)
L0000: mov eax, ecx
L0002: shr eax, 0x1f
L0005: add eax, ecx
L0007: sar eax, 1
L0009: ret
{
"version": 1,
"target": "JIT ASM",
"mode": "Release",
"branch": "core-x64"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment