Inquiring About Alignment - Intel i960 User Manual

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

7
7-48
i960 Processor Compiler User's Guide

Inquiring about Alignment

The keyword
__alignof__
aligned, or the minimum alignment usually required by a type. Its syntax
is just like
.
sizeof
For example, the target machine requires a
an 8-byte boundary, then
i960 processor.
When the operand of
__alignof__
value is the largest alignment that the lvalue is known to have. It may
have this alignment as a result of its data type, or because it is part of a
structure and inherits alignment from that structure. For example, after
this declaration:
struct foo { int x; char y; } foo1;
the value of
__alignof__ (foo1.y)
(
), even though the data type of
int
alignment.
Inline Functions Are as Fast as Macros
By declaring a function
that function's code into the code for its callers. This makes execution
faster by eliminating the function-call overhead; in addition, if any of the
actual argument values are constant, their known values may permit
simplifications at compile time so that not all of the inline function's code
needs to be included.
To declare a function inline, use the
For gcc960, use either
inline
For example:
inline int
inc (int *a)
{
(*a)++;
}
allows you to inquire about how an object is
double
__alignof__ (double)
is a lvalue rather than a type, the
is 4, the same as
does not itself demand any
foo1.y
, you can direct the compiler to integrate
inline
keyword in its declaration.
inline
or
. For ic960, use
__inline
value to be aligned on
is 8. This is true on the
__alignof__
.
__inline

Advertisement

Table of Contents
loading

Table of Contents