pulsar-ir 0.0.1

A high-level programming language for building hardware accelerators
Documentation
// Copyright (C) 2024 Ethan Uppal. All rights reserved.
use super::operand::Operand;
use std::fmt::Display;

#[derive(PartialEq, Eq, Hash, Clone, Copy)]
pub enum BranchCondition {
    Always,
    Never,
    Conditional(Operand)
}

impl Display for BranchCondition {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &self {
            Self::Always => write!(f, "always"),
            Self::Never => write!(f, "never"),
            Self::Conditional(condition) => write!(f, "if {} != 0", condition)
        }
    }
}