macros.h 1005 Bytes
#ifndef	MACROS_H
#define	MACROS_H
#ifdef __cplusplus
extern "C" {
#endif 

#include <assert.h>

#define IsSymScalarRegister(symPtr) (symPtr->flag & SYM_SCALAR_REGISTER)
#define IsSymVectorRegister(symPtr) (symPtr->flag & SYM_VECTOR_REGISTER)
#define IsSymControlRegister(symPtr) (symPtr->flag & SYM_CONTROL_REGISTER)
#define IsSymLabel(symPtr) (symPtr->flag & SYM_LABEL)
#define IsSymHalf(symPtr) (symPtr->flag & SYM_HALF)
#define IsSymData(symPtr) (symPtr->flag & SYM_DATA)
#define IsSymDefined(symPtr) (symPtr->flag & SYM_DEFINED)
#define IsSymReferenced(symPtr) (symPtr->flag & SYM_REFERENCED)
#define SymType(symPtr) (symPtr->flag & SYM_TYPES)

#ifndef LoadField
#define LoadField(inst, high, low, bits) {unsigned int mask;assert(high>=low);\
			mask = (0xffffffff>>(31-high)) ^ (0x7fffffff>>(31-low));\
			inst = (inst & ~mask) | (mask & (bits<<low));} 
#endif

#define ExtractBits(inst, high, low) ((inst >> low) & (0xffffffff>>(31-(high-low))))


#ifdef __cplusplus
}
#endif 
#endif /* MACROS_H */