From mboxrd@z Thu Jan 1 00:00:00 1970 From: toby@telegraphics.com.au (Toby Thain) Date: Fri, 10 Nov 2017 18:43:19 -0500 Subject: [TUHS] PowerPC, bit twiddling - was Re: origins of void* -- Apology! In-Reply-To: <42D46D6E-46F4-49E9-A76B-360A812DBBB0@gmail.com> References: <7617c69abf46fbe3f206c6208000fe3b26854359@webmail.yaccman.com> <065d01d3575e$f71f6ad0$e55e4070$@ronnatalie.com> <20171108174450.5564F20334@orac.inputplus.co.uk> <20171108212550.56005156E7D7@mail.bitblocks.com> <7wzi7wt0sc.fsf@junk.nocrew.org> <42D46D6E-46F4-49E9-A76B-360A812DBBB0@gmail.com> Message-ID: <92767af5-6aa5-666a-4a61-4956c2dbbd74@telegraphics.com.au> On 2017-11-09 2:14 AM, Don Hopkins wrote: > >> On 9 Nov 2017, at 07:37, Lars Brinkhoff > > wrote: >> >> Bakul Shah wrote: >>> I agree that `char' shouldn't do double duty as the smallest >>> addressable unit and I was suggesing uint8_t does that job. >> >> There are still machines around where 8-bit bytes isn't a natural fit. > > 1 bit bytes, the smallest addressable unit on the PDP-10, sounds kinda > cool actually. Now would those be signed or unsigned? > > The PowerPC was great at smashing and swizzling bit fields ... It's funny you should mention "1-bit bytes" and PowerPC close together, because the PowerPC has an architectural feature that I have not seen discussed much - the 8 x 4 bit CR register set, and the Conditional Register Logical instructions that can operate on them directly as if they were 32 single bit registers, with operations AND, OR, XOR, NAND, NOR, EQV (complemented XOR), AND complemented operand, OR complemented operand, move between 4-bit fields, and of course the usual branch tests. I have been curious about whether a compiler could make good use of this facility. --Toby > > -Don >