Skip to content

[AMDGPU][True16][MC] Generate op_sel operands for VOPC instructions #125561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

broxigarchen
Copy link
Contributor

@broxigarchen broxigarchen commented Feb 3, 2025

Generate op_sel operands for VOPC instructions

@broxigarchen broxigarchen changed the title [AMDGPU][True16][MC] vopc update asm converter [AMDGPU][True16][MC] update vopc profile with AsmMatchConverter Feb 3, 2025
@broxigarchen broxigarchen marked this pull request as ready for review February 3, 2025 19:33
@llvmbot llvmbot added backend:AMDGPU mc Machine (object) code labels Feb 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 3, 2025

@llvm/pr-subscribers-backend-amdgpu

@llvm/pr-subscribers-mc

Author: Brox Chen (broxigarchen)

Changes

update vopc profile with AsmMatchConverter


Patch is 137.68 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/125561.diff

9 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/VOPCInstructions.td (+14)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc.s (+4-4)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopcx.s (+59-59)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopc_t16_promote.s (+9-9)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopcx_t16_promote.s (+60-60)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vop3c.s (+4-4)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vop3cx.s (+55-55)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopc_t16_promote.s (+9-9)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopcx_t16_promote.s (+54-54)
diff --git a/llvm/lib/Target/AMDGPU/VOPCInstructions.td b/llvm/lib/Target/AMDGPU/VOPCInstructions.td
index 00a3381b3fd49e..268776f7d0096b 100644
--- a/llvm/lib/Target/AMDGPU/VOPCInstructions.td
+++ b/llvm/lib/Target/AMDGPU/VOPCInstructions.td
@@ -454,6 +454,11 @@ multiclass VOPCX_Pseudos <string opName,
     let isCommutable = 1;
     let SubtargetPredicate = HasNoSdstCMPX;
     let IsVCMPX = 1;
+    let AsmMatchConverter =
+        !if (P_NoSDst.HasOpSel, "cvtVOP3OpSel",
+            !if (!or(P_NoSDst.HasModifiers, P_NoSDst.HasOMod,
+                     P_NoSDst.HasIntClamp),
+                 "cvtVOP3", ""));
   }
 
   if P_NoSDst.HasExtSDWA then
@@ -1079,6 +1084,10 @@ multiclass VOPC_Class_Pseudos <string opName, VOPC_Profile p, bit DefExec,
              VCMPXNoSDstTable<1, opName#"_e64"> {
     let Defs = !if(DefExec, [EXEC], []);
     let SchedRW = p.Schedule;
+    let AsmMatchConverter =
+        !if (p.HasOpSel, "cvtVOP3OpSel",
+             !if (!or(p.HasModifiers, p.HasOMod, p.HasIntClamp), "cvtVOP3",
+                  ""));
   }
 
   if p.HasExtSDWA then
@@ -1127,6 +1136,11 @@ multiclass VOPCX_Class_Pseudos <string opName,
     let Defs = [EXEC];
     let SchedRW = P_NoSDst.Schedule;
     let SubtargetPredicate = HasNoSdstCMPX;
+    let AsmMatchConverter =
+       !if (P_NoSDst.HasOpSel, "cvtVOP3OpSel",
+            !if (!or(P_NoSDst.HasModifiers, P_NoSDst.HasOMod,
+                     P_NoSDst.HasIntClamp),
+                 "cvtVOP3", ""));
   }
 
   if P_NoSDst.HasExtSDWA then
diff --git a/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc.s b/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc.s
index d1e55d105c0b53..8ab6c93adf8744 100644
--- a/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc.s
+++ b/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc.s
@@ -128,19 +128,19 @@ v_cmp_class_f16_e64 vcc_lo, 0.5, m0
 // W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
 
 v_cmp_class_f16_e64 s5, v255.h, v2.l
-// W32: v_cmp_class_f16_e64 s5, v255.h, v2.l    ; encoding: [0x05,0x08,0x7d,0xd4,0xff,0x05,0x02,0x00]
+// W32: v_cmp_class_f16_e64 s5, v255.h, v2.l op_sel:[1,0,0] ; encoding: [0x05,0x08,0x7d,0xd4,0xff,0x05,0x02,0x00]
 // W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
 
 v_cmp_class_f16_e64 s5, s105, v255.h
