ObjFW  Check-in [d53c87e7bb]

Overview
Comment:OFMatrix4x4: Partially unroll multiplication loop

This way, `result` doesn't need to be initialized.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d53c87e7bbbe753369b5f04e3b73c9d5339e25a3ad0d6a6d6259b8dc1463cb86
User & Date: js on 2023-10-31 20:27:32
Other Links: manifest | tags
Context
2023-10-31
20:38
Move AMD64/ELF assembly back to AT&T syntax check-in: da613d0cb5 user: js tags: trunk
20:27
OFMatrix4x4: Partially unroll multiplication loop check-in: d53c87e7bb user: js tags: trunk
20:25
Don't use -masm=intel check-in: d9af65de97 user: js tags: trunk
Changes

Modified src/OFMatrix4x4.m from [c5f86994f5] to [b494f24572].

199
200
201
202
203
204
205
206

207
208
209
210
211
212





213
214
215
216
217
218
219
199
200
201
202
203
204
205

206
207
208
209



210
211
212
213
214
215
216
217
218
219
220
221







-
+



-
-
-
+
+
+
+
+







	OFHashFinalize(&hash);

	return hash;
}

- (void)multiplyWithMatrix: (OFMatrix4x4 *)matrix
{
	float result[4][4] = {{ 0 }};
	float result[4][4];

	for (uint_fast8_t i = 0; i < 4; i++)
		for (uint_fast8_t j = 0; j < 4; j++)
			for (uint_fast8_t k = 0; k < 4; k++)
				result[i][j] +=
				    matrix->_values[i][k] * _values[k][j];
			result[i][j] =
			    matrix->_values[i][0] * _values[0][j] +
			    matrix->_values[i][1] * _values[1][j] +
			    matrix->_values[i][2] * _values[2][j] +
			    matrix->_values[i][3] * _values[3][j];

	memcpy(_values, result, sizeof(result));
}

- (void)translateWithVector: (OFVector3D)vector
{
	OFMatrix4x4 *translation = [[OFMatrix4x4 alloc] initWithValues: