Skip to content

Instantly share code, notes, and snippets.

@yottatsa
Last active April 14, 2023 15:24
Show Gist options
  • Save yottatsa/0048bd4cd95486fba34e3d033306fad4 to your computer and use it in GitHub Desktop.
Save yottatsa/0048bd4cd95486fba34e3d033306fad4 to your computer and use it in GitHub Desktop.
Measuring 8087 FPU
/*
* gcc -O0 -m16 -march=i386 -c fpu.c
*
* 34: 67 dd 80 00 00 fldl 0x0(%bx,%si)
* 3b: de c9 fmulp %st,%st(1)
* 3d: 67 db 44 24 fildl 0x24(%si)
* 43: db 04 24 fildl (%esp)
* 46: 67 dd 80 08 00 fldl 0x8(%bx,%si)
* 4d: de c9 fmulp %st,%st(1)
* 4f: de c1 faddp %st,%st(1)
* 51: de f9 fdivrp %st,%st(1)
* 53: 67 dd 5c 24 fstpl 0x24(%si)
*
* gcc -m16 -march=i386 -mno-80387 -c fpu.c
*
*/
void main ()
{
volatile double a;
int i, j;
for(j=0; j<=5; j++)
for(i=0; i<=10000; i++)
{
a = (i * (double)123)/(j + i * (double)45);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment