From owner-freebsd-arm@freebsd.org Thu Oct 1 09:35:57 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09AAEA0C189 for ; Thu, 1 Oct 2015 09:35:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78D441173 for ; Thu, 1 Oct 2015 09:35:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t919Zonx078024 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 1 Oct 2015 12:35:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t919Zonx078024 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t919Zo2U078022; Thu, 1 Oct 2015 12:35:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 1 Oct 2015 12:35:50 +0300 From: Konstantin Belousov To: Stefan Parvu Cc: Andrew Turner , "freebsd-arm@freebsd.org" Subject: Re: compile kernel with hard float support Message-ID: <20151001093550.GQ11284@kib.kiev.ua> References: <560CF28F.4000908@kronometrix.org> <20151001101825.44341b74@bender> <560CFBCA.5010001@kronometrix.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560CFBCA.5010001@kronometrix.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2015 09:35:57 -0000 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;