Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support systems with 128-bit pointers. #19

Open
wants to merge 1 commit into
base: 128b-pointer
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ OUTCMD = $(OUTFLAG) $(OUTFILE) $(LFLAGS_END)
HEADERS = coremark.h
CHECK_FILES = $(ORIG_SRCS) $(HEADERS)

ifdef POINTER_SPACE
CFLAGS+= -DPOINTER_SPACE=$(POINTER_SPACE)
endif

$(OPATH):
$(MKDIR) $(OPATH)

Expand Down
2 changes: 1 addition & 1 deletion core_list_join.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ ee_u16 core_bench_list(core_results *res, ee_s16 finder_idx) {
*/
list_head *core_list_init(ee_u32 blksize, list_head *memblock, ee_s16 seed) {
/* calculated pointers for the list */
ee_u32 per_item=16+sizeof(struct list_data_s);
ee_u32 per_item=(2*POINTER_SPACE)+sizeof(struct list_data_s);
ee_u32 size=(blksize/per_item)-2; /* to accomodate systems with 64b pointers, and make sure same code is executed, set max list elements */
list_head *memblock_end=memblock+size;
list_data *datablock=(list_data *)(memblock_end);
Expand Down
11 changes: 11 additions & 0 deletions core_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,19 @@ Original Author: Shay Gal-on
Returns:
NULL.
*/
#if POINTER_SPACE == 8
static ee_u16 list_known_crc[] = {(ee_u16)0xd4b0,(ee_u16)0x3340,(ee_u16)0x6a79,(ee_u16)0xe714,(ee_u16)0xe3c1};
static ee_u16 matrix_known_crc[] = {(ee_u16)0xbe52,(ee_u16)0x1199,(ee_u16)0x5608,(ee_u16)0x1fd7,(ee_u16)0x0747};
static ee_u16 state_known_crc[] = {(ee_u16)0x5e47,(ee_u16)0x39bf,(ee_u16)0xe5a4,(ee_u16)0x8e3a,(ee_u16)0x8d84};
#elif POINTER_SPACE == 16
/* Reference CRCs from amd64 */
/* FIXME, cases 0-2 need updating */
static ee_u16 list_known_crc[] = {(ee_u16)0,(ee_u16)0,(ee_u16)0,(ee_u16)0x70a5,(ee_u16)0x6329};
static ee_u16 matrix_known_crc[] = {(ee_u16)0,(ee_u16)0,(ee_u16)0,(ee_u16)0xdb4b,(ee_u16)0xbf03};
static ee_u16 state_known_crc[] = {(ee_u16)0,(ee_u16)0,(ee_u16)0,(ee_u16)0x905f,(ee_u16)0x5735};
#else
#error Unhandled POINTER_SPACE value
#endif
void *iterate(void *pres) {
ee_u32 i;
ee_u16 crc;
Expand Down Expand Up @@ -284,6 +294,7 @@ MAIN_RETURN_TYPE main(int argc, char *argv[]) {
}
total_errors+=check_data_types();
/* and report results */
ee_printf("Pointer space : %d\n", POINTER_SPACE);
ee_printf("CoreMark Size : %lu\n", (long unsigned) results[0].size);
ee_printf("Total ticks : %lu\n", (long unsigned) total_time);
#if HAS_FLOAT
Expand Down
5 changes: 5 additions & 0 deletions coremark.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ typedef ee_u32 secs_ret;
#define MAIN_RETURN_TYPE int
#endif

#ifndef POINTER_SPACE
/* Reserve 64b per pointer */
#define POINTER_SPACE 8
#endif

void start_time(void);
void stop_time(void);
CORE_TICKS get_time(void);
Expand Down