-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed hebi_packet size to 128-bits on 64-bit platforms
- Loading branch information
1 parent
9826e46
commit 1e6b485
Showing
53 changed files
with
1,225 additions
and
985 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 |
---|---|---|
|
@@ -226,6 +226,7 @@ BENCH_DEPS := $(DEPS) bench/bench.h | |
CHECK_P := \ | ||
pcmp \ | ||
pcopy \ | ||
pmove \ | ||
pnorm \ | ||
pzero | ||
|
||
|
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,31 +1,45 @@ | ||
#include "../check.h" | ||
#include <string.h> | ||
|
||
#define NUM_PACKETS 501 | ||
#define NUM_DIGITS (NUM_PACKETS * HEBI_PACKET_LIMBS64) | ||
#define NUM_BYTES (NUM_PACKETS * sizeof(hebi_packet)) | ||
#define COUNT 1024 | ||
#define GUARD 8 | ||
#define TOTAL (COUNT+GUARD*2) | ||
|
||
static const uint32_t a[4] = { 0xECECECEC, 0x38383838, 0x92929292, 0xA7A7A7A7 }; | ||
static const uint32_t b[4] = { 0x3D3D3D3D, 0x6B6B6B6B, 0x71717171, 0xFEFEFEFE }; | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
hebi_packet *x, *y; | ||
size_t i, j; | ||
size_t i, j, k; | ||
|
||
x = hebi_palloc(HEBI_ALLOC_DEFAULT, NUM_PACKETS); | ||
y = hebi_palloc(HEBI_ALLOC_DEFAULT, NUM_PACKETS); | ||
x = hebi_palloc(HEBI_ALLOC_DEFAULT, TOTAL); | ||
y = hebi_palloc(HEBI_ALLOC_DEFAULT, TOTAL); | ||
assert(x && y); | ||
|
||
for (i = 0; i < NUM_PACKETS; ++i) { | ||
for (j = 0; j < HEBI_PACKET_LIMBS64; ++j) { | ||
x[i].hp_limbs64[j] = (uint64_t)i; | ||
y[i].hp_limbs64[j] = (uint64_t)i + 55; | ||
for (k = 1; k <= COUNT; k++) { | ||
for (i = 0; i < k+GUARD*2; i++) { | ||
for (j = 0; j < HEBI_PACKET_LIMBS32; j++) { | ||
x[i].hp_limbs32[j] = a[(k+j)&7]; | ||
y[i].hp_limbs32[j] = b[(k+j)&7]; | ||
} | ||
} | ||
} | ||
|
||
assert(memcmp(x, y, NUM_BYTES) != 0); | ||
hebi_pcopy(y, x, NUM_PACKETS); | ||
assert(memcmp(x, y, NUM_BYTES) == 0); | ||
assert(memcmp(y+GUARD, x+GUARD, k*sizeof(hebi_packet)) != 0); | ||
|
||
hebi_pcopy(y+GUARD, x+GUARD, k); | ||
|
||
assert(memcmp(y+GUARD, x+GUARD, k*sizeof(hebi_packet)) == 0); | ||
|
||
for (i = 0; i < GUARD; i++) { | ||
for (j = 0; j < HEBI_PACKET_LIMBS32; j++) { | ||
assert(y[i].hp_limbs32[j] == b[(k+j)&7]); | ||
assert(y[i+k+GUARD].hp_limbs32[j] == b[(k+j)&7]); | ||
} | ||
} | ||
} | ||
|
||
hebi_pfree(HEBI_ALLOC_DEFAULT, x, NUM_PACKETS); | ||
hebi_pfree(HEBI_ALLOC_DEFAULT, y, NUM_PACKETS); | ||
hebi_pfree(HEBI_ALLOC_DEFAULT, x, TOTAL); | ||
hebi_pfree(HEBI_ALLOC_DEFAULT, y, TOTAL); | ||
return 0; | ||
} |
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,45 @@ | ||
#include "../check.h" | ||
#include <string.h> | ||
|
||
#define COUNT 1024 | ||
#define GUARD 8 | ||
#define TOTAL (COUNT+GUARD*2) | ||
|
||
static const uint32_t a[4] = { 0xECECECEC, 0x38383838, 0x92929292, 0xA7A7A7A7 }; | ||
static const uint32_t b[4] = { 0x3D3D3D3D, 0x6B6B6B6B, 0x71717171, 0xFEFEFEFE }; | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
hebi_packet *x, *y; | ||
size_t i, j, k; | ||
|
||
x = hebi_palloc(HEBI_ALLOC_DEFAULT, TOTAL); | ||
y = hebi_palloc(HEBI_ALLOC_DEFAULT, TOTAL); | ||
assert(x && y); | ||
|
||
for (k = 1; k <= COUNT; k++) { | ||
for (i = 0; i < k+GUARD*2; i++) { | ||
for (j = 0; j < HEBI_PACKET_LIMBS32; j++) { | ||
x[i].hp_limbs32[j] = a[(k+j)&7]; | ||
y[i].hp_limbs32[j] = b[(k+j)&7]; | ||
} | ||
} | ||
|
||
assert(memcmp(y+GUARD, x+GUARD, k*sizeof(hebi_packet)) != 0); | ||
|
||
hebi_pmove(y+GUARD, x+GUARD, k); | ||
|
||
assert(memcmp(y+GUARD, x+GUARD, k*sizeof(hebi_packet)) == 0); | ||
|
||
for (i = 0; i < GUARD; i++) { | ||
for (j = 0; j < HEBI_PACKET_LIMBS32; j++) { | ||
assert(y[i].hp_limbs32[j] == b[(k+j)&7]); | ||
assert(y[i+k+GUARD].hp_limbs32[j] == b[(k+j)&7]); | ||
} | ||
} | ||
} | ||
|
||
hebi_pfree(HEBI_ALLOC_DEFAULT, x, TOTAL); | ||
hebi_pfree(HEBI_ALLOC_DEFAULT, y, TOTAL); | ||
return 0; | ||
} |
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
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
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,4 +1,5 @@ | ||
#include "../check.h" | ||
#include <stdio.h> | ||
|
||
int | ||
main(int argc, char *argv[]) | ||
|
Oops, something went wrong.