const u64a *ft =
(const u64a *)((const u8 *)fdr + ROUNDUP_CL(sizeof(struct FDR)));
assert(ISALIGNED_CL(ft));
- const u32 *confBase =
- (const u32 *)((const u8 *)ft + ROUNDUP_CL(fdr->tabSize));
+ const u32 *confBase = (const u32 *)((const u8 *)fdr + fdr->confOffset);
assert(ISALIGNED_CL(confBase));
struct zone zones[ZONE_MAX];
assert(fdr->domain > 8 && fdr->domain < 16);
// Write confirm structures.
assert(ISALIGNED_CL(ptr));
+ fdr->confOffset = verify_u32(ptr - fdr_base);
memcpy(ptr, confirmTable.get(), confirmTable.size());
ptr += ROUNDUP_CL(confirmTable.size());
u32 engineID;
u32 size;
u32 maxStringLen;
+ u32 confOffset;
u32 floodOffset;
u8 stride; /* stride - how frequeuntly the data is consulted by the first
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 1);
+ const u32 *confBase = getConfBase(teddy);
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
DEBUG_PRINTF("derive: ptr: %p mainstart %p\n", ptr, mainStart);
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 1);
+ const u32 *confBase = getConfBase(teddy);
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
DEBUG_PRINTF("derive: ptr: %p mainstart %p\n", ptr, mainStart);
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 2);
+ const u32 *confBase = getConfBase(teddy);
m128 res_old_1 = ones128();
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 2);
+ const u32 *confBase = getConfBase(teddy);
m128 res_old_1 = ones128();
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 3);
+ const u32 *confBase = getConfBase(teddy);
m128 res_old_1 = ones128();
m128 res_old_2 = ones128();
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 3);
+ const u32 *confBase = getConfBase(teddy);
m128 res_old_1 = ones128();
m128 res_old_2 = ones128();
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 4);
+ const u32 *confBase = getConfBase(teddy);
m128 res_old_1 = ones128();
m128 res_old_2 = ones128();
a->buf, a->len, a->start_offset);
const m128 *maskBase = getMaskBase(teddy);
- const u32 *confBase = getConfBase(teddy, 4);
+ const u32 *confBase = getConfBase(teddy);
m128 res_old_1 = ones128();
m128 res_old_2 = ones128();
return (const m256 *)((const u8 *)teddy + ROUNDUP_CL(sizeof(struct Teddy)));
}
-static really_inline
-const u32 *getConfBase_avx2(const struct Teddy *teddy, u8 numMask) {
- return (const u32 *)((const u8 *)teddy + ROUNDUP_CL(sizeof(struct Teddy)) +
- ROUNDUP_CL((numMask * 32 * 2)));
-}
-
hwlm_error_t fdr_exec_teddy_avx2_msks1_fat(const struct FDR *fdr,
const struct FDR_Runtime_Args *a,
hwlm_group_t control) {
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 1);
+ const u32 *confBase = getConfBase(teddy);
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
DEBUG_PRINTF("derive: ptr: %p mainstart %p\n", ptr, mainStart);
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 1);
+ const u32 *confBase = getConfBase(teddy);
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
DEBUG_PRINTF("derive: ptr: %p mainstart %p\n", ptr, mainStart);
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 2);
+ const u32 *confBase = getConfBase(teddy);
m256 res_old_1 = ones256();
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 2);
+ const u32 *confBase = getConfBase(teddy);
m256 res_old_1 = ones256();
const u8 *mainStart = ROUNDUP_PTR(ptr, 16);
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 3);
+ const u32 *confBase = getConfBase(teddy);
m256 res_old_1 = ones256();
m256 res_old_2 = ones256();
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 3);
+ const u32 *confBase = getConfBase(teddy);
m256 res_old_1 = ones256();
m256 res_old_2 = ones256();
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 4);
+ const u32 *confBase = getConfBase(teddy);
m256 res_old_1 = ones256();
m256 res_old_2 = ones256();
a->buf, a->len, a->start_offset);
const m256 *maskBase = getMaskBase_avx2(teddy);
- const u32 *confBase = getConfBase_avx2(teddy, 4);
+ const u32 *confBase = getConfBase(teddy);
m256 res_old_1 = ones256();
m256 res_old_2 = ones256();
// Write confirm structures.
u8 *ptr = teddy_base + headerSize + maskLen;
assert(ISALIGNED_CL(ptr));
+ teddy->confOffset = verify_u32(ptr - teddy_base);
memcpy(ptr, confirmTable.get(), confirmTable.size());
ptr += ROUNDUP_CL(confirmTable.size());
/*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
u32 engineID;
u32 size;
u32 maxStringLen;
+ u32 confOffset;
u32 floodOffset;
u32 link;
u32 pad1;
}
static really_inline
-const u32 *getConfBase(const struct Teddy *teddy, u8 numMask) {
- return (const u32 *)((const u8 *)teddy + ROUNDUP_CL(sizeof(struct Teddy)) +
- ROUNDUP_CL(numMask * 32));
+const u32 *getConfBase(const struct Teddy *teddy) {
+ return (const u32 *)((const u8 *)teddy + teddy->confOffset);
}
#endif /* TEDDY_RUNTIME_COMMON_H_ */