Last active
May 7, 2022 20:21
-
-
Save eventhelix/8a1ab0b3347c25631e55252145b1a7b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
example::double: | |
mov rax, rdi | |
mov rcx, qword ptr [rsi] ; Read the enum discriminator | |
test rcx, rcx ; Check the discriminator for 0 | |
je .LBB0_5 | |
cmp ecx, 1 | |
jne .LBB0_3 | |
movsd xmm0, qword ptr [rsi + 8] | |
addsd xmm0, xmm0 | |
movsd qword ptr [rax + 8], xmm0 | |
mov ecx, 1 | |
mov qword ptr [rax], rcx | |
ret | |
.LBB0_5: | |
mov rcx, qword ptr [rsi + 8] | |
add rcx, rcx | |
mov qword ptr [rax + 8], rcx | |
xor ecx, ecx | |
mov qword ptr [rax], rcx | |
ret | |
.LBB0_3: | |
movsd xmm0, qword ptr [rsi + 8] | |
movsd xmm1, qword ptr [rsi + 16] | |
addsd xmm0, xmm0 | |
addsd xmm1, xmm1 | |
movsd qword ptr [rax + 8], xmm0 | |
movsd qword ptr [rax + 16], xmm1 | |
mov ecx, 2 | |
mov qword ptr [rax], rcx | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment