ObjFW  Diff

Differences From Artifact [9312a70bd8]:

To Artifact [47d3793287]:


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
27
28
29
30
31
32
33





34
35

36
37
38
39
40
41
42
43







-
-
-
-
-


-
+







#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"

#import "invoke-x86_64.h"

#import "macros.h"

#define NUM_GPR_IN 6
#define NUM_GPR_OUT 2
#define NUM_SSE_IN 8
#define NUM_X87_OUT 2

struct call_context {
	uint64_t GPR[NUM_GPR_IN + NUM_GPR_OUT];
	__m128 SSE[NUM_SSE_IN];
	__m128 SSE[NUM_SSE_INOUT];
	long double X87[NUM_X87_OUT];
	uint8_t numSSEUsed;
	uint8_t returnType;
	uint64_t stackSize;
	uint64_t stack[];
};

72
73
74
75
76
77
78
79

80
81
82
83
84
85
86
67
68
69
70
71
72
73

74
75
76
77
78
79
80
81







-
+








static void
pushDouble(struct call_context **context, uint_fast8_t *currentSSE,
    double value)
{
	struct call_context *newContext;

	if (*currentSSE < NUM_SSE_IN) {
	if (*currentSSE < NUM_SSE_INOUT) {
		(*context)->SSE[(*currentSSE)++] = (__m128)_mm_set_sd(value);
		(*context)->numSSEUsed++;
		return;
	}

	if ((newContext = realloc(*context,
	    sizeof(**context) + ((*context)->stackSize + 1) * 8)) == NULL) {
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
92
93
94
95
96
97
98

99
100
101
102
103
104
105
106







-
+







static void
pushQuad(struct call_context **context, uint_fast8_t *currentSSE,
    double low, double high)
{
	size_t stackSize;
	struct call_context *newContext;

	if (*currentSSE + 1 < NUM_SSE_IN) {
	if (*currentSSE + 1 < NUM_SSE_INOUT) {
		(*context)->SSE[(*currentSSE)++] = (__m128)_mm_set_sd(low);
		(*context)->SSE[(*currentSSE)++] = (__m128)_mm_set_sd(high);
		(*context)->numSSEUsed += 2;
		return;
	}

	stackSize = (*context)->stackSize + 2;