AN2491 Freescale Semiconductor / Motorola, AN2491 Datasheet

no-image

AN2491

Manufacturer Part Number
AN2491
Description
Simplified Mnemonics for PowerPC Instructions
Manufacturer
Freescale Semiconductor / Motorola
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2491NFHP
Manufacturer:
PANASON
Quantity:
5 510
Part Number:
AN2491NFHP
Manufacturer:
MAXIM
Quantity:
5 510
Application Note
AN2491
Rev. 0, 9/2003
Simplified Mnemonics for
PowerPC™ Instructions
Jerry Young,
NCSD Applications
Simplified Mnemonics for PowerPC™ Instructions
This document describes simplified mnemonics, which are provided for easier coding of
assembly language programs. Simplified mnemonics are defined for the most frequently used
forms of branch conditional, compare, trap, rotate and shift, and certain other instructions
defined by the PowerPC™ architecture and by implementations of and extensions to the
PowerPC architecture.
Most of this information is also provided in the appendixes of reference manuals and the
Programming Environments Manual for 32-Bit Implementations of the PowerPC Architecture
(referred to as the Programming Environment Manual). However, Section 12,
“Comprehensive List of Simplified Mnemonics,” provides an alphabetical listing of
simplified mnemonics that are used by a variety of processors. Some assemblers may define
additional simplified mnemonics not included here. The simplified mnemonics listed here
should be supported by all compilers.
This document describes only simplified mnemonics for 32-bit instructions.
Section
Section 1, “Overview”
Section 2, “Subtract Simplified Mnemonics”
Section 3, “Rotate and Shift Simplified Mnemonics”
Section 4, “Branch Instruction Simplified Mnemonics”
Section 5, “Compare Word Simplified Mnemonics”
Section 6, “Condition Register Logical Simplified Mnemonics”
Section 7, “Trap Instructions Simplified Mnemonics”
Section 8, “Simplified Mnemonics for Accessing SPRs”
Section 9, “AltiVec Simplified Mnemonics”
Section 10, “Recommended Simplified Mnemonics”
Section 11, “EIS-Specific Simplified Mnemonics”
Section 12, “Comprehensive List of Simplified Mnemonics”
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
Page
2
2
3
4
18
19
19
21
22
23
24
25

Related parts for AN2491

AN2491 Summary of contents

Page 1

... Freescale Semiconductor, Inc. Application Note AN2491 Rev. 0, 9/2003 Simplified Mnemonics for PowerPC™ Instructions Simplified Mnemonics for PowerPC™ Instructions Jerry Young, NCSD Applications This document describes simplified mnemonics, which are provided for easier coding of assembly language programs. Simplified mnemonics are defined for the most frequently used forms of branch conditional, compare, trap, rotate and shift, and certain other instructions defined by the PowerPC™ ...

Page 2

Freescale Semiconductor, Inc. Overview Overview 1 Overview Simplified (or extended) mnemonics allow an assembly-language programmer to program using more intuitive mnemonics and symbols than the instructions and syntax defined by the instruction set architecture. For example, to code the conditional ...

Page 3

Freescale Semiconductor, Inc. 3 Rotate and Shift Simplified Mnemonics Rotate and shift instructions provide powerful, general ways to manipulate register contents, but can be difficult to understand. Simplified mnemonics are provided for the following operations: • Extract—Select a field of ...

Page 4

Freescale Semiconductor, Inc. Branch Instruction Simplified Mnemonics Branch Instruction Simplified Mnemonics 4 Branch Instruction Simplified Mnemonics Branch conditional instructions can be coded with the operations, a condition to be tested, and a prediction, as part of the instruction mnemonic rather ...

Page 5

Freescale Semiconductor, Inc. 4.1 Key Facts about Simplified Branch Mnemonics The following key points are helpful in understanding how to use simplified branch mnemonics: • All simplified branch mnemonics eliminate the BO operand any operand is present in ...

Page 6

Freescale Semiconductor, Inc. Branch Instruction Simplified Mnemonics Branch Instruction Simplified Mnemonics Thus encoding of 10100 (decimal 20) means ignore the CR bit comparison and do not decrement the CTR—in other words, branch unconditionally. Encodings for the BO operand ...

Page 7

