Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GO_CORSET_COMPILE := ${GO_CORSET} compile -Dtags="${GIT_TAGS}" -Dcommit="${GIT_C

ALU := alu/add/add.zkasm alu/ext alu/mod alu/mul

BIN := bin
BIN := bin/bin.zkasm

BLAKE2f_MODEXP_DATA := blake2fmodexpdata

Expand Down Expand Up @@ -91,9 +91,9 @@ SHIFT := shf/shf.zkasm

STP := stp/stp.zkasm

TABLES_LONDON := reftables/*.lisp reftables/london/*.lisp
TABLES_CANCUN := reftables/*.lisp reftables/cancun/*.lisp
TABLES_PRAGUE := reftables/*.lisp reftables/prague/*.lisp
TABLES_LONDON := reftables/london/*.lisp
TABLES_CANCUN := reftables/cancun/*.lisp
TABLES_PRAGUE := reftables/prague/*.lisp

TRM := trm/trm.zkasm

Expand Down
59 changes: 59 additions & 0 deletions bin/bin.zkasm
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
;; BIN module
include "../constants/evm.zkasm"
include "../util/bit_xoan.zkasm"
include "../util/byte.zkasm"
include "../util/signextend.zkasm"

;; The bin module (BIN) handles the following 6 EVM instructions :
;; 1. AND 2. OR 3. XOR
;; 4. NOT 5. BYTE 6. SIGNEXTEND
;; The first four correspond to the bitwise operations.
;; BYTE and SIGNEXTEND need to extract a byte from ARGUMENT_2.
pub fn bin(INST=0x16 u8, ARGUMENT_1 u256, ARGUMENT_2 u256) -> (RES u256) {

if INST==EVM_INST_XOR goto xor_call
if INST==EVM_INST_OR goto or_call
if INST==EVM_INST_AND goto and_call
if INST==EVM_INST_NOT goto not_call
if INST==EVM_INST_BYTE goto byte_call
if INST==EVM_INST_SIGNEXTEND goto signextend_call
fail
var inst u2

xor_call:
inst = 0
RES = bit_xoan_u256(inst, ARGUMENT_1, ARGUMENT_2)
return
or_call:
inst = 1
RES = bit_xoan_u256(inst, ARGUMENT_1, ARGUMENT_2)
return
and_call:
inst = 2
RES = bit_xoan_u256(inst, ARGUMENT_1, ARGUMENT_2)
return
not_call:
inst = 3
RES = bit_xoan_u256(inst, ARGUMENT_1, ARGUMENT_2)
return
byte_call:
var n u5
var c0 u251
c0, n = ARGUMENT_1
if c0 != 0 goto exit_0
RES = byte256(ARGUMENT_2, n)
return
signextend_call:
var size u5
var c1 u251
c1, size = ARGUMENT_1
if c1 != 0 goto exit_unchanged
RES = signextend(size, ARGUMENT_2)
return
exit_0:
RES = 0
return
exit_unchanged:
RES = ARGUMENT_2
return
}
53 changes: 0 additions & 53 deletions bin/columns.lisp

This file was deleted.

209 changes: 0 additions & 209 deletions bin/constraints.lisp

This file was deleted.

42 changes: 0 additions & 42 deletions bin/lookups/bin_into_binreftable.lisp

This file was deleted.

Loading
Loading