From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id 74D0F389680B for ; Fri, 15 Jan 2021 20:36:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 74D0F389680B Received: by mail-pj1-x102f.google.com with SMTP id b5so5891313pjl.0 for ; Fri, 15 Jan 2021 12:36:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=plYPPk+YbCMFFFn03CGZWd6h9Rz0j8cpo/Gp8l1d/MY=; b=lQd6hwhuXpfoZf/sw/XH+v96nnwBPWluLct5+ue7uNCrw6Y63/YTSFg5H9WUZVI9el zijW2iK6dbx317kkiyEAf3jCqKCwgQ0qrjrNxUHHCyr/7nwDMuwH++8k5V0r7tCXghSE RSrTomABSH58L1dbxlZ1qgsX9VzPy1YOdkLNJRl2iTM2ZKM7tQLM8SfkZVhscbcRlJ1R c3e3cCB5CUYlidjPbf+51kJhUZ1MB6rJQ0/3lG8lRvxwdCWDRDFhgQpdtTmvORxA8AhF yuwP2t1sE7vhwXLfygBvsJ9K8zafLi8RG9vIFzEMQHwPXNSJmjbTrLml6+TQGCU0Jj8c Tlow== X-Gm-Message-State: AOAM533GNjIRxvMnwCJCrB4b2Pu+5KDHIlZOViP5QTEAQocc+epTdvxl vf/H1ajMB32asxkMizmemoc= X-Google-Smtp-Source: ABdhPJw3qhGR0ofYRyP2Y2ycNRKzGt9BpqtQtTWMcsRwpLHLHHt9PqhrQ4M1wFv43K/yobI6uQ/3lw== X-Received: by 2002:a17:902:bf44:b029:da:d0ee:cef with SMTP id u4-20020a170902bf44b02900dad0ee0cefmr14249694pls.12.1610742978450; Fri, 15 Jan 2021 12:36:18 -0800 (PST) Received: from [192.168.6.101] (c-71-197-179-6.hsd1.wa.comcast.net. [71.197.179.6]) by smtp.gmail.com with ESMTPSA id n128sm9408580pga.55.2021.01.15.12.36.17 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Fri, 15 Jan 2021 12:36:18 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: apple silicon fortran From: James Secan In-Reply-To: <3FFC9C05-CB2C-4DB6-874D-B263EDE04533@googlemail.com> Date: Fri, 15 Jan 2021 12:36:17 -0800 Cc: Fortran List Content-Transfer-Encoding: quoted-printable Message-Id: <6ABAD9B2-B89D-48A3-8954-A41415D05B14@gmail.com> References: <941045F7-9782-408B-BF5A-015E2FAF246A@monash.edu> <7FCF49F0-EA95-44F1-B5B6-01393378783E@gmail.com> <1ED16F62-4E5F-4EC1-9CD6-3E5A59A6C415@googlemail.com> <291F2ED7-BFF4-4F8C-A902-62231FB75425@gmail.com> <3FFC9C05-CB2C-4DB6-874D-B263EDE04533@googlemail.com> To: Iain Sandoe X-Mailer: Apple Mail (2.3124) X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 20:36:21 -0000 Iain, Thanks for the update and all the work. I=E2=80=99m looking forward to = seeing all this working natively on Apple=E2=80=99s new architecture. Jim Seattle, WA > On Jan 12, 2021, at 2:13 PM, Iain Sandoe = wrote: >=20 > Hi Folks, >=20 > Iain Sandoe via Fortran wrote: >> James Secan wrote: >>>> On Jan 9, 2021, at 11:07 AM, Iain Sandoe via Fortran = wrote: >>=20 >>>> I am testing out the Rosetta 2 alternative (which is, AFAIU, a = binary-conversion done at install-time native on macOS). >=20 > OK so I haven=E2=80=99t yet found a way to trigger the install-time = translation, perhaps it only works on a fully packaged and signed app. >=20 > - however, the =E2=80=9Con demand=E2=80=9D conversion clearly works. >=20 >>> I am interested to hear the results of your testing with Rosetta 2. >>=20 >> I bootstrapped x86_64-apple-darwin20 on aarch64-darwin20.3, and = currently running the Fortran testsuite - it=E2=80=99s not clear to me = if some of the issues (PIE and no-executable stack) will be sidestepped = or not. We shall see. >=20 > Summary : some pretty good parts, but not enough to be a drop-in = replacement. >=20 > [ disclaimer : the testsuite is somewhat =E2=80=98noisy=E2=80=99 at = the moment, we have some tidying to do before release=E2=80=A6] >=20 > here=E2=80=99s the native (x86_64-darwin20, on an Intel skylake = processor): >=20 > https://gcc.gnu.org/pipermail/gcc-testresults/2021-January/644184.html >=20 > here=E2=80=99s the same branch bootstrapped for aarch64 and x86_64 = using Rosetta 2 on an A12Z processor (I don=E2=80=99t have access to an = actual M1 yet). >=20 > = https://github.com/iains/gcc-darwin-arm64/issues/30#issuecomment-758890255= >=20 > =E2=80=94 inferences and testing: >=20 > * It seems that Rosetta 2 + whatver sandboxing is in place is allowing = diabling PIE (which means that PCH works again) but *NOT* allowing = executable stack, which means that [GCC default implementation] nested = functions are still broken (and gfortran uses nested functions =E2=80=98un= der the hood=E2=80=99 so to speak) >=20 > * informal testing on a couple of random Fortran benchmarks I have on = that machine suggest that the binary translation gives pretty good = performance for numerically intensive stuff (but again, disclaimer - = that was [a] on an A12Z and [b] not carried out in any strictly = controlled manner). OTOH, I expect it=E2=80=99s not completely = misleading. >=20 > Conclusion. >=20 > Rosetta 2 + Arm64 is not a drop-in replacement for x86_64 gfortran, we = still need an ABI-compliant solution to the nested function issue - I do = have an idea - but it isn=E2=80=99t a stage4 kind of thing. >=20 > If your machine breaks and you have to replace it, or your employer = requires you to use an arm64 model, then I would suggest that the native = branch is probably a better bet in the short-term - that has a = workaround for the nested function issue (but that can give challenges = in interworking with C, although those might not be insurmountable) .. >=20 > We=E2=80=99ll get there, I am sure - but not this week ;) >=20 > cheers > Iain >=20