Last active
September 11, 2022 23:13
-
-
Save dfyz/52c7a0735840576829587aefd63d59ba to your computer and use it in GitHub Desktop.
We have FJCVTZS at home
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
.global _d2i | |
.align 4 | |
_d2i: | |
fcvtzs x0, d0 | |
ret |
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
.intel_syntax noprefix | |
.global d2i | |
d2i: | |
cvttsd2si rax, xmm0 | |
ret |
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
> gcc -O2 -o ./cvt cvt.c cvt_x86_cheat.s -lm && ./cvt | |
-1.000000 -1 | |
-133.700000 -133 | |
-17875.690000 -17875 | |
-2389979.753000 -2389979 | |
-319540292.976100 -319540292 | |
-42722537170.904549 227135790 | |
-5712003219749.938477 303283931 | |
-763694830480566.625000 1894355786 | |
1.000000 1 | |
133.700000 133 | |
17875.690000 17875 | |
2389979.753000 2389979 | |
319540292.976100 319540292 | |
42722537170.904549 -227135790 | |
5712003219749.938477 -303283931 | |
763694830480566.625000 -1894355786 | |
> gcc -O2 -o ./cvt cvt.c cvt_aarch64_cheat.s && ./cvt | |
-1.000000 -1 | |
-133.700000 -133 | |
-17875.690000 -17875 | |
-2389979.753000 -2389979 | |
-319540292.976100 -319540292 | |
-42722537170.904549 227135790 | |
-5712003219749.938477 303283931 | |
-763694830480566.625000 1894355786 | |
1.000000 1 | |
133.700000 133 | |
17875.690000 17875 | |
2389979.753000 2389979 | |
319540292.976100 319540292 | |
42722537170.904549 -227135790 | |
5712003219749.938477 -303283931 | |
763694830480566.625000 -1894355786 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment