Skip to content

Commit

Permalink
remove unused packed cities long
Browse files Browse the repository at this point in the history
  • Loading branch information
austindonisan committed Feb 2, 2024
1 parent 2456f75 commit 68720a7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions 1brc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ typedef struct {
int *packed_offsets;
char *hashed_cities;
char *hashed_storage;
char *packed_cities_long;
char *hashed_cities_long;
int num_cities;
int num_cities_long;
Expand Down Expand Up @@ -216,10 +215,9 @@ void print256(__m256i var);
#define PACKED_OFFSETS_SIZE LINE_CEIL(32 * MAX_CITIES)
#define HASHED_CITIES_SIZE LINE_CEIL(SHORT_CITY_LENGTH * HASH_LENGTH)
#define HASHED_DATA_SIZE LINE_CEIL(HASH_ENTRY_SIZE * HASH_LENGTH)
#define PACKED_CITIES_LONG_SIZE LINE_CEIL(LONG_CITY_LENGTH * MAX_CITIES)
#define HASHED_CITIES_LONG_SIZE LINE_CEIL(LONG_CITY_LENGTH * HASH_LONG_LENGTH)

#define HASH_MEMORY_SIZE HUGE_PAGE_CEIL(HASH_SIZE + PACKED_CITIES_SIZE + PACKED_OFFSETS_SIZE + HASHED_CITIES_SIZE + HASHED_DATA_SIZE + PACKED_CITIES_LONG_SIZE + HASHED_CITIES_LONG_SIZE)
#define HASH_MEMORY_SIZE HUGE_PAGE_CEIL(HASH_SIZE + PACKED_CITIES_SIZE + PACKED_OFFSETS_SIZE + HASHED_CITIES_SIZE + HASHED_DATA_SIZE + HASHED_CITIES_LONG_SIZE)

#define RESULTS_SIZE LINE_CEIL(sizeof(Results))
#define RESULTS_REFS_SIZE LINE_CEIL(sizeof(ResultsRef) * MAX_CITIES)
Expand Down Expand Up @@ -565,9 +563,6 @@ void start_worker(worker_t *w, Results *out) {
hash.hashed_storage = hashData;
hashData += HASHED_DATA_SIZE;

hash.packed_cities_long = hashData;
hashData += PACKED_CITIES_LONG_SIZE;

hash.hashed_cities_long = hashData;
hashData += HASHED_CITIES_LONG_SIZE;

Expand Down Expand Up @@ -970,11 +965,6 @@ int insert_city_long(hash_t *hash, int hash_value, __m256i seg0, __m256i seg1, _
}

if (_mm256_testz_si256(stored0, stored0)) {
_mm256_store_si256((__m256i *)(hash->packed_cities_long + hash->num_cities_long * LONG_CITY_LENGTH), seg0);
_mm256_store_si256((__m256i *)(hash->packed_cities_long + hash->num_cities_long * LONG_CITY_LENGTH) + 1, seg1);
_mm256_store_si256((__m256i *)(hash->packed_cities_long + hash->num_cities_long * LONG_CITY_LENGTH) + 2, seg2);
_mm256_store_si256((__m256i *)(hash->packed_cities_long + hash->num_cities_long * LONG_CITY_LENGTH) + 3, seg3);

_mm256_store_si256((__m256i *)(hash->hashed_cities_long + hash_value), seg0);
_mm256_store_si256((__m256i *)(hash->hashed_cities_long + hash_value) + 1, seg1);
_mm256_store_si256((__m256i *)(hash->hashed_cities_long + hash_value) + 2, seg2);
Expand Down

0 comments on commit 68720a7

Please sign in to comment.