Files
betterxen/crates/isa/src/semantics_gen.rs
T
elforeign cd59e081d9 isa, decoder: SOPC integer compares through the semantic registry (#215 stage D)
Adds a compare operation with a declared relation and the sopc_scalar
operand rule, so all twelve s_cmp_*_{i32,u32} forms are registry data.
The decoder dispatches them through the generated OP table and the
translator resolves SCC with ScalarCompareOp::test; the hand-written
s_cmp_eq_u32 path and its opcode constant are gone. A new LLVM-assembled
fixture records every compare's SCC, and the separately written oracle
from task/215-stage-d-oracle supplies the reference side.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 04:16:09 -06:00

1129 lines
36 KiB
Rust

// @generated by crates/isa/generate_semantics.py from crates/isa/semantics/rdna2.toml.
// Do not edit. Regenerate: python3 crates/isa/generate_semantics.py generate
use crate::meta::EncodingFamily;
use crate::primitive;
use crate::semantics::{
CarryIn, Document, Evidence, FormSemantics, MaskEffect, Operation, OperandRule, SccEffect,
Signedness, SpecRef, Wave,
};
use crate::CompareRelation;
/// Registry schema of the generated tables.
pub const GENERATED_SCHEMA: u32 = 1;
/// SOP2 operations declared in the semantic registry (operand rule `sop2_sgpr`).
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ScalarAluOp {
/// `s_add_u32` (SOP2 opcode 0): unsigned add, SCC = carry_out.
AddU32,
/// `s_sub_u32` (SOP2 opcode 1): unsigned sub, SCC = borrow.
SubU32,
/// `s_add_i32` (SOP2 opcode 2): signed add, SCC = signed_overflow.
AddI32,
/// `s_sub_i32` (SOP2 opcode 3): signed sub, SCC = signed_overflow.
SubI32,
/// `s_addc_u32` (SOP2 opcode 4): unsigned add plus SCC, SCC = carry_out.
AddcU32,
/// `s_subb_u32` (SOP2 opcode 5): unsigned sub plus SCC, SCC = borrow.
SubbU32,
/// `s_and_b32` (SOP2 opcode 14): bitwise and, SCC = nonzero.
AndB32,
/// `s_or_b32` (SOP2 opcode 16): bitwise or, SCC = nonzero.
OrB32,
/// `s_xor_b32` (SOP2 opcode 18): bitwise xor, SCC = nonzero.
XorB32,
/// `s_andn2_b32` (SOP2 opcode 20): bitwise andn2, SCC = nonzero.
Andn2B32,
/// `s_orn2_b32` (SOP2 opcode 22): bitwise orn2, SCC = nonzero.
Orn2B32,
/// `s_nand_b32` (SOP2 opcode 24): bitwise nand, SCC = nonzero.
NandB32,
/// `s_nor_b32` (SOP2 opcode 26): bitwise nor, SCC = nonzero.
NorB32,
/// `s_xnor_b32` (SOP2 opcode 28): bitwise xnor, SCC = nonzero.
XnorB32,
/// `s_lshl_b32` (SOP2 opcode 30): bitwise lshl, SCC = nonzero.
LshlB32,
/// `s_lshr_b32` (SOP2 opcode 32): unsigned lshr, SCC = nonzero.
LshrB32,
/// `s_ashr_i32` (SOP2 opcode 34): signed ashr, SCC = nonzero.
AshrI32,
}
/// ScalarAluOp by SOP2 OP field value; `None` for undeclared opcodes.
const SCALAR_ALU_OP_BY_OPCODE: [Option<ScalarAluOp>; 128] = [
Some(ScalarAluOp::AddU32),
Some(ScalarAluOp::SubU32),
Some(ScalarAluOp::AddI32),
Some(ScalarAluOp::SubI32),
Some(ScalarAluOp::AddcU32),
Some(ScalarAluOp::SubbU32),
None,
None,
None,
None,
None,
None,
None,
None,
Some(ScalarAluOp::AndB32),
None,
Some(ScalarAluOp::OrB32),
None,
Some(ScalarAluOp::XorB32),
None,
Some(ScalarAluOp::Andn2B32),
None,
Some(ScalarAluOp::Orn2B32),
None,
Some(ScalarAluOp::NandB32),
None,
Some(ScalarAluOp::NorB32),
None,
Some(ScalarAluOp::XnorB32),
None,
Some(ScalarAluOp::LshlB32),
None,
Some(ScalarAluOp::LshrB32),
None,
Some(ScalarAluOp::AshrI32),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
];
impl ScalarAluOp {
/// Every operation, in registry order.
pub const ALL: [Self; 17] = [
Self::AddU32,
Self::SubU32,
Self::AddI32,
Self::SubI32,
Self::AddcU32,
Self::SubbU32,
Self::AndB32,
Self::OrB32,
Self::XorB32,
Self::Andn2B32,
Self::Orn2B32,
Self::NandB32,
Self::NorB32,
Self::XnorB32,
Self::LshlB32,
Self::LshrB32,
Self::AshrI32,
];
/// Selects the operation from a first instruction word: the SOP2 encoding
/// bits (mask 0xc000_0000) and then the OP field (bits 23-29).
pub const fn from_word(word: u32) -> Option<Self> {
if word & 0xc000_0000 != 0x8000_0000 {
return None;
}
SCALAR_ALU_OP_BY_OPCODE[((word >> 23) & 0x7f) as usize]
}
/// Lower-case mnemonic.
pub const fn mnemonic(self) -> &'static str {
match self {
Self::AddU32 => "s_add_u32",
Self::SubU32 => "s_sub_u32",
Self::AddI32 => "s_add_i32",
Self::SubI32 => "s_sub_i32",
Self::AddcU32 => "s_addc_u32",
Self::SubbU32 => "s_subb_u32",
Self::AndB32 => "s_and_b32",
Self::OrB32 => "s_or_b32",
Self::XorB32 => "s_xor_b32",
Self::Andn2B32 => "s_andn2_b32",
Self::Orn2B32 => "s_orn2_b32",
Self::NandB32 => "s_nand_b32",
Self::NorB32 => "s_nor_b32",
Self::XnorB32 => "s_xnor_b32",
Self::LshlB32 => "s_lshl_b32",
Self::LshrB32 => "s_lshr_b32",
Self::AshrI32 => "s_ashr_i32",
}
}
/// The validated registry row.
pub fn semantics(self) -> &'static FormSemantics {
&FORMS[match self {
Self::AddU32 => 0,
Self::SubU32 => 1,
Self::AddI32 => 2,
Self::SubI32 => 3,
Self::AddcU32 => 4,
Self::SubbU32 => 5,
Self::AndB32 => 6,
Self::OrB32 => 7,
Self::XorB32 => 8,
Self::Andn2B32 => 9,
Self::Orn2B32 => 10,
Self::NandB32 => 11,
Self::NorB32 => 12,
Self::XnorB32 => 13,
Self::LshlB32 => 14,
Self::LshrB32 => 15,
Self::AshrI32 => 16,
}]
}
/// Whether the operation reads SCC as a carry-in or borrow-in.
pub const fn reads_scc(self) -> bool {
match self {
Self::AddU32 => false,
Self::SubU32 => false,
Self::AddI32 => false,
Self::SubI32 => false,
Self::AddcU32 => true,
Self::SubbU32 => true,
Self::AndB32 => false,
Self::OrB32 => false,
Self::XorB32 => false,
Self::Andn2B32 => false,
Self::Orn2B32 => false,
Self::NandB32 => false,
Self::NorB32 => false,
Self::XnorB32 => false,
Self::LshlB32 => false,
Self::LshrB32 => false,
Self::AshrI32 => false,
}
}
/// The result and the new SCC, with `carry_in` the SCC read by forms that
/// consume it (ignored by the others).
pub const fn evaluate(self, src0: u32, src1: u32, carry_in: bool) -> (u32, bool) {
match self {
Self::AddU32 => primitive::add_carry_u32(src0, src1, false),
Self::SubU32 => primitive::sub_borrow_u32(src0, src1, false),
Self::AddI32 => primitive::add_overflow_i32(src0, src1),
Self::SubI32 => primitive::sub_overflow_i32(src0, src1),
Self::AddcU32 => primitive::add_carry_u32(src0, src1, carry_in),
Self::SubbU32 => primitive::sub_borrow_u32(src0, src1, carry_in),
Self::AndB32 => primitive::and_nonzero_b32(src0, src1),
Self::OrB32 => primitive::or_nonzero_b32(src0, src1),
Self::XorB32 => primitive::xor_nonzero_b32(src0, src1),
Self::Andn2B32 => primitive::andn2_nonzero_b32(src0, src1),
Self::Orn2B32 => primitive::orn2_nonzero_b32(src0, src1),
Self::NandB32 => primitive::nand_nonzero_b32(src0, src1),
Self::NorB32 => primitive::nor_nonzero_b32(src0, src1),
Self::XnorB32 => primitive::xnor_nonzero_b32(src0, src1),
Self::LshlB32 => primitive::lshl_nonzero_b32(src0, src1 & 0x1f),
Self::LshrB32 => primitive::lshr_nonzero_b32(src0, src1 & 0x1f),
Self::AshrI32 => primitive::ashr_nonzero_i32(src0, src1 & 0x1f),
}
}
}
/// SOPC operations declared in the semantic registry (operand rule `sopc_scalar`).
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ScalarCompareOp {
/// `s_cmp_eq_i32` (SOPC opcode 0): signed compare eq, SCC = relation.
CmpEqI32,
/// `s_cmp_lg_i32` (SOPC opcode 1): signed compare lg, SCC = relation.
CmpLgI32,
/// `s_cmp_gt_i32` (SOPC opcode 2): signed compare gt, SCC = relation.
CmpGtI32,
/// `s_cmp_ge_i32` (SOPC opcode 3): signed compare ge, SCC = relation.
CmpGeI32,
/// `s_cmp_lt_i32` (SOPC opcode 4): signed compare lt, SCC = relation.
CmpLtI32,
/// `s_cmp_le_i32` (SOPC opcode 5): signed compare le, SCC = relation.
CmpLeI32,
/// `s_cmp_eq_u32` (SOPC opcode 6): unsigned compare eq, SCC = relation.
CmpEqU32,
/// `s_cmp_lg_u32` (SOPC opcode 7): unsigned compare lg, SCC = relation.
CmpLgU32,
/// `s_cmp_gt_u32` (SOPC opcode 8): unsigned compare gt, SCC = relation.
CmpGtU32,
/// `s_cmp_ge_u32` (SOPC opcode 9): unsigned compare ge, SCC = relation.
CmpGeU32,
/// `s_cmp_lt_u32` (SOPC opcode 10): unsigned compare lt, SCC = relation.
CmpLtU32,
/// `s_cmp_le_u32` (SOPC opcode 11): unsigned compare le, SCC = relation.
CmpLeU32,
}
/// ScalarCompareOp by SOPC OP field value; `None` for undeclared opcodes.
const SCALAR_COMPARE_OP_BY_OPCODE: [Option<ScalarCompareOp>; 128] = [
Some(ScalarCompareOp::CmpEqI32),
Some(ScalarCompareOp::CmpLgI32),
Some(ScalarCompareOp::CmpGtI32),
Some(ScalarCompareOp::CmpGeI32),
Some(ScalarCompareOp::CmpLtI32),
Some(ScalarCompareOp::CmpLeI32),
Some(ScalarCompareOp::CmpEqU32),
Some(ScalarCompareOp::CmpLgU32),
Some(ScalarCompareOp::CmpGtU32),
Some(ScalarCompareOp::CmpGeU32),
Some(ScalarCompareOp::CmpLtU32),
Some(ScalarCompareOp::CmpLeU32),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
];
impl ScalarCompareOp {
/// Every operation, in registry order.
pub const ALL: [Self; 12] = [
Self::CmpEqI32,
Self::CmpLgI32,
Self::CmpGtI32,
Self::CmpGeI32,
Self::CmpLtI32,
Self::CmpLeI32,
Self::CmpEqU32,
Self::CmpLgU32,
Self::CmpGtU32,
Self::CmpGeU32,
Self::CmpLtU32,
Self::CmpLeU32,
];
/// Selects the operation from a first instruction word: the SOPC encoding
/// bits (mask 0xff80_0000) and then the OP field (bits 16-22).
pub const fn from_word(word: u32) -> Option<Self> {
if word & 0xff80_0000 != 0xbf00_0000 {
return None;
}
SCALAR_COMPARE_OP_BY_OPCODE[((word >> 16) & 0x7f) as usize]
}
/// Lower-case mnemonic.
pub const fn mnemonic(self) -> &'static str {
match self {
Self::CmpEqI32 => "s_cmp_eq_i32",
Self::CmpLgI32 => "s_cmp_lg_i32",
Self::CmpGtI32 => "s_cmp_gt_i32",
Self::CmpGeI32 => "s_cmp_ge_i32",
Self::CmpLtI32 => "s_cmp_lt_i32",
Self::CmpLeI32 => "s_cmp_le_i32",
Self::CmpEqU32 => "s_cmp_eq_u32",
Self::CmpLgU32 => "s_cmp_lg_u32",
Self::CmpGtU32 => "s_cmp_gt_u32",
Self::CmpGeU32 => "s_cmp_ge_u32",
Self::CmpLtU32 => "s_cmp_lt_u32",
Self::CmpLeU32 => "s_cmp_le_u32",
}
}
/// The validated registry row.
pub fn semantics(self) -> &'static FormSemantics {
&FORMS[match self {
Self::CmpEqI32 => 17,
Self::CmpLgI32 => 18,
Self::CmpGtI32 => 19,
Self::CmpGeI32 => 20,
Self::CmpLtI32 => 21,
Self::CmpLeI32 => 22,
Self::CmpEqU32 => 23,
Self::CmpLgU32 => 24,
Self::CmpGtU32 => 25,
Self::CmpGeU32 => 26,
Self::CmpLtU32 => 27,
Self::CmpLeU32 => 28,
}]
}
/// The relation tested, with S0 on the left.
pub const fn relation(self) -> CompareRelation {
match self {
Self::CmpEqI32 => CompareRelation::Equal,
Self::CmpLgI32 => CompareRelation::NotEqual,
Self::CmpGtI32 => CompareRelation::Greater,
Self::CmpGeI32 => CompareRelation::GreaterOrEqual,
Self::CmpLtI32 => CompareRelation::Less,
Self::CmpLeI32 => CompareRelation::LessOrEqual,
Self::CmpEqU32 => CompareRelation::Equal,
Self::CmpLgU32 => CompareRelation::NotEqual,
Self::CmpGtU32 => CompareRelation::Greater,
Self::CmpGeU32 => CompareRelation::GreaterOrEqual,
Self::CmpLtU32 => CompareRelation::Less,
Self::CmpLeU32 => CompareRelation::LessOrEqual,
}
}
/// The new SCC: whether the relation holds for S0 and S1.
pub const fn test(self, src0: u32, src1: u32) -> bool {
match self {
Self::CmpEqI32 => primitive::eq_b32(src0, src1),
Self::CmpLgI32 => primitive::ne_b32(src0, src1),
Self::CmpGtI32 => primitive::gt_i32(src0, src1),
Self::CmpGeI32 => primitive::ge_i32(src0, src1),
Self::CmpLtI32 => primitive::lt_i32(src0, src1),
Self::CmpLeI32 => primitive::le_i32(src0, src1),
Self::CmpEqU32 => primitive::eq_b32(src0, src1),
Self::CmpLgU32 => primitive::ne_b32(src0, src1),
Self::CmpGtU32 => primitive::gt_u32(src0, src1),
Self::CmpGeU32 => primitive::ge_u32(src0, src1),
Self::CmpLtU32 => primitive::lt_u32(src0, src1),
Self::CmpLeU32 => primitive::le_u32(src0, src1),
}
}
}
/// Identity of every registry form, in registry order.
pub const FORM_IDS: [(&str, EncodingFamily); 29] = [
("S_ADD_U32", EncodingFamily::Sop2),
("S_SUB_U32", EncodingFamily::Sop2),
("S_ADD_I32", EncodingFamily::Sop2),
("S_SUB_I32", EncodingFamily::Sop2),
("S_ADDC_U32", EncodingFamily::Sop2),
("S_SUBB_U32", EncodingFamily::Sop2),
("S_AND_B32", EncodingFamily::Sop2),
("S_OR_B32", EncodingFamily::Sop2),
("S_XOR_B32", EncodingFamily::Sop2),
("S_ANDN2_B32", EncodingFamily::Sop2),
("S_ORN2_B32", EncodingFamily::Sop2),
("S_NAND_B32", EncodingFamily::Sop2),
("S_NOR_B32", EncodingFamily::Sop2),
("S_XNOR_B32", EncodingFamily::Sop2),
("S_LSHL_B32", EncodingFamily::Sop2),
("S_LSHR_B32", EncodingFamily::Sop2),
("S_ASHR_I32", EncodingFamily::Sop2),
("S_CMP_EQ_I32", EncodingFamily::Sopc),
("S_CMP_LG_I32", EncodingFamily::Sopc),
("S_CMP_GT_I32", EncodingFamily::Sopc),
("S_CMP_GE_I32", EncodingFamily::Sopc),
("S_CMP_LT_I32", EncodingFamily::Sopc),
("S_CMP_LE_I32", EncodingFamily::Sopc),
("S_CMP_EQ_U32", EncodingFamily::Sopc),
("S_CMP_LG_U32", EncodingFamily::Sopc),
("S_CMP_GT_U32", EncodingFamily::Sopc),
("S_CMP_GE_U32", EncodingFamily::Sopc),
("S_CMP_LT_U32", EncodingFamily::Sopc),
("S_CMP_LE_U32", EncodingFamily::Sopc),
];
/// One validated row per registry form, in registry order.
pub static FORMS: [FormSemantics; 29] = [
FormSemantics {
name: "S_ADD_U32",
family: EncodingFamily::Sop2,
opcode: 0,
operation: Operation::Add,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::CarryOut,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 101 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_SUB_U32",
family: EncodingFamily::Sop2,
opcode: 1,
operation: Operation::Sub,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Borrow,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 101 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_ADD_I32",
family: EncodingFamily::Sop2,
opcode: 2,
operation: Operation::Add,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::SignedOverflow,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 101 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_SUB_I32",
family: EncodingFamily::Sop2,
opcode: 3,
operation: Operation::Sub,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::SignedOverflow,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 101 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_ADDC_U32",
family: EncodingFamily::Sop2,
opcode: 4,
operation: Operation::Add,
signedness: Signedness::Unsigned,
carry_in: CarryIn::Scc,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::CarryOut,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 102 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_SUBB_U32",
family: EncodingFamily::Sop2,
opcode: 5,
operation: Operation::Sub,
signedness: Signedness::Unsigned,
carry_in: CarryIn::Scc,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Borrow,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 102 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_AND_B32",
family: EncodingFamily::Sop2,
opcode: 14,
operation: Operation::And,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 102 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_OR_B32",
family: EncodingFamily::Sop2,
opcode: 16,
operation: Operation::Or,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 102 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_XOR_B32",
family: EncodingFamily::Sop2,
opcode: 18,
operation: Operation::Xor,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 102 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_ANDN2_B32",
family: EncodingFamily::Sop2,
opcode: 20,
operation: Operation::AndNot,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 103 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_ORN2_B32",
family: EncodingFamily::Sop2,
opcode: 22,
operation: Operation::OrNot,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 103 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_NAND_B32",
family: EncodingFamily::Sop2,
opcode: 24,
operation: Operation::Nand,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 104 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_NOR_B32",
family: EncodingFamily::Sop2,
opcode: 26,
operation: Operation::Nor,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 104 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_XNOR_B32",
family: EncodingFamily::Sop2,
opcode: 28,
operation: Operation::Xnor,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 104 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_LSHL_B32",
family: EncodingFamily::Sop2,
opcode: 30,
operation: Operation::ShiftLeft,
signedness: Signedness::Bitwise,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 5,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 104 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_LSHR_B32",
family: EncodingFamily::Sop2,
opcode: 32,
operation: Operation::LogicalShiftRight,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 5,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 104 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_ASHR_I32",
family: EncodingFamily::Sop2,
opcode: 34,
operation: Operation::ArithmeticShiftRight,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 5,
relation: None,
scc: SccEffect::Nonzero,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::Sop2Sgpr,
spec: &[SpecRef { document: Document::Guide, section: "12.1", page: 104 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_EQ_I32",
family: EncodingFamily::Sopc,
opcode: 0,
operation: Operation::Compare,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::Equal),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_LG_I32",
family: EncodingFamily::Sopc,
opcode: 1,
operation: Operation::Compare,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::NotEqual),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_GT_I32",
family: EncodingFamily::Sopc,
opcode: 2,
operation: Operation::Compare,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::Greater),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_GE_I32",
family: EncodingFamily::Sopc,
opcode: 3,
operation: Operation::Compare,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::GreaterOrEqual),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_LT_I32",
family: EncodingFamily::Sopc,
opcode: 4,
operation: Operation::Compare,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::Less),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_LE_I32",
family: EncodingFamily::Sopc,
opcode: 5,
operation: Operation::Compare,
signedness: Signedness::Signed,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::LessOrEqual),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_EQ_U32",
family: EncodingFamily::Sopc,
opcode: 6,
operation: Operation::Compare,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::Equal),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_LG_U32",
family: EncodingFamily::Sopc,
opcode: 7,
operation: Operation::Compare,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::NotEqual),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_GT_U32",
family: EncodingFamily::Sopc,
opcode: 8,
operation: Operation::Compare,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::Greater),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_GE_U32",
family: EncodingFamily::Sopc,
opcode: 9,
operation: Operation::Compare,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::GreaterOrEqual),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_LT_U32",
family: EncodingFamily::Sopc,
opcode: 10,
operation: Operation::Compare,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::Less),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
FormSemantics {
name: "S_CMP_LE_U32",
family: EncodingFamily::Sopc,
opcode: 11,
operation: Operation::Compare,
signedness: Signedness::Unsigned,
carry_in: CarryIn::None,
width: 32,
shift_count_bits: 0,
relation: Some(CompareRelation::LessOrEqual),
scc: SccEffect::Relation,
vcc: MaskEffect::Unchanged,
exec: MaskEffect::Unchanged,
wave: Wave::Any,
operands: OperandRule::SopcScalar,
spec: &[SpecRef { document: Document::Guide, section: "12.4", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }],
verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding],
},
];