Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.arch Subject: Re: Computer architects leaving Intel... Date: Sun, 08 Sep 2024 15:32:02 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 53 Message-ID: <2024Sep8.173202@mips.complang.tuwien.ac.at> References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <8lcadjhnlcj5se1hrmo232viiccjk5alu4@4ax.com> <2024Sep5.133102@mips.complang.tuwien.ac.at> <2024Sep5.174939@mips.complang.tuwien.ac.at> <2024Sep6.092535@mips.complang.tuwien.ac.at> <20240906135718.00004f84@yahoo.com> <2024Sep6.152642@mips.complang.tuwien.ac.at> <65bc48543e1479699b5b2dff40c4f458@www.novabbs.org> Injection-Date: Sun, 08 Sep 2024 17:36:31 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d5e623bbaa085cebf149e53e66f130a5"; logging-data="2078153"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hjlSRZb11PpI3vmcVS8dV" Cancel-Lock: sha1:vkTO1YvN6qaOXTLZX3UHTiWt7VI= X-newsreader: xrn 10.11 Bytes: 2673 mitchalsup@aol.com (MitchAlsup1) writes: >And just for fun:: > >On Fri, 6 Sep 2024 13:26:42 +0000, Anton Ertl wrote: >> Here we have the three variants: >> >> #include >> >> extern long foo1(long); >> extern long foo2(long); >> >> long bar(long a, long b) >> { >> long c; >> if (__builtin_sub_overflow(b,1,&c)) >> return foo1(a); >> else >> return foo2(a); >> } >> >> long bar2(long a, long b) >> { >> if (b < b-1) >> return foo1(a); >> else >> return foo2(a); >> } >> >> long bar3(long a, long b) >> { >> if (b == LONG_MIN) >> return foo1(a); >> else >> return foo2(a); >> } > >My 66000: > add r3,R1,#-1 add r3,r1,#-1 bepm r1,.L4 > bge R3,.L4 bge r3,.L4 > 8-bytes 8-bytes 4-bytes > >I have a direct test for POSMAX in ISA that does not use a constant. How does bge work in the first and second column? My impression was that you are using an 88k-style flags-in-GPR architecture. Concerning the last column, the gcc developer who added the transformation of bar2() into bar3() apparently had My66000 in mind. - anton -- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup,