From owner-freebsd-toolchain@freebsd.org Sat Sep 9 19:37:43 2017 Return-Path: Delivered-To: freebsd-toolchain@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 4C304E04D57 for ; Sat, 9 Sep 2017 19:37:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B47D75658 for ; Sat, 9 Sep 2017 19:37:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id d16so11342473ioj.3 for ; Sat, 09 Sep 2017 12:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hNgamjOla/fUYYmfjkSsuJufKvKKpBKx38Yz73F+9QM=; b=n8+vNeQNjo6eqqsDr03vDmUX3hTi1DCu64MRoalSJtskVP0OC1/u49ikZnKnABEh3m hnzQS6CG1jQvkVZq/MoLsW6QQfKYu9sUzjEkvn787/myC3Ogb/zp0Bxv9Dni6j2uT09r A3+GAI4ji+cdSKLS4GxCyofhuGiORWnoB4v8vhJUiOMNbvCjovd3RmJ41kWIA9wQpbiz eUIE78xKM7R5t+QeCAQv9GS9r37LbG1o2PlnaouB9FX47K9AWMW/KRcKDHL88VPsnjva jNfBEMzEzkPJk25ftQXcRQFws9rbBr4OkPKUsGTgzd8ME6KLFJ8iLxrMQcF1lD6bELDZ JaoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hNgamjOla/fUYYmfjkSsuJufKvKKpBKx38Yz73F+9QM=; b=qIXhLFYKMM8zxIaG0TQiQ19mDvXrJULzQtnl2rhAtotl5cRTb/VWfQys/EjusTTK7/ TCFMUliu3RceYZTD2nTfAadNDFtNihl3z2dcF1f2k27v8fOUGJBGFwuMlmgLYWQTJAZv UWMJN0rfsv6Y7wFmAkYLW4xa05zNdungFVJmwUb06QHDOFKYNTR6muIHx6yOI6FCmAID C9dN31c6Bn8G6ehAUUoUkl6NdxFxvqhFawzHZvG29OGjvVEYAqRGrSt9f7n00uiBfLQ+ lYLy3MgF/79+IBwCn7obdnCX638tA3O2A1r+Rs0TTLlu1vOh0YrzttY3CfGdHeWN1Fen b0IQ== X-Gm-Message-State: AHPjjUjsxp5p7JdIXWd0VGCco6QtuYi4Sa+CorhNxZCDVzXtnIaHE+yd SpEiJMQZPw5MMn843JBVIYyNRf5/vfYz X-Google-Smtp-Source: ADKCNb4AJesL/DbFzhMF7oAJUl8UoISnGkWzT3UV/cNiZ+IGD4YgmZoRc0dOIrd7zqx3+Lpf4spgH0pm6dvSdBs3mvE= X-Received: by 10.107.133.92 with SMTP id h89mr2169841iod.208.1504985862229; Sat, 09 Sep 2017 12:37:42 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Sat, 9 Sep 2017 12:37:41 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:d5ae:f1f3:42c8:b0f7] In-Reply-To: References: From: Warner Losh Date: Sat, 9 Sep 2017 13:37:41 -0600 X-Google-Sender-Auth: S-uaDnKzj6IxnJFRcCFJxdspke0 Message-ID: Subject: Re: FCP-100: armv7 plan To: Jan Beich Cc: Jan Beich , "freebsd-arm@freebsd.org" , "freebsd-toolchain@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Sep 2017 19:37:43 -0000 On Sat, Sep 9, 2017 at 1:25 PM, Jan Beich wrote: > Warner Losh writes: > > > On Sat, Sep 9, 2017 at 1:05 PM, Jan Beich wrote: > > > >> Warner Losh writes: > >> > >> > Greetings, > >> > > >> > This will serve as 'Last Call' for any objections to the plan to > create > >> an > >> > armv7 MACHINE_ARCH in FreeBSD, as documented in FCP-0100. > >> [...] > >> > >> Some ports want NEON support but FCP-0100 is vague about > FreeBSD-specific > >> differences between armv6 and armv7. Clang appears to enable NEON for > all > >> *-gnueabi* targets but I have no clue about GCC. Apparently, Android and > >> Debian don't assume NEON on armv7. > >> > >> related: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221898 > >> > > > > Yes. We are vague about it on purpose. Just like we're vague about MMX, > > MMX2, etc on x86 because different processors can/want use different > > things. > > Do you mean similar to how FreeBSD i386 is vague about not supporting > real i386, only i486 or later? I mean we don't enumerate the list of all the processor supported things. We default to compiling for a fairly middle of the road processor, but you can strip that back all the way to i486, or hyper optimize for the latest core-2 duo. However, armv6 vs armv7 can affect the ABI in subtle ways that's it's best to avoid by declaring the two different. One may be able to run armv6 binaries on an armv7 CPUs still, but we're not specifically guaranteeing it. > The goal, if it doesn't work already, is for NEON to work if used, > > but not be required, just like all the other optional features of a CPU. > > FreeBSD doesn't support detecting NEON at runtime unlike Linux. No, I don't mean that at all. I mean we don't care if it is enabled or not. It doesn't affect the ABI. The kernel knows about the extensions and saves the context when it's in use, just like the x86 kernel saves MMX, etc context when it's in use. Do you > mean at compile time? If so then the following probably needs to change > > $ cc -target armv7-unknown-freebsd12.0-gnueabihf -dM -E - fgrep -i neon > #define __ARM_NEON 1 > #define __ARM_NEON_FP 0x4 > #define __ARM_NEON__ 1 > Right. that's based on the default target. gcc/clang can enable or disable it (and a dozen other things) depending on what options you give. We don't care. We'll run all binaries. It's up to the system integrator to mix/match the options so they get optimal performance for their platform. Just like on x86. If you compile for MMX and run it on 486 w/o run-time detection, you'll get a reserved instruction fault. Same philosophy here. We don't dictate policy for the binaries, just like on x86. However, most of them have run-time detection to be nicer to the users than a core dump, and most do the best thing for that CPU if they really care about performance, but those applications that don't can just do whatever and be fine. Warner