mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-07-25 13:16:23 +03:00
84 lines
1.5 KiB
Rust
84 lines
1.5 KiB
Rust
use super::MemScope;
|
|
|
|
#[derive(Clone)]
|
|
pub enum ParsedOperand<Ident> {
|
|
Reg(Ident),
|
|
RegOffset(Ident, i32),
|
|
Imm(ImmediateValue),
|
|
VecMember(Ident, u8),
|
|
VecPack(Vec<Ident>),
|
|
}
|
|
|
|
#[derive(Copy, Clone)]
|
|
pub enum ImmediateValue {
|
|
U64(u64),
|
|
S64(i64),
|
|
F32(f32),
|
|
F64(f64),
|
|
}
|
|
|
|
#[derive(Copy, Clone, PartialEq, Eq)]
|
|
pub enum StCacheOperator {
|
|
Writeback,
|
|
L2Only,
|
|
Streaming,
|
|
Writethrough,
|
|
}
|
|
|
|
#[derive(Copy, Clone, PartialEq, Eq)]
|
|
pub enum LdCacheOperator {
|
|
Cached,
|
|
L2Only,
|
|
Streaming,
|
|
LastUse,
|
|
Uncached,
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
pub enum ArithDetails {
|
|
Integer(ArithInteger),
|
|
Float(ArithFloat),
|
|
}
|
|
|
|
impl ArithDetails {
|
|
pub fn type_(&self) -> super::ScalarType {
|
|
match self {
|
|
ArithDetails::Integer(t) => t.type_,
|
|
ArithDetails::Float(arith) => arith.type_,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Copy, Clone)]
|
|
pub struct ArithInteger {
|
|
pub type_: super::ScalarType,
|
|
pub saturate: bool,
|
|
}
|
|
|
|
#[derive(Copy, Clone)]
|
|
pub struct ArithFloat {
|
|
pub type_: super::ScalarType,
|
|
pub rounding: Option<RoundingMode>,
|
|
pub flush_to_zero: Option<bool>,
|
|
pub saturate: bool,
|
|
}
|
|
|
|
#[derive(Copy, Clone, PartialEq, Eq)]
|
|
pub enum LdStQualifier {
|
|
Weak,
|
|
Volatile,
|
|
Relaxed(MemScope),
|
|
Acquire(MemScope),
|
|
Release(MemScope),
|
|
}
|
|
|
|
#[derive(PartialEq, Eq, Copy, Clone)]
|
|
pub enum RoundingMode {
|
|
NearestEven,
|
|
Zero,
|
|
NegativeInf,
|
|
PositiveInf,
|
|
}
|