[U-Boot] soft vs. hard float

Wolfgang Denk wd at denx.de
Fri Nov 8 16:31:11 CET 2013


Dear "Saridakis, Dean (US SSA)",

please keep the ML on Cc:, and please do not top-post / full quote.
Finally, please keep your line length < 70 characters.  Thanks.


In message <cmu-lmtpd-15886-1383921355-5 at frontend1.mail.m-online.net> you wrote:
> Figured I'd ask. FWIW, I have no intention of number crunching in U-Boot, but do need to do 64-bit store operations. Being able to do a stfd on PowerPC can be very handy, but MSR[FE] must be set.
...
> > hard-float in my system. Is this a general enough need that it'd make
> > sense to have a CONFIG_SYS_HARD_FLOAT to enable this option?
> 
> This makes no sense.  U-Boot does not use any FP operations at all.
> 
> > I made a quick update for mpc85xx (guarded by CONFIG_SYS_HARD_FLOAT)
> > and I seem to be running fine.
> 
> U-Boot does not (and will not) support FP.  If you want to do number
> crunching, then start an OS.

Agreed.  Usually we solve this by using dedicated assembler code. See
for example board/cu824/flash.c, board/cpc45/flash.c, or
board/ppmc7xx/flash.c:

	static void write_via_fpu(vu_long *addr, ulong *data)
	{
		__asm__ __volatile__ ("lfd  1, 0(%0)" : : "r" (data));
		__asm__ __volatile__ ("stfd 1, 0(%0)" : : "r" (addr));
	}

No need for any FP support in the tool chain...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If you own a machine, you are in turn owned by it,  and  spend  your
time serving it..."    - Marion Zimmer Bradley, _The Forbidden Tower_


More information about the U-Boot mailing list