Skip to content

Instantly share code, notes, and snippets.

@vcoracolombo
Created October 26, 2022 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcoracolombo/4b592644517c0efb3854872a4b30f6cc to your computer and use it in GitHub Desktop.
Save vcoracolombo/4b592644517c0efb3854872a4b30f6cc to your computer and use it in GitHub Desktop.
#include <stdint.h>
#define TEST(H1) \
do { \
uint64_t frt; \
asm("fsqrt %0, %1\n\tfmadd %0, %1, %0, %1" : "=f"(frt) : "f"(H1)); \
} while (0)
int main(void)
{
int i = 0;
__builtin_mtfsb1(46 - 32); __builtin_mtfsb1(38 - 32); __builtin_mtfsb1(32 - 32);
for (; i < 100000000; ++i) {
TEST(0xc00921f9f01b866eULL);
TEST(0xc0934a456d5cfaadULL);
TEST(0xbfdb26c7eae5bc88ULL);
}
__builtin_mffs();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment