Skip to content

Conversation

@jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Aug 29, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Aug 29, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Jay Foad (jayfoad)

Changes

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

1 Files Affected:

  • (modified) llvm/test/MC/AMDGPU/vop3-literal.s (+182-181)
diff --git a/llvm/test/MC/AMDGPU/vop3-literal.s b/llvm/test/MC/AMDGPU/vop3-literal.s
index 74b4d6d6860bc..4209388b91087 100644
--- a/llvm/test/MC/AMDGPU/vop3-literal.s
+++ b/llvm/test/MC/AMDGPU/vop3-literal.s
@@ -1,404 +1,405 @@
+// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900  -mattr=+wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX9  %s
 // RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX10 %s
-// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900  -show-encoding %s | FileCheck -check-prefix=GFX9 %s
-// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s
-// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900  %s 2>&1 | FileCheck -check-prefix=GFX9-ERR --implicit-check-not=error: %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900  -mattr=+wavefrontsize64 %s -filetype=null 2>&1 | grep -v warning: | FileCheck -check-prefix=GFX9-ERR  -implicit-check-not=error: %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 %s -filetype=null 2>&1 | grep -v warning: | FileCheck -check-prefix=GFX10-ERR -implicit-check-not=error: %s
 
 v_bfe_u32 v0, 0x3039, v1, s1
-// GFX10:     v_bfe_u32 v0, 0x3039, v1, s1    ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0x06,0x00,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, 0x3039, v1, s1            ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0x06,0x00,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:15: error: literal operands are not supported
 
 v_bfe_u32 v0, v1, 0x3039, s1
-// GFX10:     v_bfe_u32 v0, v1, 0x3039, s1    ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xff,0x05,0x00,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, v1, 0x3039, s1            ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xff,0x05,0x00,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:19: error: literal operands are not supported
 
 v_bfe_u32 v0, v1, s1, 0x3039
-// GFX10:     v_bfe_u32 v0, v1, s1, 0x3039    ; encoding: [0x00,0x00,0x48,0xd5,0x01,0x03,0xfc,0x03,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, v1, s1, 0x3039            ; encoding: [0x00,0x00,0x48,0xd5,0x01,0x03,0xfc,0x03,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:23: error: literal operands are not supported
 
 v_bfe_u32 v0, 0x3039, 0x3039, s1
-// GFX10:     v_bfe_u32 v0, 0x3039, 0x3039, s1 ; encoding: [0x00,0x00,0x48,0xd5,0xff,0xfe,0x05,0x00,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, 0x3039, 0x3039, s1        ; encoding: [0x00,0x00,0x48,0xd5,0xff,0xfe,0x05,0x00,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:23: error: literal operands are not supported
 
 v_bfe_u32 v0, 0x3039, s1, 0x3039
-// GFX10:     v_bfe_u32 v0, 0x3039, s1, 0x3039 ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0xfc,0x03,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, 0x3039, s1, 0x3039        ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0xfc,0x03,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:27: error: literal operands are not supported
 
 v_bfe_u32 v0, v1, 0x3039, 0x3039
-// GFX10:     v_bfe_u32 v0, v1, 0x3039, 0x3039 ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xff,0xfd,0x03,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, v1, 0x3039, 0x3039        ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xff,0xfd,0x03,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:27: error: literal operands are not supported
 
 v_bfe_u32 v0, 0x3039, 0x3039, 0x3039
-// GFX10:     v_bfe_u32 v0, 0x3039, 0x3039, 0x3039 ; encoding: [0x00,0x00,0x48,0xd5,0xff,0xfe,0xfd,0x03,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, 0x3039, 0x3039, 0x3039    ; encoding: [0x00,0x00,0x48,0xd5,0xff,0xfe,0xfd,0x03,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:31: error: literal operands are not supported
 
 v_bfe_u32 v0, 0x3039, s1, 0x3038
-// GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed
-// GFX9-ERR:  error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-1]]:27: error: literal operands are not supported
+// GFX10-ERR: :[[@LINE-2]]:27: error: only one unique literal operand is allowed
 
 v_bfe_u32 v0, 0x3039, v1, v2
