diff --git a/userland/arch/x86_64/inline_asm/sqrt_x87.c b/userland/arch/x86_64/inline_asm/sqrt_x87.c new file mode 100644 index 0000000..b37aa06 --- /dev/null +++ b/userland/arch/x86_64/inline_asm/sqrt_x87.c @@ -0,0 +1,15 @@ +/* https://github.com/cirosantilli/linux-kernel-module-cheat#gcc-inline-assembly */ + +#include + +int main(void) { + double io = 4.0; + __asm__ ( + "fsqrt" + : "+t" (io) + : + : + ); + assert(io == 2.0); + return 0; +}