Volatile Objects - Intel i960 User Manual

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

Advertisement

12

Volatile Objects

12-4
i960 Processor Compiler User's Guide
Here is an example of how these assumptions are used:
#include <string.h>
...
struct {
int s1;
int s2;
int s3;
} *s;
/* (1) *s is assumed to be 16 byte aligned
*/
extern char mybuf[23];
/* (2) mybuf is assumed to be 16 byte aligned */
memcpy (mybuf, s, sizeof (*s));
The compiler would generate:
ldt (s), r
stt r, mybuf
in lieu of the call to
memcpy
should the assumptions mentioned above prove false.
The compiler aggressively attempts to remove redundant memory
references (both loads and stores), and it attempts function inlining across
multiple
files. If your program expects actual memory references to be
.c
made at certain points in the program, you must make those references
volatile. Volatile objects are guaranteed to be updated at certain sequence
points in the program (e.g., between semicolons,
calls).
; the memory references would be unaligned
&&
,
,
, and before
||
?:

Advertisement

Table of Contents
loading

Table of Contents