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