-// GFX10:    v_bfe_u32 v0, 0x3039, v1, v2    ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0x0a,0x04,0x39,0x30,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_bfe_u32 v0, 0x3039, v1, v2            ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0x0a,0x04,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:15: error: literal operands are not supported
 
 v_bfe_u32 v0, 0x3039, 0x12345, v2
-// GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed
-// GFX9-ERR:  error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-1]]:23: error: literal operands are not supported
+// GFX10-ERR: :[[@LINE-2]]:23: error: only one unique literal operand is allowed
 
 v_bfe_u32 v0, s1, 0x3039, s1
-// GFX9-ERR:  error: literal operands are not supported
-// GFX10: v_bfe_u32 v0, s1, 0x3039, s1 ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xfe,0x05,0x00,0x39,0x30,0x00,0x00]
+// GFX10: v_bfe_u32 v0, s1, 0x3039, s1            ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xfe,0x05,0x00,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:19: error: literal operands are not supported
 
 v_bfe_u32 v0, s1, 0x3039, s2
-// GFX9-ERR:  error: literal operands are not supported
-// GFX10-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
+// GFX9-ERR: :[[@LINE-1]]:19: error: literal operands are not supported
+// GFX10-ERR: :[[@LINE-2]]:27: error: invalid operand (violates constant bus restrictions)
 
 v_bfm_b32_e64 v0, 0x3039, s1
-// GFX10:     v_bfm_b32 v0, 0x3039, s1 ; encoding: [0x00,0x00,0x63,0xd7,0xff,0x02,0x00,0x00,0x39,0x30,0x00,0x00]
-// GFX9-ERR:  error: literal operands are not supported
+// GFX10: v_bfm_b32 v0, 0x3039, s1                ; encoding: [0x00,0x00,0x63,0xd7,0xff,0x02,0x00,0x00,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:19: error: literal operands are not supported
 
 v_bfm_b32_e64 v0, 0x3039, v1
-// GFX10:    v_bfm_b32 v0, 0x3039, v1 ; encoding: [0x00,0x00,0x63,0xd7,0xff,0x02,0x02,0x00,0x39,0x30,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_bfm_b32 v0, 0x3039, v1                ; encoding: [0x00,0x00,0x63,0xd7,0xff,0x02,0x02,0x00,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:19: error: literal operands are not supported
 
 v_bfm_b32_e64 v0, 0x3039, 0x3039
-// GFX10:    v_bfm_b32 v0, 0x3039, 0x3039 ; encoding: [0x00,0x00,0x63,0xd7,0xff,0xfe,0x01,0x00,0x39,0x30,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_bfm_b32 v0, 0x3039, 0x3039            ; encoding: [0x00,0x00,0x63,0xd7,0xff,0xfe,0x01,0x00,0x39,0x30,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:27: error: literal operands are not supported
 
 v_bfm_b32_e64 v0, 0x3039, 0x3038
-// GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed
-// GFX9-ERR:  error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-1]]:27: error: literal operands are not supported
+// GFX10-ERR: :[[@LINE-2]]:27: error: only one unique literal operand is allowed
 
 v_pk_add_f16 v1, 25.0, v2
-// GFX10:    v_pk_add_f16 v1, 0x4e40, v2     ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0x04,0x02,0x18,0x40,0x4e,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_pk_add_f16 v1, 0x4e40, v2             ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0x04,0x02,0x18,0x40,0x4e,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:18: error: literal operands are not supported
 
 v_pk_add_f16 v1, 123456, v2
-// GFX10:    v_pk_add_f16 v1, 0x1e240, v2    ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0x04,0x02,0x18,0x40,0xe2,0x01,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_pk_add_f16 v1, 0x1e240, v2            ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0x04,0x02,0x18,0x40,0xe2,0x01,0x00]
+// GFX9-ERR: :[[@LINE-2]]:18: error: literal operands are not supported
 
 v_pk_add_f16 v1, -200, v2
-// GFX10:    v_pk_add_f16 v1, 0xffffff38, v2 ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0x04,0x02,0x18,0x38,0xff,0xff,0xff]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_pk_add_f16 v1, 0xffffff38, v2         ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0x04,0x02,0x18,0x38,0xff,0xff,0xff]
+// GFX9-ERR: :[[@LINE-2]]:18: error: literal operands are not supported
 
 v_pk_add_f16 v1, 25.0, 25.0
