Skip to main content

oxilean_codegen/opt_vectorize/
simdop_traits.rs

1//! # SIMDOp - Trait Implementations
2//!
3//! This module contains trait implementations for `SIMDOp`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::SIMDOp;
12use std::fmt;
13
14impl fmt::Display for SIMDOp {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        match self {
17            SIMDOp::Add => write!(f, "vadd"),
18            SIMDOp::Sub => write!(f, "vsub"),
19            SIMDOp::Mul => write!(f, "vmul"),
20            SIMDOp::Div => write!(f, "vdiv"),
21            SIMDOp::Sqrt => write!(f, "vsqrt"),
22            SIMDOp::Fma => write!(f, "vfma"),
23            SIMDOp::Broadcast => write!(f, "vbroadcast"),
24            SIMDOp::Load => write!(f, "vload"),
25            SIMDOp::Store => write!(f, "vstore"),
26            SIMDOp::Shuffle => write!(f, "vshuffle"),
27            SIMDOp::Blend => write!(f, "vblend"),
28            SIMDOp::Compare(cmp) => write!(f, "vcmp.{}", cmp),
29            SIMDOp::Min => write!(f, "vmin"),
30            SIMDOp::Max => write!(f, "vmax"),
31            SIMDOp::HorizontalAdd => write!(f, "vhadd"),
32        }
33    }
34}