From owner-freebsd-arm@freebsd.org Wed Jul 10 20:47:37 2019 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E73215E34B2 for ; Wed, 10 Jul 2019 20:47:37 +0000 (UTC) (envelope-from adr@SDF.ORG) Received: from mx.sdf.org (mx.sdf.org [205.166.94.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx.sdf.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68D8C71889; Wed, 10 Jul 2019 20:47:36 +0000 (UTC) (envelope-from adr@SDF.ORG) Received: from sdf.lonestar.org (IDENT:adr@sdf.lonestar.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id x6AKlYo7018211 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Wed, 10 Jul 2019 20:47:34 GMT Date: Wed, 10 Jul 2019 20:47:34 +0000 (UTC) From: adr X-X-Sender: adr@sdf.lonestar.org To: Ian Lepore cc: freebsd-arm@freebsd.org Subject: Re: FreeBSD arm EABI5 documentation? In-Reply-To: <1788e13e706b9fdaf610e4ddd671a5ed715f9dfe.camel@freebsd.org> Message-ID: References: <1788e13e706b9fdaf610e4ddd671a5ed715f9dfe.camel@freebsd.org> User-Agent: Alpine 2.21 (NEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 68D8C71889 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [0.78 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.77)[-0.766,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.78)[-0.784,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[SDF.ORG]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.89)[0.889,0]; IP_SCORE(-0.45)[ip: (-1.44), ipnet: 205.166.94.0/24(-0.72), asn: 14361(-0.05), country: US(-0.06)]; MX_GOOD(-0.01)[cached: mx.SDF.ORG]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[20.94.166.205.list.dnswl.org : 127.0.10.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:14361, ipnet:205.166.94.0/24, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2019 20:47:37 -0000 On Wed, 10 Jul 2019, Ian Lepore wrote: > That's... odd. The arm spec requires the stack to be 8-byte aligned at > any public interface. It's hard to imagine how anything could work > properly if it were not, given that the toolchains will assume that 64- > bit values are aligned at 64-bit boundaries and will thus generate > instructions that require that alignment (require it even if strict > alignment checking for most instructions is disabled in the control > register). If you could enter a function with the stack only 4-byte > aligned, how would the compiler know it's safe to use something like an > LDREXD instruction on a local variable allocated on the stack? I have no idea. The only thing I can assure you is that in the code I'm talking about (a forth implementation using SDL2) I've never aligned the C stack when passing arguments to external functions. Until now!