Skip to content

[AMDGPU][True16][test] update VOPC/VOPCX test for true16/fake16 #112829

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
merged 1 commit into from
Oct 28, 2024

Conversation

broxigarchen
Copy link
Contributor

@broxigarchen broxigarchen commented Oct 18, 2024

This is a non-functional change

update GFX11/GFX12 VOPC/VOPCX asm/dasm test for true16/fake16:

  1. duplicate files to be true16/fake16 by adding "-mattr=+real-true16/-mattr=-real-true16" while true16 test file will be updated to true16 format when the true16 instructions are supported
  2. sort "*t16_err.s" and "*t16_promote.s" tests to alphabetic order. tests to alphabetic order. This is for the upcoming true16 mc changes, and mainly trying to help repo maintainer to resolve conflicts in the tests quickly. A script is proposed to help for the sorting [AMDGPU][test]added unique and sort options for update_mc_test_check script #111769. Since these two files are t16 only, it should not create conflicts in downstream branches
  3. add -filetype=null to seperate stdout and stderr to avoid disordered output from llvm-mc

@llvmbot llvmbot added backend:AMDGPU mc Machine (object) code labels Oct 18, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 18, 2024

@llvm/pr-subscribers-mc

@llvm/pr-subscribers-backend-amdgpu

Author: Brox Chen (broxigarchen)

Changes

update GFX11/GFX12 VOPC/VOPCX asm/dasm test for true16/fake16:

  1. duplicate files to be true16/fake16 while true16 will be updated to true16 format when the true16 instructions are supported
  2. sort the test line to alphabetic order. This is for the coming mc changes

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

34 Files Affected:

  • (added) llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc-fake16.s (+10487)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc.s (+7438-7437)
  • (added) llvm/test/MC/AMDGPU/gfx11_asm_vopc-fake16.s (+10949)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopc.s (+8020-8019)
  • (added) llvm/test/MC/AMDGPU/gfx11_asm_vopc_dpp16-fake16.s (+7173)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopc_dpp16.s (+5139-5138)
  • (added) llvm/test/MC/AMDGPU/gfx11_asm_vopc_dpp8-fake16.s (+1541)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopc_dpp8.s (+968-967)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopc_t16_err.s (+1481-1480)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopc_t16_promote.s (+1312-1311)
  • (added) llvm/test/MC/AMDGPU/gfx11_asm_vopcx_dpp16-fake16.s (+2691)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopcx_dpp16.s (+1543-1542)
  • (added) llvm/test/MC/AMDGPU/gfx11_asm_vopcx_dpp8-fake16.s (+579)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopcx_dpp8.s (+197-196)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopcx_t16_err.s (+360-359)
  • (modified) llvm/test/MC/AMDGPU/gfx11_asm_vopcx_t16_promote.s (+360-359)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vop3c-fake16.s (+8696)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vop3c.s (+6166-6165)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vopc-fake16.s (+9077)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopc.s (+6650-6649)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vopc_dpp16-fake16.s (+6053)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopc_dpp16.s (+4335-4334)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vopc_dpp8-fake16.s (+1301)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopc_dpp8.s (+818-817)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopc_t16_err.s (+1347-1346)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopc_t16_promote.s (+1941-1940)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vopcx-fake16.s (+3405)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopcx.s (+2058-2057)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vopcx_dpp16-fake16.s (+2271)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopcx_dpp16.s (+1301-1300)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vopcx_dpp8-fake16.s (+489)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopcx_dpp8.s (+167-166)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopcx_t16_err.s (+324-323)
  • (modified) llvm/test/MC/AMDGPU/gfx12_asm_vopcx_t16_promote.s (+324-323)
