Kartik Agaram
<>
has distracting connotations of inequality. Maybe ><
?
* Ideally just ascii characters. Though I suppose we could use one of the circular unicode arrows at a pinch.Andrew F
11/25/2020, 8:49 AM>@>
and <@<
, playing on how @ looks vaguely circular. Actually those would be a huge pain to type, putting the @ on one end or another would be less aggressively unergonomic.Kartik Agaram
>|<
which is also quite terrible on the fingers.Andrew F
11/25/2020, 8:57 AMKartik Agaram
Kartik Agaram
>^<
? Still a dragonfly or butterfly.Kartik Agaram
>-<
is one shift less. That seems worth the horizontal symmetry.Alexey Shmalko
11/25/2020, 10:32 AMrotate_right
Alexey Shmalko
11/25/2020, 10:38 AMEldritch Conundrum
11/25/2020, 10:44 AMAlexey Shmalko
11/25/2020, 10:49 AMKartik Agaram
rotate_left
each time would hinder thought (https://dl.acm.org/doi/pdf/10.1145/358896.358899)
In this case the problem I'm working on is coming up with a reasonable representation of the ARM ISA. ARM binary operators all support one immediate operand that must fit in 12 bits. However the 12 bits are used in a strange way, starting with 8 bits and then using the remaining 4 to determine how to rotate it. The recommended "universal assembly language" for ARM is to just provide constants and let the toolchain give you errors like:
A1510E:Immediate 0x<imm> cannot be represented by 0-255 and a rotation
(https://developer.arm.com/documentation/100074/0612/assembler-errors-and-warnings/list-of-the-armasm-error-and-warning-messages)
This seems pretty lousy. I'd prefer something that's more "correct by construction", that's not one of these:
ADD Rd, Rn, 0xff, 4
ADD Rd, Rn, rotate_left(0xff, 4)
(I'm focusing on immediates just to simplify exposition. Making the second operand register-based opens up a larger can of worms.)
Tl;dr - There is nothing "reduced" about this RISC intruction set.Doug Moen
11/25/2020, 11:59 PMrotate(X,n)
. Suggestions:
• n`⌽`X -- the APL rotate operator. APL was originally a mathematical notation, and was only later turned into a programming language.
• n <|>
X -- an ASCII approximation of the above.
• n rot
X -- yes, this is a notation, just as sin x
is mathematical notation for the sine function.Robert Butler
11/26/2020, 1:29 AMn -o X
or n o- X
. Think of that as a wheel with a tail. Or possibly n o! X
or n !o X
.Emmanuel Oga
11/26/2020, 3:23 AMEmmanuel Oga
11/26/2020, 3:25 AM<<<_3
is the obvious thoughtEmmanuel Oga
11/26/2020, 3:27 AM<<<
out before but since it seems like it used in all those famous papers, perhaps worth keeping. It is also easy to write and subscript with a pencilKartik Agaram
<<<
for this purpose, but also that it used to have a rot
on top of it. Which suffers from the obvious drawbacks.
To describe why <<<
still doesn't work, I need to expand the context from immediates to also include registers. The ARM instruction set can be summarized lossily in the following gestalt lines:
Rd <- Rn op Rm
Rd <- Rn op (imm8 <|> k) # rotate until LSB is at bit k from the right; k must be even and in [0, 32)
Rd <- Rn op (Rm << imm5)
Rd <- Rn op (Rm >> imm5) # ASR/signed
Rd <- Rn op (Rm >>> imm5) # LSR/unsigned
Rd <- Rn op (Rm <|> k) # rotate
Rd <- Rn op (Rm c>> 1) # shift right and insert carry flag
(So far my favorite option is @Doug Moen's <|>
. I've come to terms with its conflicting association with alternation in Haskell.)