AN2203 Freescale Semiconductor / Motorola, AN2203 Datasheet - Page 55

no-image

AN2203

Manufacturer Part Number
AN2203
Description
MPC7450 RISC Microprocessor Family Software Optimization Guide
Manufacturer
Freescale Semiconductor / Motorola
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN22030A
Manufacturer:
PANASONIC/松下
Quantity:
20 000
5.3
Table 5-3 shows the code sequences from Section D.2 of the PowerPC Compiler Writer’s Guide. In each
example, v0 is located in r3 and v1 is located in r4.
MOTOROLA
ltu/gtu
r = (unsigned_word) v0 < (unsigned_word) v1
r = (unsigned_word) v1 > (unsigned_word) v0;
eq0
r = (v0 == 0);
ne0
r = (v0 != 0);
les0
r = (signed_word) v0 <= 0
ges0
r = (signed_word) v0 >= 0;
lts0
r = (signed_word) v0 < 0;
gts0
r = (signed_word) v0 > 0;
Negated Comparisons and Negated Comparisons
Against Zero
MPC7450 RISC Microprocessor Family Software Optimization Guide
Table 5-2. Comparisons and Comparisons Against Zero (continued)
Operation
Freescale Semiconductor, Inc.
For More Information On This Product,
Negated Comparisons and Negated Comparisons Against Zero
Go to: www.freescale.com
subfc r5,r4,r3
subfe r6,r6,r6
neg r7,r6
Cycles: 5
subfic r4,r3,0
adde r5,r4,r3
Cycles: 4
addic r4,r3,-1
subfe r5,r4,r3
Cycles: 4
neg r4,r3
orc r5,r3,r4
srwi r6,r5,31
Cycles: 3
srwi r4,r3,31
xori r5,r4,1
Cycles: 2
srwi r4,r3,31
Cycles: 1
neg r4,r3
andc r5,r4,r3
srwi r6,r5,31
Cycles: 3
Compiler Writer’s
Guide Code
xor r5,r4,r3
cntlzw r6,r5
slw r7,r4,r6
srwi r8,r7,31
Cycles: 4
cntlzw r4,r3
srwi r5,r4,5
Cycles: 2
neg r4,r3
or r5,r4,r3
srwi r6,r5,31
Cycles: 3
li r4,1
cntlzw r5,r3
rlwnm r6,r4,r5,31,31
Cycles: 2
MPC7450 Code
(If Different)
Both sequences are
listed in the PowerPC
Compiler Writer’s
Guide, with the
subfic and adde
sequence being first.
The cntlzw and srwi
sequence is
preferred.
Comments
55

Related parts for AN2203