1/* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Copyright 2014, Rene Gollent, rene@gollent.com. 4 * Distributed under the terms of the MIT License. 5 */ 6#ifndef REGISTER_H 7#define REGISTER_H 8 9 10#include <SupportDefs.h> 11 12 13enum register_format { 14 REGISTER_FORMAT_INTEGER, 15 REGISTER_FORMAT_FLOAT, 16 REGISTER_FORMAT_SIMD 17}; 18 19enum register_type { 20 REGISTER_TYPE_INSTRUCTION_POINTER, 21 REGISTER_TYPE_STACK_POINTER, 22 REGISTER_TYPE_RETURN_ADDRESS, 23 REGISTER_TYPE_GENERAL_PURPOSE, 24 REGISTER_TYPE_SPECIAL_PURPOSE, 25 REGISTER_TYPE_EXTENDED 26}; 27 28 29class Register { 30public: 31 Register(int32 index, const char* name, 32 uint32 bitSize, uint32 valueType, 33 register_type type, bool calleePreserved); 34 // name will not be cloned 35 36 int32 Index() const { return fIndex; } 37 const char* Name() const { return fName; } 38 uint32 ValueType() const { return fValueType; } 39 register_format Format() const { return fFormat; } 40 uint32 BitSize() const { return fBitSize; } 41 register_type Type() const { return fType; } 42 bool IsCalleePreserved() const 43 { return fCalleePreserved; } 44 45private: 46 int32 fIndex; 47 const char* fName; 48 uint32 fBitSize; 49 uint32 fValueType; 50 register_format fFormat; 51 register_type fType; 52 bool fCalleePreserved; 53 54}; 55 56 57#endif // REGISTER_H 58