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
7
8#include "Register.h"
9
10#include <TypeConstants.h>
11
12
13Register::Register(int32 index, const char* name, uint32 bitSize,
14	uint32 valueType, register_type type, bool calleePreserved)
15	:
16	fIndex(index),
17	fName(name),
18	fBitSize(bitSize),
19	fValueType(valueType),
20	fType(type),
21	fCalleePreserved(calleePreserved)
22{
23	switch (fValueType) {
24		case B_INT8_TYPE:
25		case B_UINT8_TYPE:
26		case B_INT16_TYPE:
27		case B_UINT16_TYPE:
28		case B_INT32_TYPE:
29		case B_UINT32_TYPE:
30		case B_INT64_TYPE:
31		case B_UINT64_TYPE:
32			fFormat = REGISTER_FORMAT_INTEGER;
33			break;
34		case B_FLOAT_TYPE:
35		case B_DOUBLE_TYPE:
36			fFormat = REGISTER_FORMAT_FLOAT;
37			break;
38		case B_RAW_TYPE:
39			fFormat = REGISTER_FORMAT_SIMD;
40			break;
41		default:
42			fFormat = REGISTER_FORMAT_INTEGER;
43			break;
44	}
45}
46