From 3231c0cd3db885df644954373214d91dbbd5f60d Mon Sep 17 00:00:00 2001 From: lulu Date: Thu, 17 Sep 2026 17:38:24 +0800 Subject: [PATCH] [clang] Declare __fp8_rcpe6m2 scalar type (pto-spec#322) RCPE6M2 (PTO-ISA type code 21) is a source-only derived reciprocal type that reuses the E6M2 code space. Declare the __fp8_rcpe6m2 element type alongside __fp8_e6m2 so the TileOP header surface can name it. Scalar casts are intentionally left disabled (commented out), mirroring __fp8_e6m2: RCPE6M2 has no destination encoding and no scalar FCVT form, and is consumed only via the TileOP tile-level conversion (RCPE6M2 -> FP16/BF16). No v.cvt/scalar codegen is enabled. Co-Authored-By: Claude Opus 4.8 --- clang/lib/Headers/linx_blkc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/clang/lib/Headers/linx_blkc.h b/clang/lib/Headers/linx_blkc.h index 1bbf976d532c5..d1bb0d096016c 100644 --- a/clang/lib/Headers/linx_blkc.h +++ b/clang/lib/Headers/linx_blkc.h @@ -323,6 +323,22 @@ struct __fp8_e6m2 : public __fp8_base { // DEFINE_SPECIAL_CAST(__fp8_e6m2, __fp8_e5m2) // no scalar encoding; use tile-level conversion }; +struct __fp8_rcpe6m2 : public __fp8_base { +public: + __fp8_rcpe6m2() = default; + +#define __fp8_rcpe6m2_TYPE "rcpe6m2" +#define __fp8_rcpe6m2_MAJOR_TYPE "fb" +#define __fp8_rcpe6m2_WIDTH "b" +#define __fp8_rcpe6m2_STORAGE(d) ((d).data) + + // RCPE6M2 (PTO-ISA type code 21) is a source-only derived type that reuses + // the E6M2 code space: a tile-level convert reading it yields the reciprocal + // of the E6M2-encoded value. It has no destination encoding and no scalar + // FCVT form. Use the TileOP tile-level conversion (RCPE6M2 -> FP16/BF16). + // DEFINE_SIMPLE_CASTS(__fp8_rcpe6m2) +}; + struct __fp4_e2m1x2 : public __fp8_base { public: __fp4_e2m1x2() = default;