Implement PANIC instruction (#644)

* Implement PANIC instruction

* Minor: comments
This commit is contained in:
Jacqueline Nabaglo 2022-07-29 12:04:42 -07:00 committed by GitHub
parent 760a111a63
commit 24bb632358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ pub struct CpuColumnsView<T: Copy> {
pub is_log2: T,
pub is_log3: T,
pub is_log4: T,
pub is_panic: T,
// PANIC does not get a flag; it fails at the decode stage.
pub is_create: T,
pub is_call: T,
pub is_callcode: T,

View File

@ -15,7 +15,7 @@ use crate::cpu::columns::{CpuColumnsView, COL_MAP};
// - its start index is a multiple of its length (it is aligned)
// These properties permit us to check if an opcode belongs to a block of length 2^n by checking its
// top 8-n bits.
const OPCODES: [(u64, usize, usize); 107] = [
const OPCODES: [(u64, usize, usize); 106] = [
// (start index of block, number of top bits to check (log2), flag column)
(0x00, 0, COL_MAP.is_stop),
(0x01, 0, COL_MAP.is_add),
@ -102,7 +102,7 @@ const OPCODES: [(u64, usize, usize); 107] = [
(0xa2, 0, COL_MAP.is_log2),
(0xa3, 0, COL_MAP.is_log3),
(0xa4, 0, COL_MAP.is_log4),
(0xa5, 0, COL_MAP.is_panic),
// Opcode 0xa5 is PANIC. Make the proof unverifiable by giving it no flag to decode to.
(0xa6, 1, COL_MAP.is_invalid_8), // 0xa6-0xa7
(0xa8, 3, COL_MAP.is_invalid_9), // 0xa8-0xaf
(0xb0, 4, COL_MAP.is_invalid_10), // 0xb0-0xbf