There might not be a use case. It might just be that that slot would have been otherwise unused:
Note that the binary values of the opcodes of ROR, ROL, SHR, SHL, RCR, RCL, SAR, and SAL. They are all the same except for bits 23-21. Bit 21 means L if 1 and R if 0. Bits 23 and 22 presumably go to a mux or something which decides where the new bits that get shifted in come from. The meanings of bits 23-22 are as follows: (0) whatever got shifted out (rotate), (1) all 0 (shift), (2) the value of the C flag (RCx), or (3) the value of result[31] for R or result[0] for L (sign-extend shift).
Removing the SAL instruction would mean telling the instruction decoder that if the instruction matched %CCCC_0000111_CZI_DDDDDDDDD_SSSSSSSSS it should disregard the output of the shifter and instead do something undefined.
If it does work that way, it shouldn't be called SAL, because that implies that it would be like other SAL instructions. It works very different than anyone would expect SAL to work.
Not sure what it should be called, but definitely not SAL.
So that could be Shift Left duplicating b0 = SL0
Of course, many may misread 0 as O, so it could also be Shift Left duplicating Lowest = SLL
It is still Clearly a Shift Left operation.
... it shouldn't be called SAL, because that implies that it would be like other SAL instructions. ...
I found this to be a very odd statement since I'd never heard of any SAL instruction ever before. So, I went a searching ... and found that x86 machine code has a redundant "SAL" that is 100% SHL. It's a total oddity.
So, I guess the answer is still, there is no such thing as a real SAL instruction.
After a bit more reading it would seem it's not actually a separate opcode at all but rather just an assembly level duplication. So, there never was any SAL even for x86.
Comments
Not sure in the case of the P2.
What's the use case for this?
Note that the binary values of the opcodes of ROR, ROL, SHR, SHL, RCR, RCL, SAR, and SAL. They are all the same except for bits 23-21. Bit 21 means L if 1 and R if 0. Bits 23 and 22 presumably go to a mux or something which decides where the new bits that get shifted in come from. The meanings of bits 23-22 are as follows: (0) whatever got shifted out (rotate), (1) all 0 (shift), (2) the value of the C flag (RCx), or (3) the value of result[31] for R or result[0] for L (sign-extend shift).
Removing the SAL instruction would mean telling the instruction decoder that if the instruction matched %CCCC_0000111_CZI_DDDDDDDDD_SSSSSSSSS it should disregard the output of the shifter and instead do something undefined.
What would be more useful would be a sign extend instruction IMHO.
It may have no mathematical purpose, but could find use somewhere.
It was free, anyway.
Not sure what it should be called, but definitely not SAL.
It should be called NOTSAR
I like "RAS" better.
I agree.
Would could just stop using 'A'rithmetic in 'SAR' and, instead, have some mnemonics that mean 'extend'.
SER - shift extend right
SEL - shift extend left
-or-
SMR - smear right
SML - smear left
Why can't we keep SAR, and just rename SAL?
What should we call it?
So that could be Shift Left duplicating b0 = SL0
Of course, many may misread 0 as O, so it could also be
Shift Left duplicating Lowest = SLL
It is still Clearly a Shift Left operation.
Or maybe SLR for shift left replicate LSB.
I kind of like SMR/SML the best, because a child could understand them.
ie SMR/SML and also SAR work.
SEL also works.
Also, I still can't think of a real use case for it...
Then, it's multiplication by power of 2 for signed numbers...
I guess it should set a flag if msb would have otherwise changed
A change would indicate overflow, I think...
Right justified masks can be built of varied lengths
shift number of bits - 1
So, I guess the answer is still, there is no such thing as a real SAL instruction.