This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] standard_80387_constant_p improvements
On Sat, Feb 15, 2003 at 04:20:28PM -0700, Roger Sayle wrote:
> To check the correct bit patterns, I also used the following code:
>
> #include <stdio.h>
>
> long double x;
>
> long double lg2() { return 0.3010299956639811952256464283594894482L; }
> long double ln2() { return 0.6931471805599453094286904741849753009L; }
> long double l2e() { return 1.4426950408889634073876517827983434472L; }
> long double l2t() { return 3.3219280948873623478083405569094566090L; }
> long double pi() { return 3.1415926535897932385128089594061862044L; }
>
> void dump(unsigned char *ptr)
> {
> int i;
>
> for (i = 0; i < sizeof(long double); i++)
> printf("%02x ",ptr[i]);
> printf("\n");
> }
>
> int main()
> {
> x = lg2(); dump((unsigned char*)&x);
> x = ln2(); dump((unsigned char*)&x);
> x = l2e(); dump((unsigned char*)&x);
> x = l2t(); dump((unsigned char*)&x);
> x = pi(); dump((unsigned char*)&x);
> return 0;
> }
>
> which once again produces identical output with and without my patch.
> I checked with -S that all five functions use the x87 opcodes with,
> and an explicit fld without.
That certainly counts as verifying.
The whole patch is ok as-is.
r~