Last active
August 21, 2021 08:08
-
-
Save febnug/ef36b1836117fc613f539f5ae4b1006c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// (c) 2021 - Febriyanto Nugroho | |
// compile dengan : gcc -o sqrt-SSE sqrt-SSE.c -masm=intel | |
#include <stdio.h> | |
int main(void) { | |
int nilai = 5; | |
__asm__ __volatile__("cvtsi2sd xmm0, ebx\n" | |
"sqrtsd xmm0, xmm0\n" | |
"cvttsd2si ebx, xmm0\n" | |
: "=b"(nilai) // ebx itu input | |
: "b"(nilai) // output ebx | |
); | |
printf("%d\n", nilai); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment