-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b3cea8
commit af23325
Showing
5 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
x86: | ||
gcc -pthread mt_instructionrate.c x86_mt_instructionrate.s ../Common/timing.c -o x86_mt_instructionrate | ||
aarch64: | ||
gcc -pthread mt_instructionrate.c arm_mt_instructionrate.s ../Common/timing.c -o arm_mt_instructionrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
extern uint64_t sse_int32_add_test(uint64_t iterations, void *data) __attribute((ms_abi)); | ||
|
||
void RunTests() { | ||
uint64_t iterations = 5500000000; | ||
int testDataLength = 256; | ||
uint32_t *intTestArr = (uint32_t *)malloc(sizeof(uint32_t) * testDataLength); | ||
uint32_t *fpTestArr = (uint32_t *)malloc(sizeof(uint32_t) * testDataLength); | ||
for (int i = 0; i < testDataLength; i++) { | ||
intTestArr[i] = i; | ||
fpTestArr[i] = i * 1.2f; | ||
} | ||
|
||
fprintf(stderr, "Measuring INT32 adds with SSE\n"); | ||
float sseInt32Adds = measureFunction(iterations, sse_int32_add_test, intTestArr); | ||
|
||
printf("-----GOPS/s-----\n"); | ||
printf("SSE INT32 Adds: %f\n", sseInt32Adds); | ||
|
||
free(intTestArr); | ||
free(fpTestArr); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.text | ||
|
||
.global sse_int32_add_test | ||
|
||
/* rcx = iteration count, rdx = data */ | ||
sse_int32_add_test: | ||
movups (%rdx), %xmm0 | ||
movups 16(%rdx), %xmm1 | ||
movups 32(%rdx), %xmm2 | ||
movups 48(%rdx), %xmm3 | ||
movups 64(%rdx), %xmm4 | ||
movups 72(%rdx), %xmm5 | ||
sse_int32_add_test_loop: | ||
paddd %xmm0, %xmm0 | ||
paddd %xmm1, %xmm1 | ||
paddd %xmm2, %xmm2 | ||
paddd %xmm3, %xmm3 | ||
paddd %xmm4, %xmm4 | ||
paddd %xmm5, %xmm5 | ||
sub $24, %rcx | ||
cmp $0, %rcx | ||
jg sse_int32_add_test_loop | ||
ret |