-// GFX10:    v_pk_add_f16 v1, 0x4e40, 0x4e40 ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0xfe,0x01,0x18,0x40,0x4e,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_pk_add_f16 v1, 0x4e40, 0x4e40         ; encoding: [0x01,0x40,0x0f,0xcc,0xff,0xfe,0x01,0x18,0x40,0x4e,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:24: error: literal operands are not supported
 
 v_pk_add_f16 v1, 25.0, 25.1
-// GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed
-// GFX9-ERR:  error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-1]]:24: error: literal operands are not supported
+// GFX10-ERR: :[[@LINE-2]]:24: error: only one unique literal operand is allowed
 
 v_pk_add_u16 v1, -200, v2
-// GFX10:    v_pk_add_u16 v1, 0xffffff38, v2 ; encoding: [0x01,0x40,0x0a,0xcc,0xff,0x04,0x02,0x18,0x38,0xff,0xff,0xff]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_pk_add_u16 v1, 0xffffff38, v2         ; encoding: [0x01,0x40,0x0a,0xcc,0xff,0x04,0x02,0x18,0x38,0xff,0xff,0xff]
+// GFX9-ERR: :[[@LINE-2]]:18: error: literal operands are not supported
 
 v_pk_add_u16 v1, 64, v2
-// GFX10: v_pk_add_u16 v1, 64, v2         ; encoding: [0x01,0x40,0x0a,0xcc,0xc0,0x04,0x02,0x18]
-// GFX9:  v_pk_add_u16 v1, 64, v2         ; encoding: [0x01,0x40,0x8a,0xd3,0xc0,0x04,0x02,0x18]
+// GFX9: v_pk_add_u16 v1, 64, v2                 ; encoding: [0x01,0x40,0x8a,0xd3,0xc0,0x04,0x02,0x18]
+// GFX10: v_pk_add_u16 v1, 64, v2                 ; encoding: [0x01,0x40,0x0a,0xcc,0xc0,0x04,0x02,0x18]
 
 v_pk_add_u16 v1, 65, v2
-// GFX10: v_pk_add_u16 v1, 0x41, v2       ; encoding: [0x01,0x40,0x0a,0xcc,0xff,0x04,0x02,0x18,0x41,0x00,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_pk_add_u16 v1, 0x41, v2               ; encoding: [0x01,0x40,0x0a,0xcc,0xff,0x04,0x02,0x18,0x41,0x00,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:18: error: literal operands are not supported
 
 v_pk_add_u16 v1, -1, v2
-// GFX10: v_pk_add_u16 v1, -1, v2         ; encoding: [0x01,0x40,0x0a,0xcc,0xc1,0x04,0x02,0x18]
-// GFX9:  v_pk_add_u16 v1, -1, v2         ; encoding: [0x01,0x40,0x8a,0xd3,0xc1,0x04,0x02,0x18]
+// GFX9: v_pk_add_u16 v1, -1, v2                 ; encoding: [0x01,0x40,0x8a,0xd3,0xc1,0x04,0x02,0x18]
+// GFX10: v_pk_add_u16 v1, -1, v2                 ; encoding: [0x01,0x40,0x0a,0xcc,0xc1,0x04,0x02,0x18]
 
 v_pk_add_u16 v1, -5, v2
-// GFX10: v_pk_add_u16 v1, -5, v2         ; encoding: [0x01,0x40,0x0a,0xcc,0xc5,0x04,0x02,0x18]
-// GFX9:  v_pk_add_u16 v1, -5, v2         ; encoding: [0x01,0x40,0x8a,0xd3,0xc5,0x04,0x02,0x18]
+// GFX9: v_pk_add_u16 v1, -5, v2                 ; encoding: [0x01,0x40,0x8a,0xd3,0xc5,0x04,0x02,0x18]
+// GFX10: v_pk_add_u16 v1, -5, v2                 ; encoding: [0x01,0x40,0x0a,0xcc,0xc5,0x04,0x02,0x18]
 
 v_pk_add_u16 v1, -100, v2