diff --git a/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc-fake16.s b/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc-fake16.s
new file mode 100644
index 00000000000000..b22f69eb0940b4
--- /dev/null
+++ b/llvm/test/MC/AMDGPU/gfx11_asm_vop3_from_vopc-fake16.s
@@ -0,0 +1,10487 @@
+; NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --sort --version 5
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32,-real-true16 -show-encoding %s | FileCheck --check-prefixes=GFX11,W32 %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64,-real-true16 -show-encoding %s | FileCheck --check-prefixes=GFX11,W64 %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32,-real-true16 %s 2>&1 > /dev/null | FileCheck --check-prefix=W32-ERR --implicit-check-not=error: %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64,-real-true16 %s 2>&1 > /dev/null | FileCheck --check-prefix=W64-ERR --implicit-check-not=error: %s
+
+v_cmp_class_f16_e64 null, -|0xfe0b|, vcc_hi
+// GFX11: v_cmp_class_f16_e64 null, -|0xfe0b|, vcc_hi ; encoding: [0x7c,0x01,0x7d,0xd4,0xff,0xd6,0x00,0x20,0x0b,0xfe,0x00,0x00]
+
+v_cmp_class_f16_e64 s105, null, exec_lo
+// W32: v_cmp_class_f16_e64 s105, null, exec_lo ; encoding: [0x69,0x00,0x7d,0xd4,0x7c,0xfc,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, exec_hi, null
+// W32: v_cmp_class_f16_e64 s5, exec_hi, null   ; encoding: [0x05,0x00,0x7d,0xd4,0x7f,0xf8,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, exec_lo, -1
+// W32: v_cmp_class_f16_e64 s5, exec_lo, -1     ; encoding: [0x05,0x00,0x7d,0xd4,0x7e,0x82,0x01,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, m0, src_scc
+// W32: v_cmp_class_f16_e64 s5, m0, src_scc     ; encoding: [0x05,0x00,0x7d,0xd4,0x7d,0xfa,0x01,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, s1, v2
+// W32: v_cmp_class_f16_e64 s5, s1, v2          ; encoding: [0x05,0x00,0x7d,0xd4,0x01,0x04,0x02,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, s105, v255
+// W32: v_cmp_class_f16_e64 s5, s105, v255      ; encoding: [0x05,0x00,0x7d,0xd4,0x69,0xfe,0x03,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, ttmp15, ttmp15
+// W32: v_cmp_class_f16_e64 s5, ttmp15, ttmp15  ; encoding: [0x05,0x00,0x7d,0xd4,0x7b,0xf6,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, v1, v2
+// W32: v_cmp_class_f16_e64 s5, v1, v2          ; encoding: [0x05,0x00,0x7d,0xd4,0x01,0x05,0x02,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, v255, v2
+// W32: v_cmp_class_f16_e64 s5, v255, v2        ; encoding: [0x05,0x00,0x7d,0xd4,0xff,0x05,0x02,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, vcc_hi, s105
+// W32: v_cmp_class_f16_e64 s5, vcc_hi, s105    ; encoding: [0x05,0x00,0x7d,0xd4,0x6b,0xd2,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s5, vcc_lo, s2
+// W32: v_cmp_class_f16_e64 s5, vcc_lo, s2      ; encoding: [0x05,0x00,0x7d,0xd4,0x6a,0x04,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[104:105], -1, exec_hi
+// W64: v_cmp_class_f16_e64 s[104:105], -1, exec_hi ; encoding: [0x68,0x00,0x7d,0xd4,0xc1,0xfe,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], exec_hi, null
+// W64: v_cmp_class_f16_e64 s[10:11], exec_hi, null ; encoding: [0x0a,0x00,0x7d,0xd4,0x7f,0xf8,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], exec_lo, -1
+// W64: v_cmp_class_f16_e64 s[10:11], exec_lo, -1 ; encoding: [0x0a,0x00,0x7d,0xd4,0x7e,0x82,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], m0, src_scc
+// W64: v_cmp_class_f16_e64 s[10:11], m0, src_scc ; encoding: [0x0a,0x00,0x7d,0xd4,0x7d,0xfa,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], null, exec_lo
+// W64: v_cmp_class_f16_e64 s[10:11], null, exec_lo ; encoding: [0x0a,0x00,0x7d,0xd4,0x7c,0xfc,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], s1, v2
+// W64: v_cmp_class_f16_e64 s[10:11], s1, v2    ; encoding: [0x0a,0x00,0x7d,0xd4,0x01,0x04,0x02,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], s105, v255
+// W64: v_cmp_class_f16_e64 s[10:11], s105, v255 ; encoding: [0x0a,0x00,0x7d,0xd4,0x69,0xfe,0x03,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], ttmp15, ttmp15
+// W64: v_cmp_class_f16_e64 s[10:11], ttmp15, ttmp15 ; encoding: [0x0a,0x00,0x7d,0xd4,0x7b,0xf6,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], v1, 0.5
+// W64: v_cmp_class_f16_e64 s[10:11], v1, 0.5   ; encoding: [0x0a,0x00,0x7d,0xd4,0x01,0xe1,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], v1, v2
+// W64: v_cmp_class_f16_e64 s[10:11], v1, v2    ; encoding: [0x0a,0x00,0x7d,0xd4,0x01,0x05,0x02,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], v255, v2
+// W64: v_cmp_class_f16_e64 s[10:11], v255, v2  ; encoding: [0x0a,0x00,0x7d,0xd4,0xff,0x05,0x02,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], vcc_hi, s105
+// W64: v_cmp_class_f16_e64 s[10:11], vcc_hi, s105 ; encoding: [0x0a,0x00,0x7d,0xd4,0x6b,0xd2,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 s[10:11], vcc_lo, s2
+// W64: v_cmp_class_f16_e64 s[10:11], vcc_lo, s2 ; encoding: [0x0a,0x00,0x7d,0xd4,0x6a,0x04,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 ttmp15, src_scc, vcc_lo
+// W32: v_cmp_class_f16_e64 ttmp15, src_scc, vcc_lo ; encoding: [0x7b,0x00,0x7d,0xd4,0xfd,0xd4,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 ttmp[14:15], src_scc, vcc_lo
+// W64: v_cmp_class_f16_e64 ttmp[14:15], src_scc, vcc_lo ; encoding: [0x7a,0x00,0x7d,0xd4,0xfd,0xd4,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 vcc, 0.5, m0
+// W64: v_cmp_class_f16_e64 vcc, 0.5, m0        ; encoding: [0x6a,0x00,0x7d,0xd4,0xf0,0xfa,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 vcc_hi, 0.5, m0
+// W32: v_cmp_class_f16_e64 vcc_hi, 0.5, m0     ; encoding: [0x6b,0x00,0x7d,0xd4,0xf0,0xfa,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f16_e64 vcc_lo, -1, exec_hi
+// W32: v_cmp_class_f16_e64 vcc_lo, -1, exec_hi ; encoding: [0x6a,0x00,0x7d,0xd4,0xc1,0xfe,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 null, -|0xaf123456|, vcc_hi
+// GFX11: v_cmp_class_f32_e64 null, -|0xaf123456|, vcc_hi ; encoding: [0x7c,0x01,0x7e,0xd4,0xff,0xd6,0x00,0x20,0x56,0x34,0x12,0xaf]
+
+v_cmp_class_f32_e64 s105, null, exec_lo
+// W32: v_cmp_class_f32_e64 s105, null, exec_lo ; encoding: [0x69,0x00,0x7e,0xd4,0x7c,0xfc,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, exec_hi, null
+// W32: v_cmp_class_f32_e64 s5, exec_hi, null   ; encoding: [0x05,0x00,0x7e,0xd4,0x7f,0xf8,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, exec_lo, -1
+// W32: v_cmp_class_f32_e64 s5, exec_lo, -1     ; encoding: [0x05,0x00,0x7e,0xd4,0x7e,0x82,0x01,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, m0, 0.5
+// W32: v_cmp_class_f32_e64 s5, m0, 0.5         ; encoding: [0x05,0x00,0x7e,0xd4,0x7d,0xe0,0x01,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, s1, s2
+// W32: v_cmp_class_f32_e64 s5, s1, s2          ; encoding: [0x05,0x00,0x7e,0xd4,0x01,0x04,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, s105, s105
+// W32: v_cmp_class_f32_e64 s5, s105, s105      ; encoding: [0x05,0x00,0x7e,0xd4,0x69,0xd2,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, ttmp15, src_scc
+// W32: v_cmp_class_f32_e64 s5, ttmp15, src_scc ; encoding: [0x05,0x00,0x7e,0xd4,0x7b,0xfa,0x01,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, v1, v2
+// W32: v_cmp_class_f32_e64 s5, v1, v2          ; encoding: [0x05,0x00,0x7e,0xd4,0x01,0x05,0x02,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, v255, v255
+// W32: v_cmp_class_f32_e64 s5, v255, v255      ; encoding: [0x05,0x00,0x7e,0xd4,0xff,0xff,0x03,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, vcc_hi, 0xaf123456
+// W32: v_cmp_class_f32_e64 s5, vcc_hi, 0xaf123456 ; encoding: [0x05,0x00,0x7e,0xd4,0x6b,0xfe,0x01,0x00,0x56,0x34,0x12,0xaf]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s5, vcc_lo, ttmp15
+// W32: v_cmp_class_f32_e64 s5, vcc_lo, ttmp15  ; encoding: [0x05,0x00,0x7e,0xd4,0x6a,0xf6,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[104:105], -1, exec_hi
+// W64: v_cmp_class_f32_e64 s[104:105], -1, exec_hi ; encoding: [0x68,0x00,0x7e,0xd4,0xc1,0xfe,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], exec_hi, null
+// W64: v_cmp_class_f32_e64 s[10:11], exec_hi, null ; encoding: [0x0a,0x00,0x7e,0xd4,0x7f,0xf8,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], exec_lo, -1
+// W64: v_cmp_class_f32_e64 s[10:11], exec_lo, -1 ; encoding: [0x0a,0x00,0x7e,0xd4,0x7e,0x82,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], m0, 0.5
+// W64: v_cmp_class_f32_e64 s[10:11], m0, 0.5   ; encoding: [0x0a,0x00,0x7e,0xd4,0x7d,0xe0,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], null, exec_lo
+// W64: v_cmp_class_f32_e64 s[10:11], null, exec_lo ; encoding: [0x0a,0x00,0x7e,0xd4,0x7c,0xfc,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], s1, s2
+// W64: v_cmp_class_f32_e64 s[10:11], s1, s2    ; encoding: [0x0a,0x00,0x7e,0xd4,0x01,0x04,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], s105, s105
+// W64: v_cmp_class_f32_e64 s[10:11], s105, s105 ; encoding: [0x0a,0x00,0x7e,0xd4,0x69,0xd2,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], ttmp15, src_scc
+// W64: v_cmp_class_f32_e64 s[10:11], ttmp15, src_scc ; encoding: [0x0a,0x00,0x7e,0xd4,0x7b,0xfa,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], v1, v2
+// W64: v_cmp_class_f32_e64 s[10:11], v1, v2    ; encoding: [0x0a,0x00,0x7e,0xd4,0x01,0x05,0x02,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], v255, v255
+// W64: v_cmp_class_f32_e64 s[10:11], v255, v255 ; encoding: [0x0a,0x00,0x7e,0xd4,0xff,0xff,0x03,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], vcc_hi, 0xaf123456
+// W64: v_cmp_class_f32_e64 s[10:11], vcc_hi, 0xaf123456 ; encoding: [0x0a,0x00,0x7e,0xd4,0x6b,0xfe,0x01,0x00,0x56,0x34,0x12,0xaf]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 s[10:11], vcc_lo, ttmp15
+// W64: v_cmp_class_f32_e64 s[10:11], vcc_lo, ttmp15 ; encoding: [0x0a,0x00,0x7e,0xd4,0x6a,0xf6,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 ttmp15, src_scc, vcc_lo
+// W32: v_cmp_class_f32_e64 ttmp15, src_scc, vcc_lo ; encoding: [0x7b,0x00,0x7e,0xd4,0xfd,0xd4,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 ttmp[14:15], src_scc, vcc_lo
+// W64: v_cmp_class_f32_e64 ttmp[14:15], src_scc, vcc_lo ; encoding: [0x7a,0x00,0x7e,0xd4,0xfd,0xd4,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 vcc, 0.5, m0
+// W64: v_cmp_class_f32_e64 vcc, 0.5, m0        ; encoding: [0x6a,0x00,0x7e,0xd4,0xf0,0xfa,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 vcc_hi, 0.5, m0
+// W32: v_cmp_class_f32_e64 vcc_hi, 0.5, m0     ; encoding: [0x6b,0x00,0x7e,0xd4,0xf0,0xfa,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f32_e64 vcc_lo, -1, exec_hi
+// W32: v_cmp_class_f32_e64 vcc_lo, -1, exec_hi ; encoding: [0x6a,0x00,0x7e,0xd4,0xc1,0xfe,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 null, 0xaf123456, 0xaf123456
+// GFX11: v_cmp_class_f64_e64 null, 0xaf123456, 0xaf123456 ; encoding: [0x7c,0x00,0x7f,0xd4,0xff,0xfe,0x01,0x00,0x56,0x34,0x12,0xaf]
+
+v_cmp_class_f64_e64 s105, null, null
+// W32: v_cmp_class_f64_e64 s105, null, null    ; encoding: [0x69,0x00,0x7f,0xd4,0x7c,0xf8,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, exec, exec_lo
+// W32: v_cmp_class_f64_e64 s5, exec, exec_lo   ; encoding: [0x05,0x00,0x7f,0xd4,0x7e,0xfc,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, s[104:105], vcc_lo
+// W32: v_cmp_class_f64_e64 s5, s[104:105], vcc_lo ; encoding: [0x05,0x00,0x7f,0xd4,0x68,0xd4,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, s[2:3], vcc_hi
+// W32: v_cmp_class_f64_e64 s5, s[2:3], vcc_hi  ; encoding: [0x05,0x00,0x7f,0xd4,0x02,0xd6,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, ttmp[14:15], exec_hi
+// W32: v_cmp_class_f64_e64 s5, ttmp[14:15], exec_hi ; encoding: [0x05,0x00,0x7f,0xd4,0x7a,0xfe,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, v[1:2], s105
+// W32: v_cmp_class_f64_e64 s5, v[1:2], s105    ; encoding: [0x05,0x00,0x7f,0xd4,0x01,0xd3,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, v[1:2], s2
+// W32: v_cmp_class_f64_e64 s5, v[1:2], s2      ; encoding: [0x05,0x00,0x7f,0xd4,0x01,0x05,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, v[1:2], v2
+// W32: v_cmp_class_f64_e64 s5, v[1:2], v2      ; encoding: [0x05,0x00,0x7f,0xd4,0x01,0x05,0x02,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, v[1:2], v255
+// W32: v_cmp_class_f64_e64 s5, v[1:2], v255    ; encoding: [0x05,0x00,0x7f,0xd4,0x01,0xff,0x03,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, v[254:255], ttmp15
+// W32: v_cmp_class_f64_e64 s5, v[254:255], ttmp15 ; encoding: [0x05,0x00,0x7f,0xd4,0xfe,0xf7,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s5, vcc, m0
+// W32: v_cmp_class_f64_e64 s5, vcc, m0         ; encoding: [0x05,0x00,0x7f,0xd4,0x6a,0xfa,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[104:105], -1, -1
+// W64: v_cmp_class_f64_e64 s[104:105], -1, -1  ; encoding: [0x68,0x00,0x7f,0xd4,0xc1,0x82,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], exec, exec_lo
+// W64: v_cmp_class_f64_e64 s[10:11], exec, exec_lo ; encoding: [0x0a,0x00,0x7f,0xd4,0x7e,0xfc,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], null, null
+// W64: v_cmp_class_f64_e64 s[10:11], null, null ; encoding: [0x0a,0x00,0x7f,0xd4,0x7c,0xf8,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], s[104:105], vcc_lo
+// W64: v_cmp_class_f64_e64 s[10:11], s[104:105], vcc_lo ; encoding: [0x0a,0x00,0x7f,0xd4,0x68,0xd4,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], s[2:3], vcc_hi
+// W64: v_cmp_class_f64_e64 s[10:11], s[2:3], vcc_hi ; encoding: [0x0a,0x00,0x7f,0xd4,0x02,0xd6,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], ttmp[14:15], exec_hi
+// W64: v_cmp_class_f64_e64 s[10:11], ttmp[14:15], exec_hi ; encoding: [0x0a,0x00,0x7f,0xd4,0x7a,0xfe,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], v[1:2], s105
+// W64: v_cmp_class_f64_e64 s[10:11], v[1:2], s105 ; encoding: [0x0a,0x00,0x7f,0xd4,0x01,0xd3,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], v[1:2], s2
+// W64: v_cmp_class_f64_e64 s[10:11], v[1:2], s2 ; encoding: [0x0a,0x00,0x7f,0xd4,0x01,0x05,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], v[1:2], v2
+// W64: v_cmp_class_f64_e64 s[10:11], v[1:2], v2 ; encoding: [0x0a,0x00,0x7f,0xd4,0x01,0x05,0x02,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], v[1:2], v255
+// W64: v_cmp_class_f64_e64 s[10:11], v[1:2], v255 ; encoding: [0x0a,0x00,0x7f,0xd4,0x01,0xff,0x03,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], v[254:255], ttmp15
+// W64: v_cmp_class_f64_e64 s[10:11], v[254:255], ttmp15 ; encoding: [0x0a,0x00,0x7f,0xd4,0xfe,0xf7,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 s[10:11], vcc, m0
+// W64: v_cmp_class_f64_e64 s[10:11], vcc, m0   ; encoding: [0x0a,0x00,0x7f,0xd4,0x6a,0xfa,0x00,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 ttmp15, -|src_scc|, src_scc
+// W32: v_cmp_class_f64_e64 ttmp15, -|src_scc|, src_scc ; encoding: [0x7b,0x01,0x7f,0xd4,0xfd,0xfa,0x01,0x20]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 ttmp[14:15], -|src_scc|, src_scc
+// W64: v_cmp_class_f64_e64 ttmp[14:15], -|src_scc|, src_scc ; encoding: [0x7a,0x01,0x7f,0xd4,0xfd,0xfa,0x01,0x20]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 vcc, 0.5, 0.5
+// W64: v_cmp_class_f64_e64 vcc, 0.5, 0.5       ; encoding: [0x6a,0x00,0x7f,0xd4,0xf0,0xe0,0x01,0x00]
+// W32-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 vcc_hi, 0.5, 0.5
+// W32: v_cmp_class_f64_e64 vcc_hi, 0.5, 0.5    ; encoding: [0x6b,0x00,0x7f,0xd4,0xf0,0xe0,0x01,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_class_f64_e64 vcc_lo, -1, -1
+// W32: v_cmp_class_f64_e64 vcc_lo, -1, -1      ; encoding: [0x6a,0x00,0x7f,0xd4,0xc1,0x82,0x01,0x00]
+// W64-ERR: :[[@LINE-2]]:21: error: invalid operand for instruction
+
+v_cmp_eq_f16_e64 null, -|0xfe0b|, -|vcc_hi| clamp
+// GFX11: v_cmp_eq_f16_e64 null, -|0xfe0b|, -|vcc_hi| clamp ; encoding: [0x7c,0x83,0x02,0xd4,0xff,0xd6,0x00,0x60,0x0b,0xfe,0x00,0x00]
+
+v_cmp_eq_f16_e64 s105, null, exec_lo
+// W32: v_cmp_eq_f16_e64 s105, null, exec_lo    ; encoding: [0x69,0x00,0x02,0xd4,0x7c,0xfc,0x00,0x00]
+// W64-ERR: :[[@LINE-2]]:18: error: invalid operand for instruction
+
+v_cmp_eq_f16_e64 s5, exec_lo, -1...
[truncated]

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.

