2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 private unit compiler.common.gvn;
23 fn gvn_encode(value_list : list(pcode_t)) : int
25 var value_number : int := 0;
28 for i := 0 to len(value_list) do [
29 var up : pcode_t := value_list[i];
32 if up >= -3 and up < 16 - 3 then [
37 ] else if up >= -32 and up < 512 - 32 then [
50 value_number or= up2 shl bit_pos;
52 //str += " " + ntos(up2);