Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infer opcodes added #1852

Merged
merged 1 commit into from
Dec 15, 2023
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
10 changes: 0 additions & 10 deletions core/vm/opcodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ func (op OpCode) IsPush() bool {
return PUSH0 <= op && op <= PUSH32
}

func (op OpCode) IsInfer() bool {
return op == INFER || op == INFERARRAY
}

const (
STOP OpCode = 0x0
ADD OpCode = 0x1
Expand Down Expand Up @@ -201,12 +197,6 @@ const (
LOG4
)

const (
INFER OpCode = 0xc0
INFERARRAY = 0xc1
// NNFORWARD = 0xc2
)

// 0xf0 range - closures.
const (
CREATE OpCode = 0xf0 + iota
Expand Down
27 changes: 27 additions & 0 deletions core/vm/opcodes_infer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2023 The CortexThesus Authors
// This file is part of the CortexFoundation library.
//
// The CortexFoundation library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The CortexFoundation library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the CortexFoundation library. If not, see <http://www.gnu.org/licenses/>.

package vm

func (op OpCode) IsInfer() bool {
return op == INFER || op == INFERARRAY
}

const (
INFER OpCode = 0xc0
INFERARRAY = 0xc1
// NNFORWARD = 0xc2
)