Skip to content

Instantly share code, notes, and snippets.

@vcoracolombo
Created October 26, 2022 18:25
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/f0d8b7c9f1cb63dac6ff0221209ec4ff to your computer and use it in GitHub Desktop.
Save vcoracolombo/f0d8b7c9f1cb63dac6ff0221209ec4ff 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(0x4010000000000000ULL);
TEST(0x4000000000000000ULL);
TEST(0x41c0000000000000ULL);
}
__builtin_mffs();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment