From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-27.smtpout.orange.fr [80.12.242.27]) by sourceware.org (Postfix) with ESMTPS id 8E9C23858D32 for ; Fri, 25 Aug 2023 19:44:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E9C23858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jacob.remcomp.fr Authentication-Results: sourceware.org; spf=none smtp.mailfrom=jacob.remcomp.fr Received: from smtpclient.apple ([90.22.252.13]) by smtp.orange.fr with ESMTPS id ZcjoqbPjjLJHlZcjpqO40m; Fri, 25 Aug 2023 21:44:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1692992698; bh=srqlfRkSKMIpoBdUeHu/hWgMgDzyxLqPjfZk4IgDFHo=; h=From:Subject:Date:In-Reply-To:Cc:To:References; b=S8OwWMNuN4ZWg6s2KD37MqAHgl0TXVxnHvgy3rKIx2gIpQw+11d88IQWXeDbrVn5r NWmdpX2GVjYZwE2qTpJg9uItDKyq/yNZXnqicIRHhSO9ok1CFGdcpcEWc/dg0fwzOP PuFhOyHkCQZmgRj81GN8aY21jkEl1NPdM+MRAKLjEFEjGy7CIAMCSmpbhTXSJMdY/C mYYCiiJ795blw1FylBw9z0pWhgjI3IfbvC8NT/+NZOkAXZr+VLI0K0tsAkWcQzcHCs 2L2iMrNL+akNNaSPIfN4dCVTi3H3P+wHAy5hllf/ZmeJOa3SnDua1JzF/KPl5ji71y 7Oh0dB/OfT7sA== X-ME-Helo: smtpclient.apple X-ME-Date: Fri, 25 Aug 2023 21:44:58 +0200 X-ME-IP: 90.22.252.13 From: jacob navia Message-Id: <44B3B136-BE36-4D9C-AF87-B39228860B27@jacob.remcomp.fr> Content-Type: multipart/alternative; boundary="Apple-Mail=_EC5A26AE-1279-4D1B-9D27-6E4473DB886A" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: P.S. Follow up to my last post Date: Fri, 25 Aug 2023 21:44:46 +0200 In-Reply-To: <8C7981E4-01DE-4C70-92DB-6C711D95D710@comcast.net> Cc: Palmer Dabbelt , jbeulich@suse.com, binutils@sourceware.org To: Paul Koning References: <502E2019-6C30-45ED-9EE4-A5ABAABBB750@jacob.remcomp.fr> <8C7981E4-01DE-4C70-92DB-6C711D95D710@comcast.net> X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --Apple-Mail=_EC5A26AE-1279-4D1B-9D27-6E4473DB886A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I am just invoking the assembler with its default settings: ~/star64 $ as -o test.o test.s The assembler is testing the default architecture here: Function: riscv_ip for (; insn && insn->name && strcmp(insn->name,str) =3D=3D 0; insn++) { #if 0 if ((insn->xlen_requirement !=3D 0) && (xlen !=3D insn->xlen_requirement)) continue; if (!riscv_multi_subset_supports(&riscv_rps_as,insn->insn_class)) { error.missing_ext =3D riscv_multi_subset_supports_ext(&riscv_rps_as, insn->insn_class); continue; } #endif The #if 0/#endif were added by me. I think those tests do not belong here. = The assembler should assemble and not test if the instruction is legal. If = the instruction is illegal the program will crash at run-time, something no= t that unusual if you are programming in assembler! And if you are assembling compiler output, it is up to the compiler to furn= ish the correct instructions. Tiny-asm doesn=E2=80=99t test any instruction compliance and that is why it= works out of the box! Jacob > Le 25 ao=C3=BBt 2023 =C3=A0 19:03, Paul Koning a= =C3=A9crit : >=20 >=20 >=20 >> On Aug 25, 2023, at 12:10 PM, jacob navia wrote: >>=20 >> OK. >> 1) We agree that the -march=3Drv64gc_zbb option is completely undocument= ed and impossible for the user to know. >> 2) We agree that =C2=AB gnu gas =C2=BB is an assembler whose duty is to = assemble instructions. But =C2=AB gas =C2=BB will refuse to assemble those = instructions.=20 >> Why is that? It is the responsibility of the programmer or the compiler = to write the instructions that are present in this or another machine.=20 >> Why the assembler thinks it is necessary to forbid some instructions??? >=20 > It's reasonable for the assembler to enforce ISA variations, based on wha= t it's told in the -march switch. If so, then (a) gcc has to pass that swi= tch, and (b) gcc can't add a variant that gas doesn't know about. >=20 > Is that the case here? Are you invoking the assembler manually or having= it done for you by gcc? If the former, the -march switch is your responsi= bility; if the latter, then gcc is responsible for getting it right. >=20 > paul --Apple-Mail=_EC5A26AE-1279-4D1B-9D27-6E4473DB886A--