From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Henderson To: "H.J. Lu" Cc: Richard Kenner , rth@cygnus.com, egcs@cygnus.com Subject: patch for HJ's alpha isinff problem Date: Mon, 16 Feb 1998 15:58:00 -0000 Message-id: <19980216160331.34598@dot.cygnus.com> References: <9802161123.AA20638@vlsi1.ultra.nyu.edu> X-SW-Source: 1998-02/msg00783.html > > int isinff(float x) > > { > > int32_t ix,t; > > ieee_float_shape_type gf_u; > > gf_u.value = x; > > ix = gf_u.word; > > if (ix == 0) [...] > > stt $f16,16($30) > > ldq $4,16($30) > > addl $4,$31,$1 > > bis $1,$1,$9 This is clearly bad code, since values are stored in floating point registers in DFmode format, an SFmode store is required to get it out again. The bit pattern placed in $1 bears no resemblance to the SFmode value that was desired. The problem is that combine is not obeying CLASS_CANNOT_CHANGE_SIZE. Here is a patch that fixes what is exposed by HJ's test case, though I am sure there are other places that are still broken. The patch is against egcs current, but it applies correctly to 2.8.1 with a little fuzz. There is a small optimization in reload that could be made that is exposed by this patch, in that it generates ldl $2,15($30) addl $2,$31,$1 The sign extend is of course redundant. We ought to teach reload to look for a sign-extending load pattern, but I don't attempt that here. r~