Adding more reviewers to seek a wider consensus on sorting MC tests throughout.

I did a quick and dirty check with diff -u <(git show @~1:./$1 | grep '^v_' | sort) <(cat $1 | grep '^v_' | sort) to ensure we haven't lost any instructions, but maybe we would need something more reliable and sophisticated to also catch accidentally removed comments, commented-out/FIXME test cases, etc.

// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32,-real-true16 -show-encoding %s | FileCheck --check-prefixes=GFX11,W32 %s
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64,-real-true16 -show-encoding %s | FileCheck --check-prefixes=GFX11,W64 %s
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32,-real-true16 %s 2>&1 > /dev/null | FileCheck --check-prefix=W32-ERR --implicit-check-not=error: %s
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64,-real-true16 %s 2>&1 > /dev/null | FileCheck --check-prefix=W64-ERR --implicit-check-not=error: %s
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was previously advised to use -filetype=null instead of > /dev/null, so maybe do that here as well for consistency?

Also, it seems the preference is to use -comment-column=0 as we do in gfx12_asm_vop1.s to remove the extra spacing before ; encoding: ....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use -filetype=null instead of > /dev/null

Since we don't do sorting now, -comment-column=0 is better to be done in seperate patch since it modify whole file

@@ -0,0 +1,10487 @@
; NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --sort --version 5
Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably should restrain from using --sort until the script supports it.