-// GFX10: v_pk_add_u16 v1, 0xffffff9c, v2 ; encoding: [0x01,0x40,0x0a,0xcc,0xff,0x04,0x02,0x18,0x9c,0xff,0xff,0xff]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_pk_add_u16 v1, 0xffffff9c, v2         ; encoding: [0x01,0x40,0x0a,0xcc,0xff,0x04,0x02,0x18,0x9c,0xff,0xff,0xff]
+// GFX9-ERR: :[[@LINE-2]]:18: error: literal operands are not supported
 
 v_pk_add_u16 v1, -100, -100
 // GFX10: v_pk_add_u16 v1, 0xffffff9c, 0xffffff9c ; encoding: [0x01,0x40,0x0a,0xcc,0xff,0xfe,0x01,0x18,0x9c,0xff,0xff,0xff]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-2]]:24: error: literal operands are not supported
 
 v_add_f32_e64 v1, neg(abs(0x123)), v3
-// GFX10: v_add_f32_e64 v1, -|0x123|, v3  ; encoding: [0x01,0x01,0x03,0xd5,0xff,0x06,0x02,0x20,0x23,0x01,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_add_f32_e64 v1, -|0x123|, v3          ; encoding: [0x01,0x01,0x03,0xd5,0xff,0x06,0x02,0x20,0x23,0x01,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:27: error: literal operands are not supported
 
 v_add_f32_e64 v1, v3, neg(0x123)
-// GFX10: v_add_f32_e64 v1, v3, neg(0x123) ; encoding: [0x01,0x00,0x03,0xd5,0x03,0xff,0x01,0x40,0x23,0x01,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_add_f32_e64 v1, v3, neg(0x123)        ; encoding: [0x01,0x00,0x03,0xd5,0x03,0xff,0x01,0x40,0x23,0x01,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:27: error: literal operands are not supported
 
 v_add_f32_e64 v1, neg(abs(0x12345678)), neg(0x12345678)
 // GFX10: v_add_f32_e64 v1, -|0x12345678|, neg(0x12345678) ; encoding: [0x01,0x01,0x03,0xd5,0xff,0xfe,0x01,0x60,0x78,0x56,0x34,0x12]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-2]]:45: error: literal operands are not supported
 
 v_add_f16_e64 v0, v0, 0xfe0b
-// GFX10: v_add_f16_e64 v0, v0, 0xfe0b      ; encoding: [0x00,0x00,0x32,0xd5,0x00,0xff,0x01,0x00,0x0b,0xfe,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_add_f16_e64 v0, v0, 0xfe0b            ; encoding: [0x00,0x00,0x32,0xd5,0x00,0xff,0x01,0x00,0x0b,0xfe,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:23: error: literal operands are not supported
 
 v_add_f16_e64 v0, v0, neg(0xfe0b)
-// GFX10: v_add_f16_e64 v0, v0, neg(0xfe0b) ; encoding: [0x00,0x00,0x32,0xd5,0x00,0xff,0x01,0x40,0x0b,0xfe,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_add_f16_e64 v0, v0, neg(0xfe0b)       ; encoding: [0x00,0x00,0x32,0xd5,0x00,0xff,0x01,0x40,0x0b,0xfe,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:27: error: literal operands are not supported
 
 v_add_f16_e64 v0, 0x3456, v0
-// GFX10: v_add_f16_e64 v0, 0x3456, v0      ; encoding: [0x00,0x00,0x32,0xd5,0xff,0x00,0x02,0x00,0x56,0x34,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_add_f16_e64 v0, 0x3456, v0            ; encoding: [0x00,0x00,0x32,0xd5,0xff,0x00,0x02,0x00,0x56,0x34,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:19: error: literal operands are not supported
 
 v_add_f16_e64 v0, 0xfe0b, neg(0xfe0b)
-// GFX10: v_add_f16_e64 v0, 0xfe0b, neg(0xfe0b) ; encoding: [0x00,0x00,0x32,0xd5,0xff,0xfe,0x01,0x40,0x0b,0xfe,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_add_f16_e64 v0, 0xfe0b, neg(0xfe0b)   ; encoding: [0x00,0x00,0x32,0xd5,0xff,0xfe,0x01,0x40,0x0b,0xfe,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:31: error: literal operands are not supported
 
 v_add_f64 v[0:1], 1.23456, v[0:1]