-// W32: v_cmp_class_f16_e64 s5, s105, v255.h    ; encoding: [0x05,0x10,0x7d,0xd4,0x69,0xfe,0x03,0x00]
+// W32: v_cmp_class_f16_e64 s5, s105, v255.h op_sel:[0,1,0] ; encoding: [0x05,0x10,0x7d,0xd4,0x69,0xfe,0x03,0x00]
 // W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
 
 v_cmp_class_f16_e64 s[10:11], v255.h, v2.l
-// W64: v_cmp_class_f16_e64 s[10:11], v255.h, v2.l ; encoding: [0x0a,0x08,0x7d,0xd4,0xff,0x05,0x02,0x00]
+// W64: v_cmp_class_f16_e64 s[10:11], v255.h, v2.l op_sel:[1,0,0] ; encoding: [0x0a,0x08,0x7d,0xd4,0xff,0x05,0x02,0x00]
 // W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
 
 v_cmp_class_f16_e64 s[10:11], s105, v255.h
-// W64: v_cmp_class_f16_e64 s[10:11], s105, v255.h ; encoding: [0x0a,0x10,0x7d,0xd4,0x69,0xfe,0x03,0x00]
+// W64: v_cmp_class_f16_e64 s[10:11], s105, v255.h op_sel:[0,1,0] ; encoding: [0x0a,0x10,0x7d,0xd4,0x69,0xfe,0x03,0x00]
 // W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
 
 v_cmp_class_f32_e64 s5, v1, v2
diff --git a/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopcx.s b/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopcx.s
index a4340919ca6d24..ed397bd1c21885 100644
--- a/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopcx.s
+++ b/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopcx.s
@@ -51,13 +51,13 @@ v_cmpx_class_f16_e64 v1.l, 0.5
 // GFX11: v_cmpx_class_f16_e64 v1.l, 0.5          ; encoding: [0x7e,0x00,0xfd,0xd4,0x01,0xe1,0x01,0x00]
 
 v_cmpx_class_f16_e64 v1.h, v2.h
-// GFX11: v_cmpx_class_f16_e64 v1.h, v2.h         ; encoding: [0x7e,0x18,0xfd,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_class_f16_e64 v1.h, v2.h op_sel:[1,1,0] ; encoding: [0x7e,0x18,0xfd,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_class_f16_e64 v255.h, v2.l
-// GFX11: v_cmpx_class_f16_e64 v255.h, v2.l       ; encoding: [0x7e,0x08,0xfd,0xd4,0xff,0x05,0x02,0x00]
+// GFX11: v_cmpx_class_f16_e64 v255.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xfd,0xd4,0xff,0x05,0x02,0x00]
 
 v_cmpx_class_f16_e64 s105, v255.h
-// GFX11: v_cmpx_class_f16_e64 s105, v255.h       ; encoding: [0x7e,0x10,0xfd,0xd4,0x69,0xfe,0x03,0x00]
+// GFX11: v_cmpx_class_f16_e64 s105, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xfd,0xd4,0x69,0xfe,0x03,0x00]
 
 v_cmpx_class_f32_e64 v1, v2
 // GFX11: v_cmpx_class_f32_e64 v1, v2             ; encoding: [0x7e,0x00,0xfe,0xd4,0x01,0x05,0x02,0x00]
@@ -195,10 +195,10 @@ v_cmpx_eq_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_eq_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x82,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_eq_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_eq_f16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0x82,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_eq_f16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0x82,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_eq_f16_e64 v255.l, v255.h
-// GFX11: v_cmpx_eq_f16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0x82,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_eq_f16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0x82,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_eq_f32_e64 v1, v2
 // GFX11: v_cmpx_eq_f32_e64 v1, v2                ; encoding: [0x7e,0x00,0x92,0xd4,0x01,0x05,0x02,0x00]
@@ -327,10 +327,10 @@ v_cmpx_eq_i16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_eq_i16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xb2,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_eq_i16_e64 v1.h, v2.l
-// GFX11: v_cmpx_eq_i16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xb2,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_eq_i16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xb2,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_eq_i16_e64 v255.l, v255.h
-// GFX11: v_cmpx_eq_i16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xb2,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_eq_i16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xb2,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_eq_i32_e64 v1, v2
 // GFX11: v_cmpx_eq_i32_e64 v1, v2                ; encoding: [0x7e,0x00,0xc2,0xd4,0x01,0x05,0x02,0x00]
