Skip to content

Instantly share code, notes, and snippets.

@moriyoshi
Created May 11, 2009 08:37
Show Gist options
  • Save moriyoshi/109914 to your computer and use it in GitHub Desktop.
Save moriyoshi/109914 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv)
{
double c, s, r;
for (r = 0.0; r < 2 * M_PI; r += 0.1) {
asm("fsincos": "=t"(c), "=u"(s): "0"(r));
printf("%lf %lf\n", sin(r), s);
printf("%lf %lf\n", cos(r), c);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment