SDKZSPF LSI, SDKZSPF Datasheet - Page 60

no-image

SDKZSPF

Manufacturer Part Number
SDKZSPF
Description
Manufacturer
LSI
Datasheet

Specifications of SDKZSPF

Lead Free Status / Rohs Status
Supplier Unconfirmed
3-6
Table 3.4
Use the accum_a and accum_b data types to select a specific register for
variable storage: variables declared as type accum_a or accum_b are
placed in registers r1r0 and r3r2 respectively with sdcc/zdxcc. They are
placed in r13r12 and r15r14 respectively with zdcc. This change was
necessary with zdcc because registers r0-r3 are clobbered by the
ZSPG2 calling convention. The accum_a and accum_b data types can be
used to declare local variables; global accumulators are not supported.
From the compiler’s point of view, accum_a and accum_b are 32-bit
variables that must be stored in a specified register. On the ZSP400, the
accum_a and accum_b data types are placed in r1r0 and r3r2,
respectively, to allow the use of accumulator-specific operations.
Although the compiler treats accum_a and accum_b as 32-bit variables,
the accumulator instructions (for example, mac.a, mac2.a, macn.a ... )
operate on a 40-bit accumulator. The high-order 8 bits for each
accumulator are in the %guard register. If 40-bit accumulators are
needed, the high-order bits can be accessed through inline assembly
instructions that read or modify the %guard register. In ZSPG2, since
every GPR pair supports accumulator operations, other accumulators
can be used by declaring them with:
In fact, accum_a and accum_b declarations are equivalent to:
where “X” is the appropriate register.
It should be remembered that only accumulators r12-r15 have their guard
bits preserved across calls.
C Cross Compiler
Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved.
C Data Type
accum_b
float
double
register long acc_c asm(“rX”);
register long x asm (“rX”);
Compiler’s Representation of C Data Types (Cont.)
Representation
32 bits
32 bits
32 bits