@@ -459,10 +459,10 @@ v_cmpx_eq_u16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_eq_u16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xba,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_eq_u16_e64 v1.h, v2.l
-// GFX11: v_cmpx_eq_u16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xba,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_eq_u16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xba,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_eq_u16_e64 v255.l, v255.h
-// GFX11: v_cmpx_eq_u16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xba,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_eq_u16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xba,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_eq_u32_e64 v1, v2
 // GFX11: v_cmpx_eq_u32_e64 v1, v2                ; encoding: [0x7e,0x00,0xca,0xd4,0x01,0x05,0x02,0x00]
@@ -591,10 +591,10 @@ v_cmpx_f_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_f_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x80,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_f_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_f_f16_e64 v1.h, v2.l             ; encoding: [0x7e,0x08,0x80,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_f_f16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0x80,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_f_f16_e64 v255.l, v255.h
-// GFX11: v_cmpx_f_f16_e64 v255.l, v255.h         ; encoding: [0x7e,0x10,0x80,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_f_f16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0x80,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_f_f32_e64 v1, v2
 // GFX11: v_cmpx_f_f32_e64 v1, v2                 ; encoding: [0x7e,0x00,0x90,0xd4,0x01,0x05,0x02,0x00]
@@ -885,10 +885,10 @@ v_cmpx_ge_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_ge_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x86,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_ge_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_ge_f16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0x86,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_ge_f16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0x86,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_ge_f16_e64 v255.l, v255.h
-// GFX11: v_cmpx_ge_f16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0x86,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_ge_f16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0x86,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_ge_f32_e64 v1, v2
 // GFX11: v_cmpx_ge_f32_e64 v1, v2                ; encoding: [0x7e,0x00,0x96,0xd4,0x01,0x05,0x02,0x00]
@@ -1017,10 +1017,10 @@ v_cmpx_ge_i16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_ge_i16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xb6,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_ge_i16_e64 v1.h, v2.l
-// GFX11: v_cmpx_ge_i16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xb6,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_ge_i16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xb6,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_ge_i16_e64 v255.l, v255.h
-// GFX11: v_cmpx_ge_i16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xb6,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_ge_i16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xb6,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_ge_i32_e64 v1, v2
 // GFX11: v_cmpx_ge_i32_e64 v1, v2                ; encoding: [0x7e,0x00,0xc6,0xd4,0x01,0x05,0x02,0x00]
@@ -1149,10 +1149,10 @@ v_cmpx_ge_u16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_ge_u16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xbe,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_ge_u16_e64 v1.h, v2.l
-// GFX11: v_cmpx_ge_u16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xbe,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_ge_u16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xbe,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_ge_u16_e64 v255.l, v255.h
-// GFX11: v_cmpx_ge_u16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xbe,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_ge_u16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xbe,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_ge_u32_e64 v1, v2
 // GFX11: v_cmpx_ge_u32_e64 v1, v2                ; encoding: [0x7e,0x00,0xce,0xd4,0x01,0x05,0x02,0x00]
@@ -1281,10 +1281,10 @@ v_cmpx_gt_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_gt_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x84,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_gt_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_gt_f16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0x84,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_gt_f16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0x84,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_gt_f16_e64 v255.l, v255.h
-// GFX11: v_cmpx_gt_f16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0x84,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_gt_f16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0x84,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_gt_f32_e64 v1, v2
 // GFX11: v_cmpx_gt_f32_e64 v1, v2                ; encoding: [0x7e,0x00,0x94,0xd4,0x01,0x05,0x02,0x00]
@@ -1413,10 +1413,10 @@ v_cmpx_gt_i16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_gt_i16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xb4,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_gt_i16_e64 v1.h, v2.l
-// GFX11: v_cmpx_gt_i16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xb4,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_gt_i16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xb4,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_gt_i16_e64 v255.l, v255.h
-// GFX11: v_cmpx_gt_i16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xb4,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_gt_i16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xb4,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_gt_i32_e64 v1, v2
 // GFX11: v_cmpx_gt_i32_e64 v1, v2                ; encoding: [0x7e,0x00,0xc4,0xd4,0x01,0x05,0x02,0x00]
@@ -1545,10 +1545,10 @@ v_cmpx_gt_u16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_gt_u16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xbc,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_gt_u16_e64 v1.h, v2.l
-// GFX11: v_cmpx_gt_u16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xbc,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_gt_u16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xbc,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_gt_u16_e64 v255.l, v255.h
-// GFX11: v_cmpx_gt_u16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xbc,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_gt_u16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xbc,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_gt_u32_e64 v1, v2
 // GFX11: v_cmpx_gt_u32_e64 v1, v2                ; encoding: [0x7e,0x00,0xcc,0xd4,0x01,0x05,0x02,0x00]
@@ -1677,10 +1677,10 @@ v_cmpx_le_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_le_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x83,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_le_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_le_f16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0x83,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_le_f16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0x83,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_le_f16_e64 v255.l, v255.h
-// GFX11: v_cmpx_le_f16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0x83,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_le_f16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0x83,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_le_f32_e64 v1, v2
 // GFX11: v_cmpx_le_f32_e64 v1, v2                ; encoding: [0x7e,0x00,0x93,0xd4,0x01,0x05,0x02,0x00]
@@ -1809,10 +1809,10 @@ v_cmpx_le_i16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_le_i16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xb3,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_le_i16_e64 v1.h, v2.l
-// GFX11: v_cmpx_le_i16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xb3,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_le_i16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xb3,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_le_i16_e64 v255.l, v255.h
-// GFX11: v_cmpx_le_i16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xb3,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_le_i16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xb3,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_le_i32_e64 v1, v2
 // GFX11: v_cmpx_le_i32_e64 v1, v2                ; encoding: [0x7e,0x00,0xc3,0xd4,0x01,0x05,0x02,0x00]
@@ -1941,10 +1941,10 @@ v_cmpx_le_u16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_le_u16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xbb,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_le_u16_e64 v1.h, v2.l
-// GFX11: v_cmpx_le_u16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xbb,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_le_u16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xbb,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_le_u16_e64 v255.l, v255.h
-// GFX11: v_cmpx_le_u16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xbb,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_le_u16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xbb,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_le_u32_e64 v1, v2
 // GFX11: v_cmpx_le_u32_e64 v1, v2                ; encoding: [0x7e,0x00,0xcb,0xd4,0x01,0x05,0x02,0x00]
@@ -2073,10 +2073,10 @@ v_cmpx_lg_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_lg_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x85,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_lg_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_lg_f16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0x85,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_lg_f16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0x85,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_lg_f16_e64 v255.l, v255.h
-// GFX11: v_cmpx_lg_f16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0x85,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_lg_f16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0x85,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_lg_f32_e64 v1, v2
 // GFX11: v_cmpx_lg_f32_e64 v1, v2                ; encoding: [0x7e,0x00,0x95,0xd4,0x01,0x05,0x02,0x00]
@@ -2205,10 +2205,10 @@ v_cmpx_lt_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_lt_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x81,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_lt_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_lt_f16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0x81,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_lt_f16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0x81,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_lt_f16_e64 v255.l, v255.h
-// GFX11: v_cmpx_lt_f16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0x81,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_lt_f16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0x81,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_lt_f32_e64 v1, v2
 // GFX11: v_cmpx_lt_f32_e64 v1, v2                ; encoding: [0x7e,0x00,0x91,0xd4,0x01,0x05,0x02,0x00]
@@ -2337,10 +2337,10 @@ v_cmpx_lt_i16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_lt_i16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xb1,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_lt_i16_e64 v1.h, v2.l
-// GFX11: v_cmpx_lt_i16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xb1,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_lt_i16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xb1,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_lt_i16_e64 v255.l, v255.h
-// GFX11: v_cmpx_lt_i16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xb1,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_lt_i16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xb1,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_lt_i32_e64 v1, v2
 // GFX11: v_cmpx_lt_i32_e64 v1, v2                ; encoding: [0x7e,0x00,0xc1,0xd4,0x01,0x05,0x02,0x00]
@@ -2469,10 +2469,10 @@ v_cmpx_lt_u16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_lt_u16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xb9,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_lt_u16_e64 v1.h, v2.l
-// GFX11: v_cmpx_lt_u16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xb9,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_lt_u16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xb9,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_lt_u16_e64 v255.l, v255.h
-// GFX11: v_cmpx_lt_u16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xb9,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_lt_u16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xb9,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_lt_u32_e64 v1, v2
 // GFX11: v_cmpx_lt_u32_e64 v1, v2                ; encoding: [0x7e,0x00,0xc9,0xd4,0x01,0x05,0x02,0x00]
@@ -2601,10 +2601,10 @@ v_cmpx_ne_i16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_ne_i16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xb5,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_ne_i16_e64 v1.h, v2.l
-// GFX11: v_cmpx_ne_i16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xb5,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_ne_i16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xb5,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_ne_i16_e64 v255.l, v255.h
-// GFX11: v_cmpx_ne_i16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xb5,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_ne_i16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xb5,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_ne_i32_e64 v1, v2
 // GFX11: v_cmpx_ne_i32_e64 v1, v2                ; encoding: [0x7e,0x00,0xc5,0xd4,0x01,0x05,0x02,0x00]
@@ -2733,10 +2733,10 @@ v_cmpx_ne_u16_e64 0xfe0b, vcc_hi
 // GFX11: v_cmpx_ne_u16_e64 0xfe0b, vcc_hi        ; encoding: [0x7e,0x00,0xbd,0xd4,0xff,0xd6,0x00,0x00,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_ne_u16_e64 v1.h, v2.l
-// GFX11: v_cmpx_ne_u16_e64 v1.h, v2.l            ; encoding: [0x7e,0x08,0xbd,0xd4,0x01,0x05,0x02,0x00]
+// GFX11: v_cmpx_ne_u16_e64 v1.h, v2.l op_sel:[1,0,0] ; encoding: [0x7e,0x08,0xbd,0xd4,0x01,0x05,0x02,0x00]
 
 v_cmpx_ne_u16_e64 v255.l, v255.h
-// GFX11: v_cmpx_ne_u16_e64 v255.l, v255.h        ; encoding: [0x7e,0x10,0xbd,0xd4,0xff,0xff,0x03,0x00]
+// GFX11: v_cmpx_ne_u16_e64 v255.l, v255.h op_sel:[0,1,0] ; encoding: [0x7e,0x10,0xbd,0xd4,0xff,0xff,0x03,0x00]
 
 v_cmpx_ne_u32_e64 v1, v2
 // GFX11: v_cmpx_ne_u32_e64 v1, v2                ; encoding: [0x7e,0x00,0xcd,0xd4,0x01,0x05,0x02,0x00]
@@ -2865,10 +2865,10 @@ v_cmpx_neq_f16_e64 -|0xfe0b|, -|vcc_hi| clamp
 // GFX11: v_cmpx_neq_f16_e64 -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7e,0x83,0x8d,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
 
 v_cmpx_neq_f16_e64 v1.h, v2.l
-// GFX11: v_cmpx_neq_f16_e64 v1.h, v2.l           ; encoding: ...
[truncated]

@kosarev kosarev requested a review from Sisyph February 4, 2025 15:15
Copy link
Collaborator

@kosarev kosarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a nit. I would suggest to change the title to something like 'Generate op_sel operands for VOPC instructions'. There's no benefit in using AsmMatchConverters where we could do without them, so the current title might be a bit confusing.

@broxigarchen broxigarchen changed the title [AMDGPU][True16][MC] update vopc profile with AsmMatchConverter [AMDGPU][True16][MC] Generate op_sel operands for VOPC instructions Feb 4, 2025
@broxigarchen broxigarchen force-pushed the main-merge-true16-vopc-asmconverter branch from a5ffd7a to 6c250bc Compare February 4, 2025 15:54
Copy link
Contributor

@Sisyph Sisyph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@broxigarchen broxigarchen merged commit 7b5e90b into llvm:main Feb 5, 2025
8 checks passed
broxigarchen added a commit that referenced this pull request Feb 5, 2025
check if op_sel is consistent with .l/.h syntax if both are presented

reopen this #123250 since
problem is resolved in #125561
github-actions bot pushed a commit to arm/arm-toolchain that referenced this pull request Feb 5, 2025
…5872)

check if op_sel is consistent with .l/.h syntax if both are presented

reopen this llvm/llvm-project#123250 since
problem is resolved in llvm/llvm-project#125561
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
…lvm#125561)

Generate op_sel operands for VOPC instructions

---------

Co-authored-by: Ivan Kosarev <[email protected]>
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
check if op_sel is consistent with .l/.h syntax if both are presented

reopen this llvm#123250 since
problem is resolved in llvm#125561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AMDGPU mc Machine (object) code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants