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.
EXTS D,#S 'where bit S of D is copied up to bit 31 or EXTB D,#S 'sign extend byte EXTW D,#S 'sign extend word
TF2# ASM 00.2E4D $2.0000 org 02.0000 F0E7.2001 sal 1st , # 1 02.0004 FD60.002D ret 02.0008 end ok TF2# !SP $8000.0013 ok TF2# EXEC 0001 [0000.0027 0000.01A5 0000.01A5 0000.01A5 ] ok TF2# EXEC 0001 [0000.004F 0000.01A5 0000.01A5 0000.01A5 ] ok TF2# EXEC 0001 [0000.009F 0000.01A5 0000.01A5 0000.01A5 ] ok TF2# EXEC 0001 [0000.013F 0000.01A5 0000.01A5 0000.01A5 ] ok TF2# EXEC 0001 [0000.027F 0000.01A5 0000.01A5 0000.01A5 ] ok TF2# 16 FOR CR EXEC NEXT 0001 [0000.04FF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0000.09FF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0000.13FF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0000.27FF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0000.4FFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0000.9FFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0001.3FFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0002.7FFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0004.FFFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0009.FFFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0013.FFFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [0027.FFFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [004F.FFFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [009F.FFFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [013F.FFFF 0000.01A5 0000.01A5 0000.01A5 ] 0001 [027F.FFFF 0000.01A5 0000.01A5 0000.01A5 ] ok TF2#
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
mov myreg,#1 sal myreg,#11 'myreg = $00000FFF or not myreg,#1 sal myreg,#11 'myreg = $FFFFF000
So, I guess the answer is still, there is no such thing as a real SAL instruction.