[PATCH, take2] implement rint{,f,l}, floor{,f,l}. ceil{,f,l}, trunc{,f,l} and nearbyint{,f,l} as x87 built-in functions

Uros Bizjak uros@kss-loka.si
Fri Aug 27 06:44:00 GMT 2004


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.



More information about the Gcc-patches mailing list