compile kernel with hard float support

Konstantin Belousov kostikbel at gmail.com
Thu Oct 1 09:35:57 UTC 2015


On Thu, Oct 01, 2015 at 12:24:26PM +0300, Stefan Parvu wrote:
> 
> > No, armv6 is built with softfp. This means the compiler is free to use
> > the VFP, but when passing floating-point data between functions it
> > needs to copy this to the general-purpose registers.
> > 
> > Even without this the helper functions detect the presence of the VFP
> > unit and make use of this when available.
> 
> right. Got it. Thanks for explanation.
> 
> 
> > The kernel doesn't use any floating-point hardware, other than to
> > enable and disable it in the VFP driver. As such it doesn't matter if
> > you've built the kernel for hard-float or not, it will make no
> > difference to the code generated.
> 
> ok, I see. Ok this probable wont make any difference to my case.
> Right. 10 x thanks.

The issue, apparently, in the initialization of the VFS state.
I do not quite understand why ARM is set to flush to zero.  Both C and 
IEEE FP standard expect that denormals work.

The following patch worked for me WRT perl t/opbasic/arith.t test 175
(perl git blead checkout).

diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index 223ad96..895a14c 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -134,7 +134,7 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
 	pcb2->pcb_regs.sf_sp = STACKALIGN(td2->td_frame);
 
 	pcb2->pcb_vfpcpu = -1;
-	pcb2->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ;
+	pcb2->pcb_vfpstate.fpscr = VFPSCR_DN;
 
 	tf = td2->td_frame;
 	tf->tf_spsr &= ~PSR_C;




More information about the freebsd-arm mailing list