Does the first line have to be a ; comment and not a // one?

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 can changed it to //, ; is for ll file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this change in #111769



Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it the script that leaves that extra line here?

@broxigarchen broxigarchen force-pushed the main-merge-true16-vopc-mc-test branch from 93f3855 to c2e0a53 Compare October 19, 2024 19:19
@broxigarchen
Copy link
Contributor Author

Sync with Joe and IVan offline, since the sorting might not work for dasm very well. For now, we just sort the "_t16_err.s" and "_t16_prmote.s" files and keep other files untouched.

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

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, but please remove double empty lines in err/promote files.

@broxigarchen broxigarchen force-pushed the main-merge-true16-vopc-mc-test branch from c2e0a53 to ad7c54a Compare October 28, 2024 13:35
@broxigarchen
Copy link
Contributor Author

LGTM, but please remove double empty lines in err/promote files.

done!

@broxigarchen broxigarchen force-pushed the main-merge-true16-vopc-mc-test branch from ad7c54a to 9197ab4 Compare October 28, 2024 14:12
@broxigarchen broxigarchen merged commit b27aceb into llvm:main Oct 28, 2024
8 checks passed
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
…#112829)

This is a non-functional change

update GFX11/GFX12 VOPC/VOPCX asm/dasm test for true16/fake16:

1. duplicate files to be true16/fake16 by adding
"-mattr=+real-true16/-mattr=-real-true16" while true16 test file will be
updated to true16 format when the true16 instructions are supported
2. sort "*t16_err.s" and "*t16_promote.s" tests to alphabetic order.
tests to alphabetic order. This is for the upcoming true16 mc changes,
and mainly trying to help repo maintainer to resolve conflicts in the
tests quickly. A script is proposed to help for the sorting
llvm#111769. Since these two files
are t16 only, it should not create conflicts in downstream branches
3. add `-filetype=null` to seperate stdout and stderr to avoid
disordered output from llvm-mc
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