From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28163 invoked from network); 9 May 2022 19:31:29 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 9 May 2022 19:31:29 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob1.topicbox.com (Postfix) with ESMTP id 9018B2CA87 for ; Mon, 9 May 2022 15:31:27 -0400 (EDT) (envelope-from bounce.mM64323f2f5a4e8db8ea11250b.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id 8C84F2356F8B; Mon, 9 May 2022 15:31:27 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type:list-help:list-id :list-post:list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1652124687; bh=Yf2xWK91P5VJuENM CwZTZJ1P1n9NbGaa0vjU55b0jBY=; b=Mu3vMf9ZrHexZI6Ah1vBl0Ril6DnTF+I IH8mdvJTBsa/IlAgwLxSgRbLqQvFo0DF0JGlLcrMD7wwFIf8kkz3eEkRghad1W82 4+TUpVI2Mv8tGY51+qsKu4mBMZzVdk/YjJ++X/0uOZ5uRiq0X+Bt51kXgOye7eTe H7KS0mW80dc= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1652124687; b=do69pKB2Yx6miv2ZQKOryBjVdYcgDkm0mmP5nNhLAzGhflRpZL 5YjC/H/tmLjUWZG5/roWU/wa0XhLh0Mv251720OZ7vE+BTFfIleQ5v9tAV4TMjIY Jh6mMlANthGk6zb7mR5oGlB+VqzEA8T0nCFJgsb7ChDmieaU9PeU+sRys= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=date:from :to:subject:in-reply-to:message-id:references:mime-version :content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; bh=qfnbCYQnYek4E+oYGdimFiph5E4tUJJXwQvu1Ya8KAQ=; b=enzkSLfjEH6/ U90EiwQLSoe+Go2r7nJw7lRw/gcn27Qs8hWkHMZfzhvvvuWZsm9cPlc0HIFNDcIF sZtlRAoWKi/LvsNyNMiVmugWaEgyopsDqj2N7OHqXuNmP2GxMJGfSjicFP0ye5bK vr4/ldQFuXjAZtwNUKNwixwcrh2xM2E= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 0DC862356B6D for <9fans@9fans.net>; Mon, 9 May 2022 15:31:10 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id B3C5D117714; Mon, 9 May 2022 15:31:10 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1652124669; b=w7XqmUtak+o7EN9BveV4sXyRjbaItds/t1FZIDPXT+dg21qE6L g2f/HJ/765rC7HzO0CxoeVE50DKGSnz8BrotMNGDt/sYGvhLsaD/fENibYQ1wzh4 brI3i7Sl7EmETb4Z3OHNM6yL/0ClFQWw2mGwMJX8yR0L+myCaP1jcuoIR8rA/ygx Ylzojat2pBqkz6w7ghxWf5Ymoo4kpYsRLE6ppvHilTcbOTbuLAJ1ot3xnjVIBNce jEPe+NIS+lgk3OfeWL/brpRkcZ/yyUBe6TDDft4jaFqALZN/PV7gqb3BMLFZaTCS styit4ybfnU+rW+P29WbfTuTkfuY9cOIDjMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type; s=arcseal; t=1652124669; bh=U+MhXHica65jV2yzQJ6+0NTqGkjxJrb/+X+h/chM3RA=; b=I8c0Wpig2y8U MHw2fJ5eESSFMKQ6YQzj/Cr4jOD6L1zGtPsibISsKhmMxnGZn+FoaPIOK73bPdE3 IWX3Vs2DiHvIVoGWdUvelzH/Zkk0lYM/76jTyJGxvcn8wiGZWUyCLunbegksHmrI Q+Eq7BMNYaKkqXgejEAOygDEJpj9vtoyTxfkCgRD5Lr4z0elTtCo7fgbkP/Z26jQ ITHBXmBRqkVrPnqB4NREFv2asO4BbbCXZfjHlrU9NaKOPoQNLv08OopcRpTdvSrv DN7Ckh6jBu14zFxoWjSIwEfKcLsXoSB/clGUQMTSvVgV2dBBUFkhCot85fnp7Q4c HOle4hybjg== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelgddufeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf gjkfhfgggtsehttdertddttddvnecuhfhrohhmpegrughruceorggurhesufffhfdrqfft ifeqnecuggftrfgrthhtvghrnhepkeehtdevffehvefhtdeghfehgfevleevudejteejtd ehuddvfedvkeegtdffhfffnecukfhppedvtdehrdduieeirdelgedrvdegpddvtdehrddu ieeirdelgedrudeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvth epvddthedrudeiiedrleegrddvgedphhgvlhhopehmgidrshgufhdrohhrghdpmhgrihhl fhhrohhmpeeorggurhesufffhfdrqfftifeq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (sdf.org: 205.166.94.24 is authorized to use 'adr@SDF.ORG' in 'mfrom' identity (mechanism 'ip4:205.166.94.0/24' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="adr@SDF.ORG"; helo=mx.sdf.org; client-ip=205.166.94.24 Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Mon, 9 May 2022 15:31:09 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from sdf.org (IDENT:adr@sdf.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 249JV63o003505 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for <9fans@9fans.net>; Mon, 9 May 2022 19:31:07 GMT Received: from localhost (adr@localhost) by sdf.org (8.15.2/8.12.8/Submit) with ESMTP id 249JV67K002288 for <9fans@9fans.net>; Mon, 9 May 2022 19:31:06 GMT Date: Mon, 9 May 2022 19:31:06 +0000 (UTC) From: adr To: 9fans <9fans@9fans.net> Subject: Re: [9fans] Conversion of constants in C compiler In-Reply-To: Message-ID: References: <3C132FBD69F1EB1594B8F56989784069@eigenstate.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 96c11c0e-cfce-11ec-808a-a6f910175e0e Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UMjI3NTRmMTBiMjQxOTkxYy1NNjQzMjNmMmY1YTRlOGRiOGVhMTEy?= =?UTF-8?B?NTBiPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: quoted-printable List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M64323f2f5a4e8db8ea11250b:1:RfP9i99zofcqpwqx28kt74uCtKJvB1CHgC4qYla51UQ On Sun, 1 May 2022, adr wrote: > Yeah, i was thinking > int -> long -> vlong -> uvlong No, it was a mistake, I forgot to check again that the conversion to unsigned when the constant is using the sign bit doesn't occurs to decimal constants. Also, reading 9front's mailing list I noticed the mess ignoring that convvtox will return vlong, type casting should do the trick: [...] vv =3D yylval.vval; if(c1 & Numvlong || (uvlong)convvtox(vv, TUVLONG) > convvtox(vv, TULONG) || (c1 & (Numdec|Numuns)) =3D=3D Numdec && convvtox(vv, TLONG) < 0) { if((c1 & Numuns) || convvtox(vv, TVLONG) < 0 && (c1 & Numde= c) =3D=3D 0) { c =3D LUVLCONST; t =3D TUVLONG; goto nret; } c =3D LVLCONST; t =3D TVLONG; goto nret; } if(c1 & Numlong || convvtox(vv, TULONG) > convvtox(vv, TUINT) || (c1 & (Numdec|Numuns)) =3D=3D Numdec && convvtox(vv, TINT) < 0) { if((c1 & Numuns) || convvtox(vv, TLONG) < 0 && (c1 & Numdec= ) =3D=3D 0) { c =3D LULCONST; t =3D TULONG; goto nret; } c =3D LLCONST; t =3D TLONG; goto nret; } if((c1 & Numuns) || convvtox(vv, TINT) < 0 && (c1 & Numdec) =3D=3D = 0) { c =3D LUCONST; t =3D TUINT; goto nret; } c =3D LCONST; t =3D TINT; goto nret; [...] It looks complex at first, but each line is telling you the reason to expand the constant, and when to use unsigned types first. For me is absolutely better than insert size assumptions in a piece of code which is making a great effort to let that to machine dependent code well kept in another place. I'll make some tests. adr ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T22754f10b241991c-M64323= f2f5a4e8db8ea11250b Delivery options: https://9fans.topicbox.com/groups/9fans/subscription