IntoTernaryOperands

Trait IntoTernaryOperands 

Source
pub trait IntoTernaryOperands<TargetMapping: M> {
    // Required method
    fn into_ternary_operands(
        self,
    ) -> ArrayVec<TernaryOperand<TargetMapping>, MAX_BRANCHES>;
}
Expand description

Trait for converting various operand types into an ArrayVec of TernaryOperand.

§Supported operand types

  • (f32, f32) - two constant values (operand0, operand1)
  • (VeRhs<f32, Mapping>, f32) - VeRhs and constant
  • TernaryOperand<Mapping> - single ternary operand
  • [TernaryOperand<Mapping>; N] - array of ternary operands for multi-branch operations

§Example

// Simple usage with tuple (operand0, operand1)
tensor.vector_fp_ternary(FpTernaryOp::FmaF, (2.0f32, 3.0f32))

// With VRF as operand0
tensor.vector_fp_ternary(FpTernaryOp::FmaF, (&vrf, 3.0f32))

// With stash as operand0
tensor.vector_fp_ternary(FpTernaryOp::FmaF, (Stash, 3.0f32))

// Explicit TernaryOperand for branch control
tensor.vector_fp_ternary(
    FpTernaryOp::FmaF,
    TernaryOperand::always(VeRhs::constant(2.0f32), 3.0f32)
)

Required Methods§

Source

fn into_ternary_operands( self, ) -> ArrayVec<TernaryOperand<TargetMapping>, MAX_BRANCHES>

Converts into an ArrayVec of TernaryOperand.

Implementations on Foreign Types§

Source§

impl<TargetMapping: M, const N: usize> IntoTernaryOperands<TargetMapping> for [TernaryOperand<TargetMapping>; N]

Array of TernaryOperand for multi-branch operations.

Source§

fn into_ternary_operands( self, ) -> ArrayVec<TernaryOperand<TargetMapping>, MAX_BRANCHES>

Implementors§

Source§

impl<T, TargetMapping: M> IntoTernaryOperands<TargetMapping> for T
where T: Into<TernaryOperand<TargetMapping>>,

Source§

impl<TargetMapping: M> IntoTernaryOperands<TargetMapping> for ArrayVec<TernaryOperand<TargetMapping>, MAX_BRANCHES>

ArrayVec<TernaryOperand, MAX_BRANCHES> passes through.