-// GFX10: v_add_f64 v[0:1], 0x3ff3c0c1, v[0:1] ; encoding: [0x00,0x00,0x64,0xd5,0xff,0x00,0x02,0x00,0xc1,0xc0,0xf3,0x3f]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_add_f64 v[0:1], 0x3ff3c0c1, v[0:1]    ; encoding: [0x00,0x00,0x64,0xd5,0xff,0x00,0x02,0x00,0xc1,0xc0,0xf3,0x3f]
+// GFX9-ERR: :[[@LINE-2]]:19: error: literal operands are not supported
 
 v_add_f64 v[0:1], v[0:1], -abs(1.23456)
 // GFX10: v_add_f64 v[0:1], v[0:1], -|0x3ff3c0c1| ; encoding: [0x00,0x02,0x64,0xd5,0x00,0xff,0x01,0x40,0xc1,0xc0,0xf3,0x3f]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-2]]:32: error: literal operands are not supported
 
 v_add_f64 v[0:1], 1.23456, -abs(1.23456)
 // GFX10: v_add_f64 v[0:1], 0x3ff3c0c1, -|0x3ff3c0c1| ; encoding: [0x00,0x02,0x64,0xd5,0xff,0xfe,0x01,0x40,0xc1,0xc0,0xf3,0x3f]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-2]]:33: error: literal operands are not supported
 
 v_add_f64 v[0:1], 1.23456, -abs(1.2345)
-// GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed
-// GFX9-ERR:  error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-1]]:33: error: literal operands are not supported
+// GFX10-ERR: :[[@LINE-2]]:33: error: only one unique literal operand is allowed
 
 v_max_i16_e64 v5, 0xfe0b, v2
-// GFX10: v_max_i16 v5, 0xfe0b, v2 ; encoding: [0x05,0x00,0x0a,0xd7,0xff,0x04,0x02,0x00,0x0b,0xfe,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_max_i16 v5, 0xfe0b, v2                ; encoding: [0x05,0x00,0x0a,0xd7,0xff,0x04,0x02,0x00,0x0b,0xfe,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:19: error: literal operands are not supported
 
 v_max_i16_e64 v5, v1, 0x123
-// GFX10: v_max_i16 v5, v1, 0x123 ; encoding: [0x05,0x00,0x0a,0xd7,0x01,0xff,0x01,0x00,0x23,0x01,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_max_i16 v5, v1, 0x123                 ; encoding: [0x05,0x00,0x0a,0xd7,0x01,0xff,0x01,0x00,0x23,0x01,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:23: error: literal operands are not supported
 
 v_max_i16_e64 v5, 0x1234, 0x1234
-// GFX10: v_max_i16 v5, 0x1234, 0x1234 ; encoding: [0x05,0x00,0x0a,0xd7,0xff,0xfe,0x01,0x00,0x34,0x12,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_max_i16 v5, 0x1234, 0x1234            ; encoding: [0x05,0x00,0x0a,0xd7,0xff,0xfe,0x01,0x00,0x34,0x12,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:27: error: literal operands are not supported
 
 v_min3_i16 v5, 0xfe0b, v2, v3
-// GFX10: v_min3_i16 v5, 0xfe0b, v2, v3   ; encoding: [0x05,0x00,0x52,0xd7,0xff,0x04,0x0e,0x04,0x0b,0xfe,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_min3_i16 v5, 0xfe0b, v2, v3           ; encoding: [0x05,0x00,0x52,0xd7,0xff,0x04,0x0e,0x04,0x0b,0xfe,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:16: error: literal operands are not supported
 
 v_min3_i16 v5, v1, 0x1234, v3
-// GFX10: v_min3_i16 v5, v1, 0x1234, v3   ; encoding: [0x05,0x00,0x52,0xd7,0x01,0xff,0x0d,0x04,0x34,0x12,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_min3_i16 v5, v1, 0x1234, v3           ; encoding: [0x05,0x00,0x52,0xd7,0x01,0xff,0x0d,0x04,0x34,0x12,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:20: error: literal operands are not supported
 
 v_min3_i16 v5, v1, v2, 0x5678
