Skip to main content

oxilean_codegen/cranelift_backend/
intcc_traits.rs

1//! # IntCC - Trait Implementations
2//!
3//! This module contains trait implementations for `IntCC`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::IntCC;
12use std::fmt;
13
14impl fmt::Display for IntCC {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        match self {
17            IntCC::Equal => write!(f, "eq"),
18            IntCC::NotEqual => write!(f, "ne"),
19            IntCC::SignedLessThan => write!(f, "slt"),
20            IntCC::SignedLessThanOrEqual => write!(f, "sle"),
21            IntCC::SignedGreaterThan => write!(f, "sgt"),
22            IntCC::SignedGreaterThanOrEqual => write!(f, "sge"),
23            IntCC::UnsignedLessThan => write!(f, "ult"),
24            IntCC::UnsignedLessThanOrEqual => write!(f, "ule"),
25            IntCC::UnsignedGreaterThan => write!(f, "ugt"),
26            IntCC::UnsignedGreaterThanOrEqual => write!(f, "uge"),
27            IntCC::Overflow => write!(f, "of"),
28            IntCC::NotOverflow => write!(f, "nof"),
29        }
30    }
31}