Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Oct 2015 12:35:50 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Stefan Parvu <sparvu@kronometrix.org>
Cc:        Andrew Turner <andrew@fubar.geek.nz>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: compile kernel with hard float support
Message-ID:  <20151001093550.GQ11284@kib.kiev.ua>
In-Reply-To: <560CFBCA.5010001@kronometrix.org>
References:  <560CF28F.4000908@kronometrix.org> <20151001101825.44341b74@bender> <560CFBCA.5010001@kronometrix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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;





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151001093550.GQ11284>