-// GFX10: v_min3_i16 v5, v1, v2, 0x5678   ; encoding: [0x05,0x00,0x52,0xd7,0x01,0x05,0xfe,0x03,0x78,0x56,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_min3_i16 v5, v1, v2, 0x5678           ; encoding: [0x05,0x00,0x52,0xd7,0x01,0x05,0xfe,0x03,0x78,0x56,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:24: error: literal operands are not supported
 
 v_min3_i16 v5, 0x5678, 0x5678, 0x5678
-// GFX10: v_min3_i16 v5, 0x5678, 0x5678, 0x5678 ; encoding: [0x05,0x00,0x52,0xd7,0xff,0xfe,0xfd,0x03,0x78,0x56,0x00,0x00]
-// GFX9-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: literal operands are not supported
+// GFX10: v_min3_i16 v5, 0x5678, 0x5678, 0x5678   ; encoding: [0x05,0x00,0x52,0xd7,0xff,0xfe,0xfd,0x03,0x78,0x56,0x00,0x00]
+// GFX9-ERR: :[[@LINE-2]]:32: error: literal operands are not supported
 
 v_min3_i16 v5, 0x5678, 0x5679, 0x5678
-// GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed
-// GFX9-ERR:  error: literal operands are not supported
+// GFX9-ERR: :[[@LINE-1]]:32: error: literal operands are not supported
+// GFX10-ERR: :[[@LINE-2]]:32: error: only one unique literal operand is allowed
 
 v_min3_i16 v5, 0x5678, 0x5678, 0x5679
-// GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed
-// GFX9-ERR:  error: literal ...
[truncated]

Comment on lines 4 to 5
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 -mattr=+wavefrontsize64 %s -filetype=null 2>&1 | grep -v warning: | FileCheck -check-prefix=GFX9-ERR -implicit-check-not=error: %s
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 %s -filetype=null 2>&1 | grep -v warning: | FileCheck -check-prefix=GFX10-ERR -implicit-check-not=error: %s
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@broxigarchen on my first attempt, update_mc_test_checks generated checks for some warning: lines instead of the error: lines I really wanted. That is why I grep out all warnings here.

The warning lines looked like:

<unknown>:0: warning: Can't encode literal as exact 64-bit floating-point operand. Low 32-bits will be set to zero

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't remember - but what's the guidance on including grep in the RUN lines? How cross platform will that be?
(Does lit provide a version in the implementation? I think some command line utils are handled aren't they?)

Yes - just looked it up:
https://llvm.org/docs/TestingGuide.html#writing-new-regression-tests

"The usage of grep in RUN lines is deprecated - please do not send or commit patches that use it."

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe sed could be used instead of grep?
Alternatively, if you really do not want warnings - you could remove them manually (not ideal, as they will re-appear the next time).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found llvm-mc -no-warn so I don't need grep.

Copy link
Contributor

@broxigarchen broxigarchen Sep 2, 2025

Choose a reason for hiding this comment

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

I remembered I used grep before but it causes issues on some CI machines as they don't have grep on it, but sed is acceptable.

Btw, update_mc_test_checks only gets the first warning or error,

ERROR_RE = re.compile(r":\d+: (warning|error): .*")
Maybe we should try to get all of them.

// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9-ERR --implicit-check-not=error: %s
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 -mattr=+wavefrontsize64 -show-encoding %s | FileCheck %s -check-prefix=GFX9
Copy link
Collaborator

Choose a reason for hiding this comment

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

w64 on gfx9 is not required, but it doesn't hurt, and I assume you added it for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, to try to make the RUN lines align vertically, but I have mostly given up on that now.

Copy link
Collaborator

@piotrAMD piotrAMD left a comment

Choose a reason for hiding this comment

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

LGTM

EDIT, modulo comment about grep. Before approving I did check that there were already "grep" present in the existing tests, just didn't know about the deprecation.

@dstutt
Copy link
Collaborator

dstutt commented Sep 2, 2025

LGTM

EDIT, modulo comment about grep. Before approving I did check that there were already "grep" present in the existing tests, just didn't know about the deprecation.

But not in AMDGPU tests?

Copy link
Collaborator

@dstutt dstutt left a comment

Choose a reason for hiding this comment

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

LGTM

@jayfoad jayfoad merged commit 8c958c2 into llvm:main Sep 2, 2025
9 checks passed
@jayfoad jayfoad deleted the autogenerate-vop3-literal branch September 2, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants