This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, take2] implement rint{,f,l}, floor{,f,l}. ceil{,f,l},trunc{,f,l} and nearbyint{,f,l} as x87 built-in functions


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.


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