This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM] Lack of __aeabi_fsqrt / __aeabi_dsqrt (sqrtsf2 / sqrtdf2) functions
- From: "Hasjim Williams" <futaris at futaris dot org>
- To: "Daniel Jacobowitz" <drow at false dot org>, "Hasjim Williams" <gcc at futaris dot org>
- Cc: gcc at gcc dot gnu dot org, "Nicolas Pitre" <nico at cam dot org>, "Richard Earnshaw" <rearnsha at arm dot com>
- Date: Tue, 15 Apr 2008 12:58:40 +1000
- Subject: Re: [ARM] Lack of __aeabi_fsqrt / __aeabi_dsqrt (sqrtsf2 / sqrtdf2) functions
- References: <1208226818.19561.1247900047@webmail.messagingengine.com> <20080415024136.GA1846@caradoc.them.org>
On Mon, 14 Apr 2008 22:41:36 -0400, "Daniel Jacobowitz" <drow@false.org>
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.