From aad4410b5125f7c5fd5b510d93fe437e599fa99b Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sat, 24 May 2025 12:03:09 -0400 Subject: [PATCH] nak/sm20: Don't allow 64-bit atomics The encoding exists and the disassembler will disassemble it but the hardware throws an ILLEGAL_INSTRUCTION_ENCODING if we ever try to execute one. The proprietary driver doesn't expose any 64-bit atomics features on Kepler A so we assume the hardware just doesn't do them. Part-of: --- src/nouveau/compiler/nak/sm20.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/nouveau/compiler/nak/sm20.rs b/src/nouveau/compiler/nak/sm20.rs index f34ac0fab01..0b6ad3bcd86 100644 --- a/src/nouveau/compiler/nak/sm20.rs +++ b/src/nouveau/compiler/nak/sm20.rs @@ -2164,14 +2164,24 @@ impl SM20Op for OpAtom { // AtomType::U16 => 0x2_u8, // AtomType::I16 => 0x3_u8, AtomType::U32 => 0x4_u8, - AtomType::U64 => 0x5_u8, //AtomType::U128 => 0x6_u8, AtomType::I32 => 0x7_u8, - AtomType::I64 => 0x8_u8, //AtomType::I128 => 0x9_u8, //AtomType::F16 => 0xa_u8, - AtomType::F64 => 0xc_u8, AtomType::F32 => 0xd_u8, + + AtomType::U64 | AtomType::I64 | AtomType::F64 => { + // They encode fine: + // + // AtomType::U64 => 0x5_u8, + // AtomType::I64 => 0x8_u8, + // AtomType::F64 => 0xc_u8, + // + // but the hardware throws an ILLEGAL_INSTRUCTION_ENCODING error + // if we ever actually execute one. Also, the proprietary + // driver doesn't expose any 64-bit atomic features on Kepler A. + panic!("64-bit atomics are not supported"); + } }; e.set_field(9..10, typ & 0x1); e.set_field(59..62, typ >> 1);