
3-22
C Cross Compiler
read_creg
(creg,var) -
Puts the value of a control register into
var.
write_creg
(creg,val) -
Puts a value, which can be a variable or
an immediate, into a control register. The
val
argument can be made by
or-ing together the following masks for the following registers:
Macros have also been defined to manipulate specific bits of control
registers.
bitset_creg
(creg,bitnum)
bitclear_creg
(creg,bitnum)
bitinvert_creg
(creg,bitnum)
The bitnumber and value arguments can be filled with macros which
have been defined to the approiate value. The bitnumber and mask to
access a specific bit has been defined to “bit name”_[MASK|BIT]. For
example, to set the Q15 bit of %fmode, use the following macro:
bitset_creg(%fmode,Q15_BIT);
3.8 Q15 Support
CC supports the Q15 data type. To use Q15 arithmetic, the q15 mode
bit in the %fmode register must be set, as follows:
bitset_creg(%fmode,Q15_BIT);
The q15 mode bit affects Q15 multiplies and the N-Instrinsics
N_mul
,
N_mac
,
N_macn
,
N_mac2
, and the vector intrinsics.
Q15 arithmetic can be disabled as follows:
bitclear_creg(%fmode,Q15_BIT);
This release of the SDK does not support Q15 division.
The code produced for the Q15 data type is equivalent to that produced
for the
int
data type, except for the following three cases:
The product of two Q15s is calculated with a
mul
instruction rather
than an
imul
instruction.