[llvm] [RISCV] AI Foundry ET extensions for RISC-V (PR #174571)

Abel Bernabeu via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 9 01:26:57 PST 2026


================
@@ -0,0 +1,535 @@
+# XAIFET - AI Foundry ET SIMD instructions
+
+# RUN: llvm-mc --arch=riscv64 -mattr=+xaifet --show-encoding %s | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
+
+# CHECK-INST: aif.bitmixb	s7, gp, gp
+# CHECK-ENC: encoding: [0xbb,0xfb,0x31,0x80]
+aif.bitmixb	s7, gp, gp
+
+# CHECK-INST: aif.cubefaceidx.ps	fa0, fs9, ft9
+# CHECK-ENC: encoding: [0x7b,0x95,0xdc,0x89]
+aif.cubefaceidx.ps	fa0, fs9, ft9
+
+# CHECK-INST: aif.cubeface.ps	ft9, fa3, ft10
+# CHECK-ENC: encoding: [0xfb,0x8e,0xe6,0x89]
+aif.cubeface.ps	ft9, fa3, ft10
+
+# CHECK-INST: aif.cubesgnsc.ps	ft9, ft8, fs9
+# CHECK-ENC: encoding: [0xfb,0x2e,0x9e,0x89]
+aif.cubesgnsc.ps	ft9, ft8, fs9
+
+# CHECK-INST: aif.cubesgntc.ps	fs2, ft6, fa6
+# CHECK-ENC: encoding: [0x7b,0x39,0x03,0x89]
+aif.cubesgntc.ps	fs2, ft6, fa6
+
+#====----------------------------------------------------------------------===//
+# SIMD FP|INT instructions
+#====----------------------------------------------------------------------===//
+
+# CHECK-INST: aif.faddi.pi	fa4, ft1, -96
+# CHECK-ENC: encoding: [0x3f,0x87,0x00,0xec]
+aif.faddi.pi	fa4, ft1, -96
+
+# CHECK-INST: aif.fadd.pi	fs10, fa5, fs8
+# CHECK-ENC: encoding: [0x7b,0x8d,0x87,0x07]
+aif.fadd.pi	fs10, fa5, fs8
+
+# CHECK-INST: aif.fadd.ps	fs0, ft0, fs4, rtz
+# CHECK-ENC: encoding: [0x7b,0x14,0x40,0x01]
+aif.fadd.ps	fs0, ft0, fs4, rtz
+
+# CHECK-INST: aif.fandi.pi	fa7, fs1, 16
+# CHECK-ENC: encoding: [0xbf,0x98,0x04,0x05]
+aif.fandi.pi	fa7, fs1, 16
+
+# CHECK-INST: aif.fand.pi	ft2, fs8, fa1
+# CHECK-ENC: encoding: [0x7b,0x71,0xbc,0x06]
+aif.fand.pi	ft2, fs8, fa1
+
+# CHECK-INST: aif.fbci.pi	fs9, 1015523
+# CHECK-ENC: encoding: [0xdf,0x3c,0xee,0xf7]
+aif.fbci.pi	fs9, 1015523
+
+# CHECK-INST: aif.fbci.ps	fs9, 946477
+# CHECK-ENC: encoding: [0x9f,0xdc,0x12,0xe7]
----------------
abel-bernabeu wrote:

Thanks.

I like your solution better than mine because it does not put burden on vendors who respect the rules. With my solution every extension needed to declare wrong-doing, so to speak.

Closing this thread with a commitement to wait for that MR to close before we merge this patch.

https://github.com/llvm/llvm-project/pull/174571


More information about the llvm-commits mailing list