On Mon, 14 Apr 2008 22:41:36 -0400, "Daniel Jacobowitz" <[EMAIL PROTECTED]>
said:
> On Tue, Apr 15, 2008 at 12:33:38PM +1000, Hasjim Williams wrote:
> > Hello all,
> > 
> > I've been working on MaverickCrunch support in gcc, and could never get
> > a completely working glibc (with-fp), since there is no soft-float sqrt
> > libcall function.  This is a big problem for MaverickCrunch as there are
> > no hard div or sqrt opcodes.
> > 
> Can you be more specific about the actual problem?  I don't see why
> there needs to be an __aeabi_sqrt; sqrt is a function in libm.

Both FPA and VFP coprocessors implement sqrt opcodes:

arm.md:

(define_expand "sqrtsf2"
  [(set (match_operand:SF 0 "s_register_operand" "")
        (sqrt:SF (match_operand:SF 1 "s_register_operand" "")))]
  "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
  "")

fpa.md:

(define_insn "*sqrtsf2_fpa"
  [(set (match_operand:SF 0 "s_register_operand" "=f")
        (sqrt:SF (match_operand:SF 1 "s_register_operand" "f")))]
  "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FPA"
  "sqt%?s\\t%0, %1"
  [(set_attr "type" "float_em")
   (set_attr "predicable" "yes")]
)

vfp.md:


(define_insn "*sqrtsf2_vfp"
  [(set (match_operand:SF    0 "s_register_operand" "=t")
        (sqrt:SF (match_operand:SF 1 "s_register_operand" "t")))]
  "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
  "fsqrts%?\\t%0, %1"
  [(set_attr "predicable" "yes")
   (set_attr "type" "fdivs")]
)

Now, when you build glibc configured "--with-fp", you won't use the
generic glibc/soft-fp functions, only those in gcc, i.e. the above. 
Only if you configure glibc "--without-fp" will it not use the above
opcodes, but the soft-fp sqrt etc.

Reply via email to