Extended mnemonics of condition register logical instructions
The extended mnemonics of condition register logical instructions are available in POWER® family and PowerPC®.
Extended mnemonics of condition register logical instructions are available in POWER® family and PowerPC®. These extended mnemonics are in the com assembly mode. Condition register logical instructions can be used to perform the following operations on a given condition register bit.
- Set bit to 1.
- Clear bit to 0.
- Copy bit.
- Invert bit.
The extended mnemonics shown in the following table allow these operations to be easily coded.
Extended Mnemonic | Equivalent to | Meaning |
---|---|---|
crset bx | creqv bx, bx, bx | Condition register set |
crclr bx | crxor bx, bx, bx | Condition register clear |
crmove bx, by | cror bx, by, by | Condition register move |
crnot bx, by | crnor bx, by, by | Condition register NOT |
Since the condition register logical instructions perform the operation on the condition register bit, the assembler supports expressions in all input operands. When using a symbol name to indicate a condition register (CR) field, the symbol name should be multiplied by four to get the correct CR bit, because each CR field has four bits.
Examples
- To clear the SO bit (bit 3) of CR0:
This is equivalent to:crclr so
crxor 3, 3, 3
- To clear the EQ bit of CR3:
This is equivalent to:crclr 4*cr3+eq
crxor 14, 14, 14
- To invert the EQ bit of CR4 and place the result in the SO bit
of CR5:
This is equivalent to:crnot 4*cr5+so, 4*cr4+eq
crnor 23, 18, 18