From 8249d6d1cd767949ac908d593c34901eab2b4116 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Thu, 2 May 2024 15:58:47 -0700 Subject: [PATCH] arch-vega: Remove FP asserts in VOP3 lane manip insts The VOP3 instruction encoding generally states that ABS/NEG modifiers in the instruction encoding are only valid on floating point data types. This is currently coded in gem5 to mean floating point *instructions*. For untyped instructions like V_CNDMASK_B32, we don't actually know what the data type is. We must trust that the compiler did not attempt to apply these bits to non-FP data types. This commit simply removes the asserts. The ABS/NEG modifiers are therefore ignored which is consistent with the ISA documentation. This is done on the lane manipulation instructions V_CNDMASK_B32, V_READLINE_B32, and V_WRITELANE_B32 which are typically used to mask off or move data between registers. Other bitwise instructions (e.g., V_OR_B32) keep the asserts as bitwise operations on FP types are genernally illegal in languages like C++. Change-Id: I478c5272ba96383a063b2828de21d60948b25c8f --- src/arch/amdgpu/vega/insts/vop3.cc | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/arch/amdgpu/vega/insts/vop3.cc b/src/arch/amdgpu/vega/insts/vop3.cc index 59d72ac9ed..18446d2e2b 100644 --- a/src/arch/amdgpu/vega/insts/vop3.cc +++ b/src/arch/amdgpu/vega/insts/vop3.cc @@ -66,16 +66,6 @@ namespace VegaISA src1.readSrc(); vcc.read(); - /** - * input modifiers are supported by FP operations only - */ - assert(!(instData.ABS & 0x1)); - assert(!(instData.ABS & 0x2)); - assert(!(instData.ABS & 0x4)); - assert(!(extData.NEG & 0x1)); - assert(!(extData.NEG & 0x2)); - assert(!(extData.NEG & 0x4)); - for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) { if (wf->execMask(lane)) { vdst[lane] = bits(vcc.rawData(), lane) @@ -8440,16 +8430,6 @@ namespace VegaISA src0.readSrc(); src1.read(); - /** - * input modifiers are supported by FP operations only - */ - assert(!(instData.ABS & 0x1)); - assert(!(instData.ABS & 0x2)); - assert(!(instData.ABS & 0x4)); - assert(!(extData.NEG & 0x1)); - assert(!(extData.NEG & 0x2)); - assert(!(extData.NEG & 0x4)); - sdst = src0[src1.rawData() & 0x3f]; sdst.write(); @@ -8484,16 +8464,6 @@ namespace VegaISA src1.read(); vdst.read(); - /** - * input modifiers are supported by FP operations only - */ - assert(!(instData.ABS & 0x1)); - assert(!(instData.ABS & 0x2)); - assert(!(instData.ABS & 0x4)); - assert(!(extData.NEG & 0x1)); - assert(!(extData.NEG & 0x2)); - assert(!(extData.NEG & 0x4)); - vdst[src1.rawData() & 0x3f] = src0.rawData(); vdst.write();