fix if condition on 16-bit cpus

optimize
Clyne 11 months ago
parent 6bd7338414
commit 6dcf780a3b
Signed by: clyne
GPG Key ID: 3267C8EBF3F9AFC7

@ -178,14 +178,14 @@ execute:
state.compiling(false); state.compiling(false);
cell = state.pop(); cell = state.pop();
dcell = (cell - state.dict.latest()) << 6; dcell = cell - state.dict.latest();
if (dcell > (((1 << (sizeof(Cell) * 8 - 6)) - 1) << 6)) { if (dcell > (1 << (sizeof(Cell) * 8 - 6)) - 1) {
state.dict.write(cell, state.dict.write(cell,
(state.dict.read(cell) & 0x1F) | static_cast<Cell>(((1 << (sizeof(Cell) * 8 - 6)) - 1) << 6)); (state.dict.read(cell) & 0x1F) | static_cast<Cell>(((1 << (sizeof(Cell) * 8 - 6)) - 1) << 6));
state.dict.write(static_cast<Addr>(cell) + sizeof(Cell), static_cast<Cell>(dcell >> 6)); state.dict.write(static_cast<Addr>(cell) + sizeof(Cell), static_cast<Cell>(dcell));
} else { } else {
state.dict.write(cell, state.dict.write(cell,
(state.dict.read(cell) & 0x1F) | static_cast<Cell>(dcell)); (state.dict.read(cell) & 0x1F) | static_cast<Cell>(dcell << 6));
} }
state.dict.latest(cell); state.dict.latest(cell);
break; break;

Loading…
Cancel
Save