In V2, change logic to avoid use mtf[-1] style to get value.
Roll back to previous logic, and use point + offset to get byte value.
Cc: Bell Song <binx.song@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bell Song <binx.song@intel.com>
uint32_t i = 4;\r
uint32_t upper_bound = state->mtf_upper_bound;\r
uint8_t* mtf = &state->mtf[4]; /* Make mtf[-1] addressable. */\r
+ uint8_t* mtft = &state->mtf[3];\r
/* Load endian-aware constant. */\r
const uint8_t b0123[4] = {0, 1, 2, 3};\r
uint32_t pattern;\r
uint8_t value = mtf[index];\r
upper_bound |= (uint32_t)v[i];\r
v[i] = value;\r
- mtf[-1] = value;\r
- while (index > 0) {\r
+ mtft[0] = value;\r
+ while (index >= 0) {\r
+ mtft[index + 1] = mtft[index];\r
index--;\r
- mtf[index + 1] = mtf[index];\r
}\r
}\r
/* Remember amount of elements to be reinitialized. */\r