This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH, soft-fp]: Use mode(word) as a return type from soft-fp comparisons
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: libc-alpha at sourceware dot org, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 11 Jun 2007 18:26:14 +0200
- Subject: Re: [PATCH, soft-fp]: Use mode(word) as a return type from soft-fp comparisons
- References: <466A6D4E.4050502@gmail.com> <20070611155115.GA10626@caradoc.them.org>
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.