Enhance soft-fp for TFmode<->[DI,SI,TI,XF]mode conversions
Uros Bizjak
ubizjak@gmail.com
Sun Apr 22 19:22:00 GMT 2007
Hello!
This patch enhances soft-fp for TFmode<->[DI,SI,TI,XF]mode conversions.
It was tested for x86_64 target with gcc testsuite.
Regarding attached patch:
In addition to TFmode conversions to [DI,SI,TI]mode, attached patch
fixes a couple of inconsistencies in XFmode handling:
a) It is wrong to increase exponent for XFmode denormal operands during
RAW_UNPACK operation, as this causes other code to wrongly detect
denormals as normal operands. Implicit" bit (which is in fact explicit
for XFmode) is correctly handled through the code due to _FP_FRACBITS_E
definition. Also, there is no need to generate DENORMAL exception for
XFmode operands during unpack.
b) Some compile time errors were fixed on the way.
Regarding the truncation:
The TFmode-XFmode truncation is performed in semi-raw mode, where we
keep 3 LSB bits in addition to FP_FRACBITS_E. In case where EXPBIAS of
target and source operands are the same, the mantissa is shifted right
with sticky LSB. When the result is packed, UNDERFLOW and INEXACT
exceptions are generated by generic code. DENORM exception is always set
as we have denormal input operand (this is also the case without my patch).
2007-04-14 Uros Bizjak <ubizjak@gmail.com>
* soft-fp/floattisf.c: New file.
* soft-fp/floattidf.c: New file.
* soft-fp/floattitf.c: New file.
* soft-fp/floatuntisf.c: New file.
* soft-fp/floatuntidf.c: New file.
* soft-fp/floatuntitf.c: New file.
* soft-fp/fixsfti.c: New file.
* soft-fp/fixdfti.c: New file.
* soft-fp/fixtfti.c: New file.
* soft-fp/fixunssfti.c: New file.
* soft-fp/fixunsdfti.c: New file.
* soft-fp/fixunstfti.c: New file.
* soft-fp/extendxftf.c: New file.
* soft-fp/trunctfxf.c: New file.
* soft-fp/floatunsidf.c (__floatunsidf): Use DFtype instead of
double in the function declaration.
* soft-fp/floatundidf.c (__floatundidf): Use DFtype instead of
double in the function declaration.
* soft-fp/floatunsisf.c (__floatunsisf): Use SFtype instead of
float in the function declaration.
* soft-fp/floatunsisf.c (__floatunsisf): Use SFtype instead of
float in the function declaration.
* soft-fp/extended.h (FP_UNPACK_RAW_E): Do not increase X##_e for
denormal operands. Do not generate FP_EX_DENORM exception.
(FP_UNPACK_RAW_EP): Ditto.
(FP_UNPACK_SEMIRAW_E): Use FP_UNPACK_RAW_E instead of
undefined _FP_UNPACK_RAW_E.
(FP_UNPACK_SEMIRAW_EP): Use FP_UNPACK_RAW_EP instead of
undefined _FP_UNPACK_RAW_EP.
(FP_PACK_SEMIRAW_E): Use FP_PACK_RAW_E instead of
undefined _FP_PACK_RAW_E.
(FP_PACK_SEMIRAW_EP): Use FP_PACK_RAW_EP instead of
undefined _FP_PACK_RAW_EP.
* op-2.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_2.
* op-4.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_4.
2007-04-16 Uros Bizjak <ubizjak@gmail.com>
Jakub Jelinek <jakub@redhat.com>
* soft-fp/op-common.h (FP_EXTEND): Do not abort when
_FP_EXPBIAS_##dfs == _FP_EXPBIAS_##sfs. Handle denormals for
this case.
* soft-fp/op-common.h (FP_EXTEND): Ditto.
Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: soft-fp.diff
Type: text/x-patch
Size: 35290 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20070422/619c42e1/attachment.bin>
More information about the Libc-alpha
mailing list