This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, soft-fp]: Use mode(word) as a return type from soft-fp comparisons


Daniel Jacobowitz wrote:
On Sat, Jun 09, 2007 at 11:05:18AM +0200, Uros Bizjak wrote:
Hello!

This patch fixes the problems exposed with the testcase below. The problem is, that soft-fp functions return int value, where gcc expects the return from soft-fp functions to be in word mode. On x86_64 target, word_mode equals DImode, where int equals SImode, leading to comparison failures for certain class of input operands.

Isn't someone (Andreas Krebbel?) trying to eliminate uses of
mode((word))?

Yes, but regarding soft-fp compares, we have this comment in config/fp-bit.h:


/* The type of the result of a floating point comparison.  This must
  match `word_mode' in GCC for the target.  */
#ifndef CMPtype
typedef int CMPtype __attribute__ ((mode (word)));
#endif

And gcc indeed expands the check for returned variable in word_mode (DImode on x86_64).

The problem is, that glibc emits FP comparison return tristate as "int". soft-fp from glibc is currently not compatible with gcc expansion on targets, where word_mode != int.

Here is a $1m question:

Which part is to be fixed?

a) gcc+libgcc should be converted to return (libgcc) and to expect (gcc) "int" from soft-fp comparisons.
b) soft-fp from glibc should convert soft-fp functions to return word mode


Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]