Freescale Semiconductor, Inc. For relative and absolute branches (bc[l][a]), the setting of the y bit depends on whether the displacement field is negative or non-negative. For negative displacement fields, coding the suffix ‘+’ causes the bit to be cleared, and ...

Page 8

Freescale Semiconductor, Inc. Branch Instruction Simplified Mnemonics Branch Instruction Simplified Mnemonics Simplified mnemonics based on CR conditions but not CTR values— (branch if true) and branch if false) Standard branch mnemonics and simplified mnemonics based ...

Page 9

Freescale Semiconductor, Inc. Table 8. BI Operand Settings for CR Fields for Branch Comparisons CRn Bit Expression AIM (BI Bit Operand) CRn[ cr0 + lt (or lt cr1 + cr2 + lt 4 ...

Page 10

Freescale Semiconductor, Inc. Branch Instruction Simplified Mnemonics Branch Instruction Simplified Mnemonics Table 9. CR Field Identification Symbols (continued) To identify a CR bit, an expression in which a CR field symbol is multiplied by 4 and then added to a ...

Page 11

Freescale Semiconductor, Inc. Table 11 shows the syntax for basic simplified branch mnemonics Instruction Branch Branch Conditional Branch Conditional to Link Register Branch Conditional to Count Register 1 x stands for one of the symbols in Table 6, where applicable. ...

Page 12

Freescale Semiconductor, Inc. Branch Instruction Simplified Mnemonics Branch Instruction Simplified Mnemonics Table 12. Simplified Mnemonics for bc and bca without LR Update (continued) Branch Semantics 1 Branch if condition false Decrement CTR, branch if CTR 0 Decrement CTR, branch if ...

Page 13

Freescale Semiconductor, Inc. Table 14 provides simplified mnemonics and syntax for bcl and bcla. Table 14. Simplified Mnemonics for bcl and bcla with LR Update Branch Semantics Branch unconditionally 1 Branch if condition true 1 Branch if condition false Decrement ...

Page 14

Freescale Semiconductor, Inc. Branch Instruction Simplified Mnemonics Branch Instruction Simplified Mnemonics 4.6 Simplified Mnemonics that Incorporate CR Conditions (Eliminates BO and Replaces BI with crS) The mnemonics in Table 18 are variations of the branch-if-condition-true (BO = 12) and branch-if-condition-false ...

Page 15

Freescale Semiconductor, Inc. Table 17. Branch Instructions and Simplified Mnemonics that Incorporate CR Conditions Instruction Branch Branch Conditional Branch Conditional to Link Register Branch Conditional to Count Register 1 x stands for one of the symbols in Table 16, where ...

Page 16

Freescale Semiconductor, Inc. Branch Instruction Simplified Mnemonics Branch Instruction Simplified Mnemonics 3. Branch to an absolute target if CR4 specifies greater than condition, setting the LR. This is a form of conditional call. bgtla cr4,target 4. Same as (3), but ...

Page 17

Freescale Semiconductor, Inc. Table 20. Simplified Mnemonics for bclr and bcctr without Comparison Conditions and LR Updating (continued) Branch Semantics Branch if greater than bclr 12,BI Branch if not equal bclr 4,BI Branch if summary overflow bclr 12,BI Branch if ...

Page 18

Freescale Semiconductor, Inc. Compare Word Simplified Mnemonics Compare Word Simplified Mnemonics Table 22 shows the simplified branch mnemonics and syntax for bclrl and bcctrl with LR updating. Table 22. Simplified Mnemonics for bclrl and bcctrl with Comparison Conditions and LR ...

Page 19

Freescale Semiconductor, Inc. 6 Condition Register Logical Simplified Mnemonics The CR logical instructions, shown in Table 24, can be used to set, clear, copy, or invert a given CR bit. Simplified mnemonics allow these operations to be coded easily. Note ...

Page 20

Freescale Semiconductor, Inc. Trap Instructions Simplified Mnemonics Trap Instructions Simplified Mnemonics Table 25. Standard Codes for Trap Instructions (continued) Code Description lge Logically greater than or equal lgt Logically greater than lnl Logically not less than lng Logically not greater ...

Page 21

Freescale Semiconductor, Inc. 4. Trap unconditionally. trap Trap instructions evaluate a trap condition as follows: The contents of rA are compared with either the sign-extended SIMM field or the contents of rB, depending on the trap instruction. The comparison results ...

Page 22

Freescale Semiconductor, Inc. AltiVec Simplified Mnemonics AltiVec Simplified Mnemonics Table 28. Additional Simplified Mnemonics for Accessing IBATs, DBATs, and SPRGs Move to SPR SPR Simplified Mnemonic DBAT register, mtdbatl n,rS lower mtdbatln,rS DBAT register, mtdbatu n,rS lower mtdbatun,rS IBAT register, ...

Page 23

Freescale Semiconductor, Inc. 10 Recommended Simplified Mnemonics This section describes commonly-used operations (such as no-op, load immediate, load address, move register, and complement register). 10.1 No-Op (nop) Many instructions can be coded in such a way that, effectively, no operation ...

Page 24

Freescale Semiconductor, Inc. EIS-Specific Simplified Mnemonics EIS-Specific Simplified Mnemonics 10.5 Complement Register (not) Several instructions can be coded in such a way that they complement the contents of one register and place the result into another register. A simplified mnemonic ...

Page 25

Freescale Semiconductor, Inc. 12 Comprehensive List of Simplified Mnemonics Table 31 lists simplified mnemonics. Note that compiler designers may implement additional simplified mnemonics not listed here. Simplified Mnemonic 1 bctr 1 bctrl 1 bdnz target 1 bdnza target bdnzf BI,target ...

Page 26

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic bdnztlr BI bdnztlrl BI 1 bdz target 1 bdza target bdzf BI,target bdzfa BI,target bdzfl BI,target bdzfla BI,target bdzflr BI ...

Page 27

Freescale Semiconductor, Inc. Table 31. Simplified Mnemonics (continued) Simplified Mnemonic beqctr crS,target beqctrl crS,target bcctrl 12,BI beql crS,target beqla crS,target beqlr crS,target beqlrl crS,target bf BI,target bfa BI,target bfctr BI bfctrl BI bfl BI,target bfla BI,target bflr BI bflrl BI ...

Page 28

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic bgta crS,target bgtctr crS,target bgtctrl crS,target bcctrl 12,BI bgtl crS,target bgtla crS,target bgtlr crS,target bgtlrl crS,target ble crS,target blea crS,target ...

Page 29

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic bltl crS,target bltla crS,target bltlr crS,target bltlrl crS,target bne crS,target bnea crS,target bnectr crS,target bnectrl crS,target bnel crS,target bnela crS,target ...

Page 30

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic bnla crS,target bnlctr crS,target bnlctrl crS,target bnll crS,target bnlla crS,target bnllr crS,target bnllrl crS,target bns crS,target bnsa crS,target bnsctr crS,target ...

Page 31

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic bnulr crS,target bnulrl crS,target bso crS,target bsoa crS,target bsoctr crS,target bsoctrl crS,target bcctrl 12,BI bsol crS,target bsola crS,target bsolr crS,target ...

Page 32

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic bunlr crS,target bunlrl crS,target clrlslwi rA,rS,b 31) rlwinm rA,rS,n,b – n,31 – n clrlwi rA,rS,n (n < 32) ...

Page 33

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic mtspr rS nop not rA,rS not rA,rS rotlw rA,rS,rB rlwnm rA,rS,rB,0,31 rotlwi rA,rS,n rlwinm rA,rS,n,0,31 rotrwi rA,rS,n rlwinm rA,rS,32 – ...

Page 34

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics Table 31. Simplified Mnemonics (continued) Simplified Mnemonic twlnl rA,SIMM twlnli rA,SIMM twlt rA,SIMM twlti rA,SIMM twne rA,SIMM twnei rA,SIMM twng rA,SIMM twngi rA,SIMM twnl rA,SIMM twnli rA,SIMM ...

Page 35

Freescale Semiconductor, Inc. Comprehensive List of Simplified Mnemonics Comprehensive List of Simplified Mnemonics THIS PAGE INTENTIONALLY LEFT BLANK 35 Simplified Mnemonics for PowerPC™ Instructions For More Information On This Product, Go to: www.freescale.com MOTOROLA ...

Page 36

... Motorola, Inc. The PowerPC name is a trademark of IBM Corp. and is used under license. All other product or service names are the property of their respective owners. Motorola, Inc Equal Opportunity/Affirmative Action Employer. © Motorola, Inc. 2003 AN2491 For More Information On This Product, Go to: www.freescale.com ...

Related keywords