This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, take2] implement rint{,f,l}, floor{,f,l}. ceil{,f,l},trunc{,f,l} and nearbyint{,f,l} as x87 built-in functions
- From: Uros Bizjak <uros at kss-loka dot si>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Roger Sayle <roger at eyesopen dot com>
- Date: Fri, 27 Aug 2004 07:55:26 +0200
- Subject: Re: [PATCH, take2] implement rint{,f,l}, floor{,f,l}. ceil{,f,l},trunc{,f,l} and nearbyint{,f,l} as x87 built-in functions
- References: <412C7BAF.9060407@kss-loka.si> <20040825190416.GA1230@redhat.com> <412DC088.90706@kss-loka.si> <20040826174558.GC5543@redhat.com>
Richard Henderson wrote:
There is no "length" attribute added yet.
You need to get that in there. Mistakes here lead to ICEs with
the use of the loop instruction.
I guess it is OK to mark frndintxf2 insn pattern as "type" "fpspc" (as
it was before). For new frndintxf2_* new "frndint" type is defined,
almost equal to "fistp", but defines "memory" attribute to "load" only.
So "frndint" type defines "unit" attribute to "i387", "length" to 16 and
"memory" to "load".
+ /* generate exception for nearbyint() */
The comment should be "mask precision exception". I think
maybe that was part of my confusion before.
Uh... I forgot to fix this. I also think that better name for new insns
in frndintxf2 (_two_ XF parameters are taken), and "frndintxf2_mask_pm"
for PM masking instructions.
BTW: I387_CW_UNINITIALIZED was redundant, MODE_NEEDED could then
simplify to:
#define MODE_NEEDED(ENTITY, I) \
(GET_CODE (I) == CALL_INSN \
|| (GET_CODE (I) == INSN && (asm_noperands (PATTERN (I)) >= 0 \
|| GET_CODE (PATTERN (I)) == ASM_INPUT))\
? I387_CW_ANY \
: recog_memoized (I) < 0 \
? I387_CW_ANY \
: get_attr_i387_cw (I))
Otherwise it looks ok.
Thanks, I will post final patch for review as soon as "make bootstrap"
finishes.
Uros.
- References:
- [PATCH] implement rint{,f,l}, floor{,f,l}. ceil{,f,l}, trunc{,f,l}and nearbyint{,f,l} as x87 built-in functions
- Re: [PATCH] implement rint{,f,l}, floor{,f,l}. ceil{,f,l}, trunc{,f,l} and nearbyint{,f,l} as x87 built-in functions
- [PATCH, take2] implement rint{,f,l}, floor{,f,l}. ceil{,f,l}, trunc{,f,l}and nearbyint{,f,l} as x87 built-in functions
- Re: [PATCH, take2] implement rint{,f,l}, floor{,f,l}. ceil{,f,l}, trunc{,f,l} and nearbyint{,f,l} as x87 built-in functions