다음 포스팅을 참조하세요.
언더비에 앙마님이 쓰신겁니다.
Posted By: hellcat (:)) on 'IBMPC'
Title: Re: just for fun or nightmare? (forwarded message)
Date: Thu Nov 17 09:23:17 1994
그게.. 7 월 이후에 나온 펜티움에는 조용히 그 벌레 고쳐
놨다는데..그거 아마 FDIV 가 에러가 나죠.
18 비트 부텀 비트 패턴이 작살 나서..정밀도가 개판이
되더군요.
그거 벌레 테스팅하는 프로그램 p87test.zip 으로
korea.slip.umd.edu 에 있어요..ftp 로 가져가여.
근데.. Linux 에서는 그걸 어케 어셈블리로 코딩하는지
못봤지만... 답이 제대로 잘 나오데요.
Posted By: hellcat (:)) on 'IBMPC'
Title: Re: just for fun or nightmare? (forwarded message)
Date: Sat Nov 19 13:37:58 1994
In most cases, unless you directly write ASSEMBLY code
your C compiler or some other stuff does OPTIMIZE
those calculations for you and those Buggy operations
will disappear on the resulting ASSEMBLY code.
Here's how I got the buggy result using GCC on LINUX
on my expensive buggy P5-90
824633702449.000000000000000000000000000000000000000000000000000000000000000000
0000
1.0000000000000000000000000000000000000000000000000000000000000000000000
824633705521.000000000000000000000000000000000000000000000000000000000000000000
0000
0.9999999962747095905157834749843459576368331909179687500000000000000000
The code is
#include <stdio.h>
#define C 824633702449.0
double f(double ff) { return (double) ff; }
main()
{
printf("%.70f\n",f(C));
printf("%.70f\n",f(C)/f(C));
printf("%.70f\n",f(1.0)/(f(1.0)/f(C)));
printf("%.70f\n",f(f(1.0)/f(C))*f(C));
}
double f(double) is used to avoid any optimization
so it generate assembly code as I instructed.
*********************************************
펜티움 결함여부 테스트 해주는 프로그램에서 FDIV에러가 안난다면
그 칩은 전상입니다 (7월이후 조용히 고쳐진거겠죠) (전상=>정상)
에러가 나는데 계산결과는 제대로 나온다면 계속 노력해보시기 바랍니다.:)