aboutsummaryrefslogtreecommitdiff
path: root/patio-to-cranelift/src/patio/instructions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'patio-to-cranelift/src/patio/instructions.rs')
-rw-r--r--patio-to-cranelift/src/patio/instructions.rs153
1 files changed, 0 insertions, 153 deletions
diff --git a/patio-to-cranelift/src/patio/instructions.rs b/patio-to-cranelift/src/patio/instructions.rs
deleted file mode 100644
index bdfcc28e..00000000
--- a/patio-to-cranelift/src/patio/instructions.rs
+++ /dev/null
@@ -1,153 +0,0 @@
-use crate::patio::{
- operands::{PatioLocalRef, PatioOperand},
- types::PatioDataLayout,
-};
-
-pub(crate) enum PatioInstruction {
- Block(PatioBlock),
- BoolToInt(PatioBoolToInt),
- Call(PatioCall),
- CallPointer(PatioCallPointer),
- DataPtrToInt(PatioDataPtrToInt),
- If(PatioIf),
- IntAdd(PatioIntAdd),
- IntEquals(PatioIntEquals),
- IntNotEqual(PatioIntNotEqual),
- IntSub(PatioIntSub),
- IntToBool(PatioIntToBool),
- IntToDataPtr(PatioIntToDataPtr),
- LocalStore(PatioLocalStore),
- Loop(PatioLoop),
- LoopBreak(PatioLoopBreak),
- LoopContinue(PatioLoopContinue),
- MemoryLoad(PatioMemoryLoad),
- MemoryStore(PatioMemoryStore),
- Return(PatioReturn),
- Switch(PatioSwitch),
- Unreachable(PatioUnreachable),
- VarLoad(PatioVarLoad),
- VarStore(PatioVarStore),
-}
-
-pub(crate) struct PatioBlock {
- pub(crate) body: Vec<PatioInstruction>,
- pub(crate) results: Vec<PatioOperand>,
-}
-
-pub(crate) struct PatioBoolToInt {
- pub(crate) destination: PatioLocalRef,
- pub(crate) value: PatioOperand,
-}
-
-pub(crate) struct PatioCall {
- pub(crate) destinations: Vec<PatioLocalRef>,
- pub(crate) function_name: String,
- pub(crate) args: Vec<PatioOperand>,
-}
-
-pub(crate) struct PatioCallPointer {
- pub(crate) destinations: Vec<PatioLocalRef>,
- pub(crate) function_pointer: PatioOperand,
- pub(crate) args: Vec<PatioOperand>,
-}
-
-pub(crate) struct PatioDataPtrToInt {
- pub(crate) destination: PatioLocalRef,
- pub(crate) value: PatioOperand,
-}
-
-pub(crate) struct PatioIf {
- pub(crate) destinations: Vec<PatioLocalRef>,
- pub(crate) condition: PatioOperand,
- pub(crate) true_body: PatioBlock,
- pub(crate) false_body: PatioBlock,
-}
-
-pub(crate) struct PatioIntAdd {
- pub(crate) destination: PatioLocalRef,
- pub(crate) left: PatioOperand,
- pub(crate) right: PatioOperand,
-}
-
-pub(crate) struct PatioIntEquals {
- pub(crate) destination: PatioLocalRef,
- pub(crate) left: PatioOperand,
- pub(crate) right: PatioOperand,
-}
-
-pub(crate) struct PatioIntNotEqual {
- pub(crate) destination: PatioLocalRef,
- pub(crate) left: PatioOperand,
- pub(crate) right: PatioOperand,
-}
-
-pub(crate) struct PatioIntSub {
- pub(crate) destination: PatioLocalRef,
- pub(crate) left: PatioOperand,
- pub(crate) right: PatioOperand,
-}
-
-pub(crate) struct PatioIntToBool {
- pub(crate) destination: PatioLocalRef,
- pub(crate) value: PatioOperand,
-}
-
-pub(crate) struct PatioIntToDataPtr {
- pub(crate) destination: PatioLocalRef,
- pub(crate) value: PatioOperand,
-}
-
-pub(crate) struct PatioLocalStore {
- pub(crate) destination: PatioLocalRef,
- pub(crate) value: PatioOperand,
-}
-
-pub(crate) struct PatioLoop {
- pub(crate) body: Vec<PatioInstruction>,
-}
-
-pub(crate) struct PatioLoopBreak;
-
-pub(crate) struct PatioLoopContinue;
-
-pub(crate) struct PatioMemoryLoad {
- pub(crate) destination: PatioLocalRef,
- pub(crate) pointer: PatioOperand,
- pub(crate) layout: PatioDataLayout,
- pub(crate) element_offsets: Vec<u32>,
-}
-
-pub(crate) struct PatioMemoryStore {
- pub(crate) pointer: PatioOperand,
- pub(crate) layout: PatioDataLayout,
- pub(crate) element_offsets: Vec<u32>,
- pub(crate) value: PatioOperand,
-}
-
-pub(crate) struct PatioReturn {
- pub(crate) values: Vec<PatioOperand>,
-}
-
-pub(crate) struct PatioSwitch {
- pub(crate) destinations: Vec<PatioLocalRef>,
- pub(crate) value: PatioOperand,
- pub(crate) cases: Vec<PatioSwitchCase>,
- pub(crate) default_body: PatioBlock,
-}
-
-pub(crate) struct PatioSwitchCase {
- pub(crate) value: u32,
- pub(crate) body: PatioBlock,
-}
-
-pub(crate) struct PatioUnreachable;
-
-pub(crate) struct PatioVarLoad {
- pub(crate) destination: PatioLocalRef,
- pub(crate) var: PatioLocalRef,
-}
-
-pub(crate) struct PatioVarStore {
- pub(crate) var: PatioLocalRef,
- pub(crate) value: PatioOperand,
-}