ObjFW  Diff

Differences From Artifact [ed5f594770]:

To Artifact [abe678c9cf]:


28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
43
44
45
46


47
48
49
50
51
52
53
#define NUM_GPR_OUT 2
#define NUM_SSE_IN 8
#define NUM_SSE_OUT 2

struct registers {
	uint64_t gpr[NUM_GPR_IN + NUM_GPR_OUT];
	__m128 sse[NUM_SSE_IN];

};

extern void of_invocation_call(struct registers *);

void
of_invocation_invoke(OFInvocation *invocation)
{
	OFMethodSignature *methodSignature = [invocation methodSignature];
	size_t numberOfArguments = [methodSignature numberOfArguments];
	const char *typeEncoding;
	struct registers registers;
	size_t currentGPR = 0, currentSSE = 0;



	for (size_t i = 0; i < numberOfArguments; i++) {
		union {
			uint64_t gpr;
			__m128 sse;
		} value;
		enum {







>












>
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#define NUM_GPR_OUT 2
#define NUM_SSE_IN 8
#define NUM_SSE_OUT 2

struct registers {
	uint64_t gpr[NUM_GPR_IN + NUM_GPR_OUT];
	__m128 sse[NUM_SSE_IN];
	uint8_t num_sse;
};

extern void of_invocation_call(struct registers *);

void
of_invocation_invoke(OFInvocation *invocation)
{
	OFMethodSignature *methodSignature = [invocation methodSignature];
	size_t numberOfArguments = [methodSignature numberOfArguments];
	const char *typeEncoding;
	struct registers registers;
	size_t currentGPR = 0, currentSSE = 0;

	memset(&registers, '\0', sizeof(registers));

	for (size_t i = 0; i < numberOfArguments; i++) {
		union {
			uint64_t gpr;
			__m128 sse;
		} value;
		enum {
124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140
		if (valueType == VALUE_GPR) {
			if (currentGPR < NUM_GPR_IN)
				registers.gpr[currentGPR++] = value.gpr;
			else
				/* TODO */
				abort();
		} else if (valueType == VALUE_SSE) {
			if (currentSSE < NUM_SSE_IN)
				registers.sse[currentSSE++] = value.sse;

			else
				/* TODO */
				abort();
		}
	}

	of_invocation_call(&registers);








|

>
|







127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
		if (valueType == VALUE_GPR) {
			if (currentGPR < NUM_GPR_IN)
				registers.gpr[currentGPR++] = value.gpr;
			else
				/* TODO */
				abort();
		} else if (valueType == VALUE_SSE) {
			if (currentSSE < NUM_SSE_IN) {
				registers.sse[currentSSE++] = value.sse;
				registers.num_sse++;
			} else
				/* TODO */
				abort();
		}
	}

	of_invocation_call(&registers);