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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19205 invoked from network); 24 Sep 2023 20:26:32 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 24 Sep 2023 20:26:32 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob1.topicbox.com (Postfix) with ESMTP id BF59635565 for ; Sun, 24 Sep 2023 16:26:30 -0400 (EDT) (envelope-from bounce.mM6139e88f459a94c80f155e6b.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id BC5DB24D01EC; Sun, 24 Sep 2023 16:26:30 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (1024-bit rsa key sha256) header.d=boddie.org.uk header.i=@boddie.org.uk header.b=LgPwhta/ header.a=rsa-sha256 header.s=dkim x-bits=1024; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=boddie.org.uk; spf=pass smtp.mailfrom=david@boddie.org.uk smtp.helo=smtp1.de.opalstack.com; 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=from:to:cc:date:message-id:mime-version :content-transfer-encoding:content-type:list-help:list-id :list-post:list-subscribe:reply-to:subject:list-unsubscribe; s= sysmsg-1; t=1695587190; bh=4dKw9TA+M7kYTAyK6UFwH9BOkyoQ3d7yHjqzg 6jNvls=; b=ZM07j0Brl+xStdEbp6Q/ylEZqVKF9R4XFynyUbxxWgCGvizToFgae dlMnJ2wrp+wObjMhWJ2g5xBL5/djTdk/iEMFLIHUghzOC45ruOx3i1dPAzkNo+qR nHXyVvV9tpMburu9Yrs83dj62pmmXSOXy2XKCyYjthdo/NJzeaMPOM= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1695587190; b=qM/YmYPDJDqy0vpUpfooIzYvYmpHq4v8EzHAJLrcIk6dQWEAl3 CIG0JDn3liXf6QvkAToa0fKs3YK033zQayD2YB4HTVNblGzEWQVkcv9zOX7+/igB g7V+sprPxQmu73AsYnPmcejc+WLf7pkdeK9Jum4b9D8CwUIEpfLsgUcic= Authentication-Results: topicbox.com; arc=pass; dkim=pass (1024-bit rsa key sha256) header.d=boddie.org.uk header.i=@boddie.org.uk header.b=LgPwhta/ header.a=rsa-sha256 header.s=dkim x-bits=1024; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=boddie.org.uk; spf=pass smtp.mailfrom=david@boddie.org.uk smtp.helo=smtp1.de.opalstack.com; 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 did not pass); dkim=pass (1024-bit rsa key sha256) header.d=boddie.org.uk header.i=@boddie.org.uk header.b=LgPwhta/ header.a=rsa-sha256 header.s=dkim x-bits=1024; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=boddie.org.uk; iprev=pass smtp.remote-ip=46.165.236.26 (smtp1.de.opalstack.com); spf=pass smtp.mailfrom=david@boddie.org.uk smtp.helo=smtp1.de.opalstack.com; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=smtp1.de.opalstack.com policy.ptr=smtp1.de.opalstack.com; x-return-mx=pass header.domain=boddie.org.uk policy.is_org=yes (MX Records found: mx2.de.opalstack.com,mx1.de.opalstack.com); x-return-mx=pass smtp.domain=boddie.org.uk policy.is_org=yes (MX Records found: mx2.de.opalstack.com,mx1.de.opalstack.com); 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=from:to:cc :date:message-id:mime-version:content-transfer-encoding :content-type:list-help:list-id:list-post:list-subscribe :reply-to:subject:list-unsubscribe; s=dkim-1; t=1695587190; x= 1695673590; bh=9Vr36K9PRHYXg6WCl2YOWgW0ldfQ2w/aZGh3yvsj6+I=; b=W Zd0saM+w0APmYyE+9QNs+AUDK5Kl0ZNf1Dzz8oX5MHaqi5aXfmHk81H7bFGBCAC0 BRZwld0mzYqHpG0QX9+CPrCSUPRNYH86eFhGlR+PotObU6RuVlnu0MOrMjRNc0jV vtts7sVLQlfDMDi7UQjpQ5Zx3gWntseIhl6U9nEvxQ= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 47AC62A580A3 for <9fans@9fans.net>; Sun, 24 Sep 2023 16:26:18 -0400 (EDT) (envelope-from david@boddie.org.uk) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 854DD69D6C3; Sun, 24 Sep 2023 16:26:18 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1695587178; b=MEiP9mlX0K62smdf6OnTNW+BrEReMeIN82kBtso+Y1cyoDPTf0 swAnnWMORBYnTeoOJFbxGMrPeOlso4lVBrlD+3/3PVlvwAujBIaTm9H6Lcs4aUl2 4WhkvJK9sfd05/3sOJhWNCdNvEXJWZwsaez7XsMe4Ct+yUcZAIG34Y/BHrZWTA92 KFbb00VJ/x8Zb3efzm1fO2dk4ZryMe7QAa0J1IbBNhzap+fLogj2b5+MVMLhcNCV zN77y36ETmFV7RyAX69m5W7SfIHRmhLBh8i40GFrBQlINEOZgX4XGRPJNJKlD0c7 VQytz1qkYUo/9enQU01GxjYjIttUGqeyjrtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=arcseal; t= 1695587178; bh=9mr/Rc95h48LVSn8IsX7gPBWpmWp4v8ZgjGhsT2p+fY=; b=v ZIb27xf2FPPt7AyK7V2E/u8drOyOWSw9rd62PcOOlu61s/Iu58hsQ/MengIiWHoR P9V01duSa68o5nSVH0nsjswWHm2FgZh/4eEAAxcAW14big9yKaOtLsRKfdp9i7P7 DnHFIhPBLCbpUzEsfaKXsuXXEhA3fl1gjP4jrF2/RLONeMNDkckm13g3po0DQcXC FBr0Nsm/uHTbw9u7epcKzM+dZSMfYL/MwdTRiNkcelrmq5cf8cO23ROrxN8DPQdz Ky4GYKmS4LmZlJHb1FCbzZoM45nW+9nFuxsehlwtM8aZxx8drZic63QOdkvG23FS 60KZ+HrwYw0j3yXTRTSEw== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=pass (1024-bit rsa key sha256) header.d=boddie.org.uk header.i=@boddie.org.uk header.b=LgPwhta/ header.a=rsa-sha256 header.s=dkim x-bits=1024; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=boddie.org.uk; iprev=pass smtp.remote-ip=46.165.236.26 (smtp1.de.opalstack.com); spf=pass smtp.mailfrom=david@boddie.org.uk smtp.helo=smtp1.de.opalstack.com; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=smtp1.de.opalstack.com policy.ptr=smtp1.de.opalstack.com; x-return-mx=pass header.domain=boddie.org.uk policy.is_org=yes (MX Records found: mx2.de.opalstack.com,mx1.de.opalstack.com); x-return-mx=pass smtp.domain=boddie.org.uk policy.is_org=yes (MX Records found: mx2.de.opalstack.com,mx1.de.opalstack.com); 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: gggruggvucftvghtrhhoucdtuddrgedviedrudelvddgudehudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvve fufffkggfgtgesthfuredttddtvdenucfhrhhomhepffgrvhhiugcuuehougguihgvuceo uggrvhhiugessghougguihgvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepffegfe eljeeggfejgeduueduffelfeefffeuhfetledtjeeuuefgudffjedugfeunecukfhppeeg iedrudeihedrvdefiedrvdeipdduleefrdeiledrudelgedrudekgeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeegiedrudeihedrvdefiedrvdeipdhh vghlohepshhmthhpuddruggvrdhophgrlhhsthgrtghkrdgtohhmpdhmrghilhhfrhhomh epoegurghvihgusegsohguughivgdrohhrghdruhhkqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (boddie.org.uk: Sender is authorized to use 'david@boddie.org.uk' in 'mfrom' identity (mechanism 'include:spf.opalstack.com' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="david@boddie.org.uk"; helo=smtp1.de.opalstack.com; client-ip=46.165.236.26 Received: from smtp1.de.opalstack.com (smtp1.de.opalstack.com [46.165.236.26]) (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>; Sun, 24 Sep 2023 16:26:17 -0400 (EDT) (envelope-from david@boddie.org.uk) Received: from aurora.localnet (cB8C245C1.dhcp.as2116.net [193.69.194.184]) by smtp1.de.opalstack.com (Postfix) with ESMTPSA id 2A83B3A345C; Sun, 24 Sep 2023 20:26:15 +0000 (UTC) From: David Boddie To: inferno-os@googlegroups.com Cc: 9fans@9fans.net Date: Sun, 24 Sep 2023 22:26:14 +0200 Message-ID: <3345904.YYNtgTSHRZ@aurora> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: a0cb6a5c-5b18-11ee-918e-1ae3098c7b06 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZjBjYTMxNmU0ZWYzOWZkYS1NNjEzOWU4OGY0NTlhOTRjODBmMTU1?= =?UTF-8?B?ZTZiPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Subject: [9fans] Thumb compiler oddity List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M6139e88f459a94c80f155e6b:1:oZcuOqOtgoDeKdhc0a2FD21yhjlbawR9eXsbC316nLA I'm using the Inferno Thumb compiler, tc, to compile Inferno (unsurprisingl= y) and encountered a problem. Since 9front appears to have the same compiler, I thought that I should mention it on both 9fans and Inferno mailing lists. The problem is with the libmath/fdlibm/e_exp.c when compiled using tc, 5c (arm), 0c (spim), and maybe others. The relevant chunk of code is the first branch of this: if(k >=3D -1021) { __HI(y) +=3D (k<<20); /* add k to y's exponent */ return y; } else { __HI(y) +=3D ((k+1000)<<20);/* add k to y's exponent */ return y*twom1000; } where __HI is defined as #define __HI(x) *(1+(int*)&x) for little-endian doubles. The code generated by tc for the k >=3D -1021 branch is this, which I've annotated: MOVD F0,F3 y CMP $-1021,R4, compare k to -1021 BLT ,9(PC) k < -1021, skip past RET below MOVW R4,R1 SLL $20,R1 k << 20 MOVW y-4(SP),R2 load the high word of y in memory ADD R1,R2 add k << 20 to it MOVW R2,y-4(SP) store the result back to memory MOVD F3,F0 the unmodified y is the return value RET , So, the compiler operates on the value in memory without updating the value in register F3. Turning off registerization results in this code instead: MOVD F0,y-8(SP) update y in memory MOVW k-44(SP),R1 load k CMP $-1021,R1, compare k to -1021 BLT ,10(PC) k < -1021, skip past RET below MOVW k-44(SP),R1 SLL $20,R1 k << 20 MOVW y-4(SP),R2 load the high word of y in memory ADD R1,R2 add k << 20 to it MOVW R2,y-4(SP) store the result back to memory MOVD y-8(SP),F0 load the modified y to be returned NOP ,R0 RET , Is the problem with the compiler or with the C code? Although I get the feeling that the compiler should figure out that the value of y is being modified, I don't know if it's being done in a valid way, or a way that compilers are expected to handle. It could be an endianness-related thing: vc appears to do the right thing. Having said that, so does 8c, as far as I can tell. Any thoughts? David ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf0ca316e4ef39fda-M6139e= 88f459a94c80f155e6b Delivery options: https://9fans.topicbox.com/groups/9fans/subscription