4.4 Integer Arithmetic Instructions
The integer arithmetic instructions perform add, subtract, multiply, signed and unsigned com- pare, and bit count operations.
Count instruction (CIX) extension implementation note:
The CIX extension to the architecture provides the CTLZ, CTPOP, and CTTZ instructions. Alpha processors for which the AMASK instruction returns bit 2 set implement these instructions. Those processors for which AMASK does not return bit 2 set can take an Illegal Instruction trap, and software can emulate their function, if required. AMASK is described in Sections 4.11.1 and D.3.
The integer instructions are summarized in Table
Table 4–5: Integer Arithmetic Instructions Summary
Mnemonic | Operation |
|
|
ADD | Add Quadword/Longword |
S4ADD | Scaled Add by 4 |
S8ADD | Scaled Add by 8 |
CMPEQ | Compare Signed Quadword Equal |
CMPLT | Compare Signed Quadword Less Than |
CMPLE | Compare Signed Quadword Less Than or Equal |
CTLZ | Count leading zero |
CTPOP | Count population |
CTTZ | Count trailing zero |
CMPULT | Compare Unsigned Quadword Less Than |
CMPULE | Compare Unsigned Quadword Less Than or Equal |
MUL | Multiply Quadword/Longword |
UMULH | Multiply Quadword Unsigned High |
SUB | Subtract Quadword/Longword |
S4SUB | Scaled Subtract by 4 |
S8SUB | Scaled Subtract by 8 |
There is no integer divide instruction. Division by a constant can be done by using UMULH; division by a variable can be done by using a subroutine. See Section A.4.2.