Message ID | 2316ac5c-7870-4b46-9c80-eaecaef93a31@suse.com |
---|---|
Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9FCD3858289 for <patchwork@sourceware.org>; Mon, 27 Jan 2025 15:24:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9FCD3858289 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=HMrqzlnl X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 5BF1B3858431 for <binutils@sourceware.org>; Mon, 27 Jan 2025 15:23:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5BF1B3858431 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5BF1B3858431 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737991428; cv=none; b=C9c4SEPUjRxaorI3fSsbSRJo4stiplSeGLJbG9A+Or/c84epDpb2hvrjBc4tSZ31/mGx1YLgEsDpXjToJ/ydFr+EatYXAi4QRKKjTj9y3kk3zNTG8sVDuU4NSZocBSNejJXFFF5cjv3GXGEXFkxcubDkEQnO1DLf9pB/cmznEhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737991428; c=relaxed/simple; bh=GxiR8nDoD5k4RJHxVP60vdYqOs5ohfHHfJyuMCAkbOc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=m2uaw/nxaxguearnUUFXb2IGrQsc7snVvxusvQCRGVDbN4N61WfC251Jt450WHLsVLD1V8LxOwJhUjmsYaVKsLy7biBuLS6zcaIa6bktJVZUp+uTS2ZGertRrDrkJD54eJrJHZlZ8ehsVvqGLMI6kAvQzInF9ds5UxIdviDXvJ8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BF1B3858431 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d3d143376dso6460945a12.3 for <binutils@sourceware.org>; Mon, 27 Jan 2025 07:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1737991424; x=1738596224; darn=sourceware.org; h=content-transfer-encoding:autocrypt:content-language:to:subject :from:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=GxiR8nDoD5k4RJHxVP60vdYqOs5ohfHHfJyuMCAkbOc=; b=HMrqzlnlJVOjFKgYkHPhTcdVD6XqJPi/qaPjVb0yatYkatIJlYvS8lNBX/aqxok2wU /b41asRqlgHhfB2AY9lLo8mOAYCmsYrzKvDLKZ0/7LDrFrylUCQHUe1mupML8/xP37Mn DQAd8N5wUunDtBlS8tzU6If5Vg+vh5cvIki8ZXHvHiaQeeAHmAn639lzA7Nr3VNluZUA 0uSdS5b7Ymc370FpjFdSq9vw0dmT8qo/t8VlXhhoBxXL/R6sznhb0zBJCrAEbSo+5gqP FsBUHW1ZG0v5Y19AF26sF+H0D3b3S18dU8/RUmNKWd9NgnvO7CkkDxDiYFoW5W7Zn2SE TmEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737991424; x=1738596224; h=content-transfer-encoding:autocrypt:content-language:to:subject :from:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=GxiR8nDoD5k4RJHxVP60vdYqOs5ohfHHfJyuMCAkbOc=; b=fq6U1EOQF1LzX3LSN5BH7e1iU061fGbmk1Ixs4yyAuS/ZfcuufIubzMAu9kWy1woNC 2IISxQNCXB/pCUEhtaR+0H7VehBvBcdC7AFon3I/zRaHCmC3AXRA1ggzYvWESPLAQPnO CB26CY21tORlq+GkJmh0pwmcBmP50nA44tEjwfyE1NbGS5Rm1gRU12juDEHKgV2IIOsB eKkyBqurWyMkg38a7sYAZG7yNc9z7Gr2+mAGXcWjCB1CxsOJ8VeDeqR5s9sDtJYrK8Ns 5BZk+bclcFtxvTngsIoJTVdQrQSplAxqo6InR9I0TZOjTg8Kru24r2gPIdQOss0bYmfH 3vcQ== X-Gm-Message-State: AOJu0YypFZlzcYYrcp5b8ADTzuMGNSPBWGIeixyjCFTYGMS9GY2eXeMu o57UhbXbNXd9h+N5ifdELeaJMdio65MqY5yy50Wl/KIqV7sF6SjnbK3O5ZaEzrG8qiX8p/9arxM = X-Gm-Gg: ASbGncv6oH26Q5GilYm6cDnuAVlG0jSI/Sd1vmpd5CEO7tmTxsEH0jjzkqGOFZfNDCJ Ph+ah41WtkEXFziYo4Si/9XPvnv0s6YBG7aMt6by1sWOXSrq3X4/D+e0wMGcYUNznF0YRSf6MKs cJq6PdR2IWMdXtgmud45xLDACa5oA5pUx/UbY+oYrEKsxdGZ3Rg+0yD16acMZ0H2Vvxq6Qa+oUT 8GjpgmtpPCqpHBhYk2ZpS9QF5zNlClJ5IwNaZOVtbY+PYTTnUVjCWUp2UYG2g7qJzkCdT5aFnCw 3RuBDsiw4eEOxje+4LjxmaS8fiur5KgrBm6OGU/mIXb6ORD+GHOWqoo11QOHyEootQ== X-Google-Smtp-Source: AGHT+IHSOANStkY6Wg75Mo2/D6iFN7GEZiO1rO0cbq8DbizYMkKjxsymAxF7a+l61GCiv9/OchYmhQ== X-Received: by 2002:a05:6402:35c2:b0:5db:f4fc:89fc with SMTP id 4fb4d7f45d1cf-5dbf4fc8d07mr19555629a12.0.1737991424091; Mon, 27 Jan 2025 07:23:44 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc186289bdsm5595653a12.24.2025.01.27.07.23.43 for <binutils@sourceware.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2025 07:23:43 -0800 (PST) Message-ID: <2316ac5c-7870-4b46-9c80-eaecaef93a31@suse.com> Date: Mon, 27 Jan 2025 16:23:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jan Beulich <jbeulich@suse.com> Subject: [PATCH v2 00/65] gas: whitespace handling To: Binutils <binutils@sourceware.org> Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3022.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
Series |
gas: whitespace handling
|
|
Message
Jan Beulich
Jan. 27, 2025, 3:23 p.m. UTC
As per observations in target specific code there appears to be disagreement across the assembler whether to check for specific characters (blank and tab normally) or whether to use ISSPACE(). As agreed upon during the Cauldron in Prague, switch to a single base construct for all code to use: is_whitespace(). It clearly is an alternative option to have is_whitespace() expand to ISSPACE() or ISBLANK() (ISSPACE() also yields "true" for characters we don't really consider whitespace), then (obviously) leaving out the last patch. See also the CR_EOL uses in read.c and app.c. I think it is advisable though that is_whitespace() and is_end_of_{line,stmt}() be non-overlapping; question then is what (further) characters to tag as LEX_WHITE (see remarks in patch 01). Along with recently (as of the v1 submission) committed work for x86 this appears to be sufficient to actually use -f (or #NO_APP at start of file) for gcc-generated code. I didn't properly check other architectures yet, but I seem to recall that at least Arm32 and PPC would apparently require compiler side adjustments, too. 01: consolidate whitespace recognition 02: gas/obj-*.c: use is_whitespace() 03: Alpha/EVAX: use is_whitespace() / is_end_of_stmt() 04: arc: use is_whitespace() 05: Arm: use is_whitespace() 06: aarch64: use is_whitespace() 07: avr: use is_whitespace() 08: bfin: use is_whitespace() 09: bpf: use is_whitespace() 10: CR16: use is_whitespace() 11: cris: use is_whitespace() 12: CRx: use is_whitespace() 13: C-Sky: use is_whitespace() 14: d10v: use is_whitespace() 15: d30v: use is_whitespace() 16: dlx: use is_whitespace() 17: Epiphany: use is_whitespace() 18: fr30: use is_whitespace() 19: ft32: use is_whitespace() 20: H8/300: use is_whitespace() 21: HP-PA: use is_whitespace() 22: kvx: use is_whitespace() 23: LoongArch: use is_whitespace() 24: m32c: use is_whitespace() 25: m32r: use is_whitespace() 26: M68HC1x: use is_whitespace() 27: M68k: use is_whitespace() 28: M*Core: use is_whitespace() 29: metag: use is_whitespace() 30: MicroBlaze: use is_whitespace() 31: MIPS: use is_whitespace() 32: MMIX: use is_whitespace() 33: mn10200: use is_whitespace() 34: mn10300: use is_whitespace() 35: Moxie: use is_whitespace() 36: msp430: use is_whitespace() 37: nds32: use is_whitespace() 38: NS32k: use is_whitespace() 39: PDP11: use is_whitespace() 40: PicoJava: use is_whitespace() 41: PPC: use is_whitespace() 42: pru: use is_whitespace() 43: RISC-V: use is_whitespace() 44: rl78: use is_whitespace() 45: rx: use is_whitespace() 46: s12z: use is_whitespace() 47: S/390: use is_whitespace() 48: Score: use is_whitespace() 49: SH: use is_whitespace() 50: Sparc: use is_whitespace() 51: spu: use is_whitespace() 52: C30: use is_whitespace() 53: C4x: use is_whitespace() 54: C54x: use is_whitespace() 55: C6x: use is_whitespace() 56: v850: use is_whitespace() 57: v850: use is_whitespace() 58: Visium: use is_whitespace() 59: wasm32: use is_whitespace() 60: x86: use is_whitespace() 61: xgate: use is_whitespace() 62: Xtensa: use is_whitespace() 63: Z80: use is_whitespace() 64: Z8k: use is_whitespace() 65: gas: suppress use of ISSPACE() / ISBLANK() Jan
Comments
Sorry for being a downer, but: > Date: Mon, 27 Jan 2025 16:23:42 +0100 > From: Jan Beulich <jbeulich@suse.com> > As per observations in target specific code there appears to be disagreement > across the assembler whether to check for specific characters (blank and tab > normally) or whether to use ISSPACE(). > > As agreed upon during the Cauldron in Prague, switch to a single base > construct for all code to use: is_whitespace(). Such decisions should be made online, with the whole community, not with the people attending a specific session at a specific event. (While I had the chance, I had no idea executive decisions were about to take place.) > It clearly is an alternative option to have is_whitespace() expand to > ISSPACE() or ISBLANK() (ISSPACE() also yields "true" for characters we don't > really consider whitespace), then (obviously) leaving out the last patch. See > also the CR_EOL uses in read.c and app.c. I think it is advisable though that > is_whitespace() and is_end_of_{line,stmt}() be non-overlapping; question then > is what (further) characters to tag as LEX_WHITE (see remarks in patch 01). > > Along with recently (as of the v1 submission) committed work for x86 this > appears to be sufficient to actually use -f (or #NO_APP at start of file) > for gcc-generated code. Does that work also clean up gcc-generated code, like dropping space after comma or multiple spaces or whatever is judged the #NO_APP behavior of "x86 assembly"? I don't see such patches but maybe they're not posted yet. It doesn't just happen to be specified as what gcc generates on the master branch of today? > I didn't properly check other architectures yet, but > I seem to recall that at least Arm32 and PPC would apparently require > compiler side adjustments, too. I can't help but thinking this is going ever so slightly in the wrong direction with regards to #NO_APP: this change-set is making that mode more lenient towards formatting; allowing more types of space characters. With the few targets that have #NO_APP active in gcc-generated code, you have the chance of making that mode more strict. brgds, H-P
On 28.01.2025 03:50, Hans-Peter Nilsson wrote: > Sorry for being a downer, but: > >> Date: Mon, 27 Jan 2025 16:23:42 +0100 >> From: Jan Beulich <jbeulich@suse.com> > >> As per observations in target specific code there appears to be disagreement >> across the assembler whether to check for specific characters (blank and tab >> normally) or whether to use ISSPACE(). >> >> As agreed upon during the Cauldron in Prague, switch to a single base >> construct for all code to use: is_whitespace(). > > Such decisions should be made online, with the whole > community, not with the people attending a specific session > at a specific event. (While I had the chance, I had no idea > executive decisions were about to take place.) Well, here we are online. The series hasn't been committed yet, so objections will be listened to. Albeit in objecting to certain aspects please keep in mind what the overall goal is: To make #NO_APP and the -f command line option work for more targets. And to have as uniform behavior as possible in gas across targets. As per your comment on the cris-specific patch I can't help the impression that gcc avoiding to emit TABs for this target isn't "happenstance" as you called it, but simply attributed to gas'es past behavior. >> It clearly is an alternative option to have is_whitespace() expand to >> ISSPACE() or ISBLANK() (ISSPACE() also yields "true" for characters we don't >> really consider whitespace), then (obviously) leaving out the last patch. See >> also the CR_EOL uses in read.c and app.c. I think it is advisable though that >> is_whitespace() and is_end_of_{line,stmt}() be non-overlapping; question then >> is what (further) characters to tag as LEX_WHITE (see remarks in patch 01). >> >> Along with recently (as of the v1 submission) committed work for x86 this >> appears to be sufficient to actually use -f (or #NO_APP at start of file) >> for gcc-generated code. > > Does that work also clean up gcc-generated code, like > dropping space after comma or multiple spaces or whatever is > judged the #NO_APP behavior of "x86 assembly"? I don't see > such patches but maybe they're not posted yet. It doesn't > just happen to be specified as what gcc generates on the > master branch of today? Well, what gcc presently emits needs to be accepted anyway. A goal is specifically to get -f / #NO_APP working without needing to touch target specific code in gcc, whenever possible. As said ... >> I didn't properly check other architectures yet, but >> I seem to recall that at least Arm32 and PPC would apparently require >> compiler side adjustments, too. ... here, I'm aware that some targets will require some changes, but x86 (according to my limited testing) is not among them. And those changes are expected to be of limited nature, i.e. they're for example not expected to touch *.md files al over the place. From what I was able to see, the problems there are with how #APP / #NO_APP are emitted. And btw - why would you apply different criteria to cris and x86? For cris you said what gcc emits is unwritten but de-fact standard. Yet then you question that same pre-condition to be applied to x86? > I can't help but thinking this is going ever so slightly in > the wrong direction with regards to #NO_APP: this change-set > is making that mode more lenient towards formatting; > allowing more types of space characters. With the few > targets that have #NO_APP active in gcc-generated code, you > have the chance of making that mode more strict. Have you ever wondered why it is only so few targets? Permitting TABs in compiler generated output is, as indicated in the reply to the cris-specific patch, a readability aid. That's certainly a personal view, but one I happen to know is shared by many other people. That said, I'm also aware that for various targets gcc presently avoids to make use of TABs. Of the architectures I'm half-way familiar with it's actually a minority, though (PPC and ia64 vs aarch64, Arm, RISC-V, and x86). Jan
On Mon, Jan 27, 2025 at 04:23:42PM +0100, Jan Beulich wrote: > As per observations in target specific code there appears to be disagreement > across the assembler whether to check for specific characters (blank and tab > normally) or whether to use ISSPACE(). > > As agreed upon during the Cauldron in Prague, switch to a single base > construct for all code to use: is_whitespace(). > > It clearly is an alternative option to have is_whitespace() expand to > ISSPACE() or ISBLANK() (ISSPACE() also yields "true" for characters we don't > really consider whitespace), then (obviously) leaving out the last patch. See > also the CR_EOL uses in read.c and app.c. I think it is advisable though that > is_whitespace() and is_end_of_{line,stmt}() be non-overlapping; question then > is what (further) characters to tag as LEX_WHITE (see remarks in patch 01). > > Along with recently (as of the v1 submission) committed work for x86 this > appears to be sufficient to actually use -f (or #NO_APP at start of file) > for gcc-generated code. I didn't properly check other architectures yet, but > I seem to recall that at least Arm32 and PPC would apparently require > compiler side adjustments, too. I like it, thanks!
On 28/01/2025 07:40, Jan Beulich wrote: > On 28.01.2025 03:50, Hans-Peter Nilsson wrote: >> Sorry for being a downer, but: >> >>> Date: Mon, 27 Jan 2025 16:23:42 +0100 >>> From: Jan Beulich <jbeulich@suse.com> >> >>> As per observations in target specific code there appears to be disagreement >>> across the assembler whether to check for specific characters (blank and tab >>> normally) or whether to use ISSPACE(). >>> >>> As agreed upon during the Cauldron in Prague, switch to a single base >>> construct for all code to use: is_whitespace(). >> >> Such decisions should be made online, with the whole >> community, not with the people attending a specific session >> at a specific event. (While I had the chance, I had no idea >> executive decisions were about to take place.) > > Well, here we are online. The series hasn't been committed yet, so > objections will be listened to. Albeit in objecting to certain aspects > please keep in mind what the overall goal is: To make #NO_APP and the > -f command line option work for more targets. And to have as uniform > behavior as possible in gas across targets. > > As per your comment on the cris-specific patch I can't help the > impression that gcc avoiding to emit TABs for this target isn't > "happenstance" as you called it, but simply attributed to gas'es past > behavior. > >>> It clearly is an alternative option to have is_whitespace() expand to >>> ISSPACE() or ISBLANK() (ISSPACE() also yields "true" for characters we don't >>> really consider whitespace), then (obviously) leaving out the last patch. See >>> also the CR_EOL uses in read.c and app.c. I think it is advisable though that >>> is_whitespace() and is_end_of_{line,stmt}() be non-overlapping; question then >>> is what (further) characters to tag as LEX_WHITE (see remarks in patch 01). >>> >>> Along with recently (as of the v1 submission) committed work for x86 this >>> appears to be sufficient to actually use -f (or #NO_APP at start of file) >>> for gcc-generated code. >> >> Does that work also clean up gcc-generated code, like >> dropping space after comma or multiple spaces or whatever is >> judged the #NO_APP behavior of "x86 assembly"? I don't see >> such patches but maybe they're not posted yet. It doesn't >> just happen to be specified as what gcc generates on the >> master branch of today? > > Well, what gcc presently emits needs to be accepted anyway. A goal is > specifically to get -f / #NO_APP working without needing to touch target > specific code in gcc, whenever possible. As said ... > >>> I didn't properly check other architectures yet, but >>> I seem to recall that at least Arm32 and PPC would apparently require >>> compiler side adjustments, too. > > ... here, I'm aware that some targets will require some changes, but > x86 (according to my limited testing) is not among them. And those > changes are expected to be of limited nature, i.e. they're for example > not expected to touch *.md files al over the place. From what I was > able to see, the problems there are with how #APP / #NO_APP are emitted. > > And btw - why would you apply different criteria to cris and x86? For > cris you said what gcc emits is unwritten but de-fact standard. Yet then > you question that same pre-condition to be applied to x86? > >> I can't help but thinking this is going ever so slightly in >> the wrong direction with regards to #NO_APP: this change-set >> is making that mode more lenient towards formatting; >> allowing more types of space characters. With the few >> targets that have #NO_APP active in gcc-generated code, you >> have the chance of making that mode more strict. > > Have you ever wondered why it is only so few targets? Permitting TABs > in compiler generated output is, as indicated in the reply to the > cris-specific patch, a readability aid. That's certainly a personal > view, but one I happen to know is shared by many other people. That > said, I'm also aware that for various targets gcc presently avoids to > make use of TABs. Of the architectures I'm half-way familiar with it's > actually a minority, though (PPC and ia64 vs aarch64, Arm, RISC-V, and > x86). > > Jan Out of interest, did you consider making the scrubber translate all horizontal white space characters into a single space character (as opposed to just collapsing multiple spaces into one)? This would eliminate the need for each backend to handle multiple type of space character. R.
On 28.01.2025 15:47, Richard Earnshaw (lists) wrote:
> Out of interest, did you consider making the scrubber translate all horizontal white space characters into a single space character (as opposed to just collapsing multiple spaces into one)? This would eliminate the need for each backend to handle multiple type of space character.
I guess I'm confused: How would altering scrubber behavior matter when
the scrubber is bypassed (by -f or #NO_APP)? And then: This collapsing
already is what the scrubber does (and hence why many targets were
able to get away without checking for \t, and with -f/#NO_APP known to
not be working there), aiui.
Jan
> Date: Tue, 28 Jan 2025 08:40:02 +0100 > From: Jan Beulich <jbeulich@suse.com> > On 28.01.2025 03:50, Hans-Peter Nilsson wrote: > As per your comment on the cris-specific patch I can't help the > impression that gcc avoiding to emit TABs for this target isn't > "happenstance" as you called it, but simply attributed to gas'es past > behavior. No, it's deliberate. IMHO \\t (the literally characters) makes for less readable code in the .md, and a literal TAB looks indention-wise weird (not sure if it was always valid. Compare "adcs%?\\t%0, %1, #0" to "adcs%? %0,%1,#0" (random example from arm.md). In the generated code, I guess it depends on your preference; whether columns lining up is better than the slightly extra horizontal distance. > > Does that work also clean up gcc-generated code, like > > dropping space after comma or multiple spaces or whatever is > > judged the #NO_APP behavior of "x86 assembly"? I don't see > > such patches but maybe they're not posted yet. It doesn't > > just happen to be specified as what gcc generates on the > > master branch of today? > > Well, what gcc presently emits needs to be accepted anyway. A goal is > specifically to get -f / #NO_APP working without needing to touch target > specific code in gcc, whenever possible. ...and putting the burden on the assembler to do the post-scrubber processing in your patches. IOW, while it's nice if more targets can skip the scrubbing (and joining #NO_APP actually being in effect), it's more processing once that state is entered. > And btw - why would you apply different criteria to cris and x86? For > cris you said what gcc emits is unwritten but de-fact standard. Yet then > you question that same pre-condition to be applied to x86? Different criterias for "tier-1" versus "tier-N", (N > 2) targets isn't exactly a new concept. > > I can't help but thinking this is going ever so slightly in > > the wrong direction with regards to #NO_APP: this change-set > > is making that mode more lenient towards formatting; > > allowing more types of space characters. With the few > > targets that have #NO_APP active in gcc-generated code, you > > have the chance of making that mode more strict. > > Have you ever wondered why it is only so few targets? Only once. Then I looked and found out, some 30+ years ago. :) > Permitting TABs > in compiler generated output is, as indicated in the reply to the > cris-specific patch, a readability aid. To that I'll just say: "\\t"! :-) I'll admit that's the gcc "input" - but which you seem to overlook in your readability argumentation! And with that, I see the discussion derails... > That's certainly a personal > view, but one I happen to know is shared by many other people. That > said, I'm also aware that for various targets gcc presently avoids to > make use of TABs. Of the architectures I'm half-way familiar with it's > actually a minority, though (PPC and ia64 vs aarch64, Arm, RISC-V, and > x86). ...with this "argumentum ad populum". Let's please drop the TAB vs space part of the discussion and "agree to disagree". brgds, H-P
On 28/01/2025 15:00, Jan Beulich wrote: > On 28.01.2025 15:47, Richard Earnshaw (lists) wrote: >> Out of interest, did you consider making the scrubber translate all horizontal white space characters into a single space character (as opposed to just collapsing multiple spaces into one)? This would eliminate the need for each backend to handle multiple type of space character. > > I guess I'm confused: How would altering scrubber behavior matter when > the scrubber is bypassed (by -f or #NO_APP)? And then: This collapsing > already is what the scrubber does (and hence why many targets were > able to get away without checking for \t, and with -f/#NO_APP known to > not be working there), aiui. > > Jan Sorry, it's me that's confused. I hadn't realized that was what #NO_APP did. R.