diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_1.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_1.zkasm new file mode 100644 index 000000000000..e9f95fbdec03 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_1.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 4294967295n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 0n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_2.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_2.zkasm new file mode 100644 index 000000000000..547476f1946f --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_2.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 0n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 32n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_3.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_3.zkasm new file mode 100644 index 000000000000..15439f0cbccf --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_3.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 32768n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 16n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_4.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_4.zkasm new file mode 100644 index 000000000000..435e84c3c279 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_4.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 255n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 24n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_5.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_5.zkasm new file mode 100644 index 000000000000..5f6bafb090c8 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_5.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 2147483648n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 0n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_6.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_6.zkasm new file mode 100644 index 000000000000..f4eeca15b047 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_6.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 1n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 31n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_7.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_7.zkasm new file mode 100644 index 000000000000..cd17dc14b8ad --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_7.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 2n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 30n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/clz_8.zkasm b/cranelift/zkasm_data/spectest/i32/generated/clz_8.zkasm new file mode 100644 index 000000000000..2394d0d2ddda --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/clz_8.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 2147483647n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I32) + 1n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/ctz_1.zkasm b/cranelift/zkasm_data/spectest/i32/generated/ctz_1.zkasm new file mode 100644 index 000000000000..a23400e98f48 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/ctz_1.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 4294967295n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I32) + 0n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/ctz_2.zkasm b/cranelift/zkasm_data/spectest/i32/generated/ctz_2.zkasm new file mode 100644 index 000000000000..b7fec6b5fd4e --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/ctz_2.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 0n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I32) + 32n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/ctz_3.zkasm b/cranelift/zkasm_data/spectest/i32/generated/ctz_3.zkasm new file mode 100644 index 000000000000..d8b8518932a5 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/ctz_3.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 32768n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I32) + 15n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/ctz_4.zkasm b/cranelift/zkasm_data/spectest/i32/generated/ctz_4.zkasm new file mode 100644 index 000000000000..adbff77b9404 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/ctz_4.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 65536n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I32) + 16n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/ctz_5.zkasm b/cranelift/zkasm_data/spectest/i32/generated/ctz_5.zkasm new file mode 100644 index 000000000000..eac8e5269ed2 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/ctz_5.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 2147483648n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I32) + 31n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/generated/ctz_6.zkasm b/cranelift/zkasm_data/spectest/i32/generated/ctz_6.zkasm new file mode 100644 index 000000000000..4a8d3ad804b6 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i32/generated/ctz_6.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 2147483647n => B ;; LoadConst32 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I32) + 0n => B ;; LoadConst32 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i32/state.csv b/cranelift/zkasm_data/spectest/i32/state.csv index 26954c3b5209..c52ad7d23688 100644 --- a/cranelift/zkasm_data/spectest/i32/state.csv +++ b/cranelift/zkasm_data/spectest/i32/state.csv @@ -15,20 +15,20 @@ and_5,pass,18 and_6,pass,18 and_7,pass,18 and_8,pass,18 -clz_1,compilation failed, -clz_2,compilation failed, -clz_3,compilation failed, -clz_4,compilation failed, -clz_5,compilation failed, -clz_6,compilation failed, -clz_7,compilation failed, -clz_8,compilation failed, -ctz_1,compilation failed, -ctz_2,compilation failed, -ctz_3,compilation failed, -ctz_4,compilation failed, -ctz_5,compilation failed, -ctz_6,compilation failed, +clz_1,runtime error, +clz_2,runtime error, +clz_3,runtime error, +clz_4,runtime error, +clz_5,runtime error, +clz_6,runtime error, +clz_7,runtime error, +clz_8,runtime error, +ctz_1,runtime error, +ctz_2,runtime error, +ctz_3,runtime error, +ctz_4,runtime error, +ctz_5,runtime error, +ctz_6,runtime error, div_s_1,pass,27 div_s_10,runtime error, div_s_11,pass,27 diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_1.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_1.zkasm new file mode 100644 index 000000000000..51182265def9 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_1.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 18446744073709551615n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 0n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_2.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_2.zkasm new file mode 100644 index 000000000000..a7dbff492554 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_2.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 0n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 64n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_3.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_3.zkasm new file mode 100644 index 000000000000..be6d943f2bc6 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_3.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 32768n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 48n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_4.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_4.zkasm new file mode 100644 index 000000000000..b88fcb9eed9d --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_4.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 255n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 56n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_5.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_5.zkasm new file mode 100644 index 000000000000..51bb34c667f6 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_5.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 9223372036854775808n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 0n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_6.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_6.zkasm new file mode 100644 index 000000000000..ebfb499011f9 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_6.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 1n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 63n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_7.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_7.zkasm new file mode 100644 index 000000000000..0131eb5f939b --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_7.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 2n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 62n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/clz_8.zkasm b/cranelift/zkasm_data/spectest/i64/generated/clz_8.zkasm new file mode 100644 index 000000000000..c5b75d2126a0 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/clz_8.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 9223372036854775807n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, true, types::I64) + 1n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/ctz_1.zkasm b/cranelift/zkasm_data/spectest/i64/generated/ctz_1.zkasm new file mode 100644 index 000000000000..2f5d70a582f3 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/ctz_1.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 18446744073709551615n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I64) + 0n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/ctz_2.zkasm b/cranelift/zkasm_data/spectest/i64/generated/ctz_2.zkasm new file mode 100644 index 000000000000..722a6d41997d --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/ctz_2.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 0n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I64) + 64n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/ctz_3.zkasm b/cranelift/zkasm_data/spectest/i64/generated/ctz_3.zkasm new file mode 100644 index 000000000000..62786f4f96d4 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/ctz_3.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 32768n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I64) + 15n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/ctz_4.zkasm b/cranelift/zkasm_data/spectest/i64/generated/ctz_4.zkasm new file mode 100644 index 000000000000..48fb822ee106 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/ctz_4.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 65536n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I64) + 16n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/ctz_5.zkasm b/cranelift/zkasm_data/spectest/i64/generated/ctz_5.zkasm new file mode 100644 index 000000000000..760a1d97a899 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/ctz_5.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 9223372036854775808n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I64) + 63n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/generated/ctz_6.zkasm b/cranelift/zkasm_data/spectest/i64/generated/ctz_6.zkasm new file mode 100644 index 000000000000..4ec08fe14f97 --- /dev/null +++ b/cranelift/zkasm_data/spectest/i64/generated/ctz_6.zkasm @@ -0,0 +1,27 @@ +start: + 0xffff => SP + zkPC + 2 => RR + :JMP(function_1) + :JMP(finalizeExecution) +function_1: + SP - 1 => SP + RR :MSTORE(SP) + C :MSTORE(SP - 1) + E :MSTORE(SP - 2) + B :MSTORE(SP - 3) + SP - 4 => SP + 9223372036854775807n => B ;; LoadConst64 + FIXME: Inst::Cltz(Writable { reg: v199 }, Writable { reg: v197 }, Writable { reg: v198 }, v192, false, types::I64) + 0n => B ;; LoadConst64 + B :ASSERT + SP + 4 => SP + $ => C :MLOAD(SP - 1) + $ => E :MLOAD(SP - 2) + $ => B :MLOAD(SP - 3) + $ => RR :MLOAD(SP) + SP + 1 => SP + :JMP(RR) +finalizeExecution: + ${beforeLast()} :JMPN(finalizeExecution) + :JMP(start) +INCLUDE "helpers/2-exp.zkasm" \ No newline at end of file diff --git a/cranelift/zkasm_data/spectest/i64/state.csv b/cranelift/zkasm_data/spectest/i64/state.csv index a10afb02cb6f..d84969e9a320 100644 --- a/cranelift/zkasm_data/spectest/i64/state.csv +++ b/cranelift/zkasm_data/spectest/i64/state.csv @@ -15,20 +15,20 @@ and_5,pass,18 and_6,pass,18 and_7,pass,18 and_8,pass,18 -clz_1,compilation failed, -clz_2,compilation failed, -clz_3,compilation failed, -clz_4,compilation failed, -clz_5,compilation failed, -clz_6,compilation failed, -clz_7,compilation failed, -clz_8,compilation failed, -ctz_1,compilation failed, -ctz_2,compilation failed, -ctz_3,compilation failed, -ctz_4,compilation failed, -ctz_5,compilation failed, -ctz_6,compilation failed, +clz_1,runtime error, +clz_2,runtime error, +clz_3,runtime error, +clz_4,runtime error, +clz_5,runtime error, +clz_6,runtime error, +clz_7,runtime error, +clz_8,runtime error, +ctz_1,runtime error, +ctz_2,runtime error, +ctz_3,runtime error, +ctz_4,runtime error, +ctz_5,runtime error, +ctz_6,runtime error, div_s_1,pass,27 div_s_10,runtime error, div_s_11,pass,27