Skip to content

Commit f66e777

Browse files
committed
x86 asm: sqrt x87
1 parent 564735f commit f66e777

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* https://github.com/cirosantilli/linux-kernel-module-cheat#gcc-inline-assembly */
2+
3+
#include <assert.h>
4+
5+
int main(void) {
6+
double io = 4.0;
7+
__asm__ (
8+
"fsqrt"
9+
: "+t" (io)
10+
:
11+
:
12+
);
13+
assert(io == 2.0);
14+
return 0;
15+
}

0 commit comments

Comments
 (0)