Skip to content

Commit

Permalink
Removed gatekeeping for vectorized instructions
Browse files Browse the repository at this point in the history
In the enum it doesn't make sense and would likely cause more issues.
It's easier to simply gatekeep the code generation functions instead.
  • Loading branch information
StandingPadAnimations committed Mar 30, 2023
1 parent 5e934df commit 8e6d17f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/objects/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::register::{Register, RegisterReference, RegisterLocation};

/// `Instruction`: Represents instructions the built in Resurgence VM can use (this can be reused for any VM)
#[derive(Clone, Debug)]
#[non_exhaustive]
pub enum Instruction {
/// Creates a `StackFrame` object and allocates n amount of registers
///
Expand Down Expand Up @@ -190,27 +189,31 @@ pub enum Instruction {
* These are the beginnings of vectorized instructions, instructions that can operatate on
* multiple registers at once.
*
* Right now they're not usable in their current state, and will be behind a flag since not
* everyone wants or needs them, but hopefully when ready they'll give massive gains.
* Right now they're not usable in their current state
*/

#[cfg(feature = "vectorized-instructions")]
/// Add across multiple registers
///
/// Should not be used if `vectorized-instructions` is not enabled
VectorizedAdd(Register, Register, Register),

#[cfg(feature = "vectorized-instructions")]
/// Subtract across multiple registers
///
/// Should not be used if `vectorized-instructions` is not enabled
VectorizedSub(Register, Register, Register),

#[cfg(feature = "vectorized-instructions")]
/// Multiple across multiple registers
///
/// Should not be used if `vectorized-instructions` is not enabled
VectorizedMul(Register, Register, Register),

#[cfg(feature = "vectorized-instructions")]
/// Divide across multiple registers
///
/// Should not be used if `vectorized-instructions` is not enabled
VectorizedDiv(Register, Register, Register),

#[cfg(feature = "vectorized-instructions")]
/// Perform modolus across multiple registers
///
/// Should not be used if `vectorized-instructions` is not enabled
VectorizedMod(Register, Register, Register),
}

0 comments on commit 8e6d17f

Please sign in to comment.