GPM 1.20.1 problems

Billy O'Connor billyoc at linuxfromscratch.org
Tue Jan 21 21:00:31 PST 2003


bdubbs at swbell.net (Bruce Dubbs) writes:

> I think I found it. In math.h we have:
>
> #ifdef __USE_EXTERN_INLINES
> # include <bits/mathinline.h>
> #endif
>
> in bits/mathinline.h we have:
>
> extern __inline double ceil (double __x)
> { register long double __value;
>   __volatile unsigned short int __cw;
>   __volatile unsigned short int __cwtmp;
>   __asm __volatile ("fnstcw %0" : "=m" (__cw));
>   __cwtmp = (__cw & 0xf3ff) | 0x0800;
>   __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
>   __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
>   __asm __volatile ("fldcw %0" : : "m" (__cw));
>   return __value;
> }
>
> Which substitues inline assembly for the ceil function.  gcc must
> define __USE_EXTERN_INLINES when the -O1 or above optimizations are
> used.  You could force it in -Os by defining before including math.h.
> Note that calling the functon in glibc *does* decrease the size of the
> executable by about nine instructions but defining the var increases
> program size.

Good eye.  What you'll really love is, I can only reproduce the
problem with gcc 3.2.1.  When I used different versions of gcc, the
assembler output of gcc -S was identical.  I tested 3.2, 3,3(cvs) and
3.4(HEAD).

Billy
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message



More information about the blfs-dev mailing list