# NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 6
# RUN: llvm-mc -triple=amdgpu11.00 -disassemble -show-encoding < %s | FileCheck -check-prefix=W32 %s
# RUN: llvm-mc -triple=amdgpu11.00 -mattr=+wavefrontsize64 -disassemble -show-encoding < %s | FileCheck -check-prefix=W64 %s
# RUN: llvm-mc -triple=amdgpu11.00 -disassemble -filetype=null < %s 2>&1 | FileCheck -check-prefix=W32-ERR %s
# RUN: llvm-mc -triple=amdgpu11.00 -mattr=+wavefrontsize64 -disassemble -filetype=null < %s 2>&1 | FileCheck -check-prefix=W64-ERR %s

# This VOPD encoding is valid in wave32 mode but invalid in wave64 mode.
0xff,0x04,0x02,0xc9,0x03,0x03,0x06,0x05,0x56,0x34,0x12,0xaf
# W32: v_dual_add_f32 v5, 0xaf123456, v2 :: v_dual_fmaak_f32 v6, v3, v1, 0xaf123456 ; encoding: [0xff,0x04,0x02,0xc9,0x03,0x03,0x06,0x05,0x56,0x34,0x12,0xaf]
# W64: v_dot2acc_f32_f16 v131, v3, v1          ; encoding: [0x03,0x03,0x06,0x05]
# W64-ERR: :[[@LINE-3]]:1: warning: invalid instruction encoding

# v_swap_b16 with an SGPR source.
0x01,0xcc,0x0a,0x7f
# W32: v_swap_b16 v5.h, s1/*Invalid register, operand has 'VGPR_16_Lo128' register class*/ ; encoding: [0x01,0xcc,0x0a,0x7f]
# W64: v_swap_b16 v5.h, s1/*Invalid register, operand has 'VGPR_16_Lo128' register class*/ ; encoding: [0x01,0xcc,0x0a,0x7f]

# v_swap_b16 with an inline constant source.
0xf2,0xcc,0x0a,0x7f
# W32: v_swap_b16 v5.h, 1.0/*Invalid immediate*/ ; encoding: [0x00,0xcc,0x0a,0x7f]
# W64: v_swap_b16 v5.h, 1.0/*Invalid immediate*/ ; encoding: [0x00,0xcc,0x0a,0x7f]

# v_swap_b16 with a literal constant source.
0xff,0xcc,0x0a,0x7f,0x12,0x34,0x56,0x78
# W32: v_swap_b16 v5.h, 0x78563412/*Invalid immediate*/ ; encoding: [0x12,0xcc,0x0a,0x7f]
# W64: v_swap_b16 v5.h, 0x78563412/*Invalid immediate*/ ; encoding: [0x12,0xcc,0x0a,0x7f]

0x10,0x40,0x40,0xcc,0x00,0x11,0x42,0x1c
# W32: v_wmma_f32_16x16x16_f16 v[16:23], v[0:7], v[8:15], v[16:23] ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x11,0x42,0x1c]
# W64: v_wmma_f32_16x16x16_f16 v[16:19], v[0:7], v[8:15], v[16:19] ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x11,0x42,0x1c]

0x10,0x40,0x40,0xcc,0xf2,0x10,0x42,0x1c # src0 1.0
# W32: v_wmma_f32_16x16x16_f16 v[16:23], 1.0/*Invalid immediate*/, v[8:15], v[16:23] ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x10,0x42,0x1c]
# W64: v_wmma_f32_16x16x16_f16 v[16:19], 1.0/*Invalid immediate*/, v[8:15], v[16:19] ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x10,0x42,0x1c]

0x10,0x40,0x40,0xcc,0x00,0x10,0x42,0x1c # src0 sgpr0
# W32: v_wmma_f32_16x16x16_f16 v[16:23], s[0:7]/*Invalid register, operand has 'VReg_256' register class*/, v[8:15], v[16:23] ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x10,0x42,0x1c]
# W64: v_wmma_f32_16x16x16_f16 v[16:19], s[0:7]/*Invalid register, operand has 'VReg_256' register class*/, v[8:15], v[16:19] ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x10,0x42,0x1c]

0x10,0x40,0x40,0xcc,0x00,0x11,0xca,0x1b # src2 1.0
# W32: v_wmma_f32_16x16x16_f16 v[16:23], v[0:7], v[8:15], 1.0 ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x11,0xca,0x1b]
# W64: v_wmma_f32_16x16x16_f16 v[16:19], v[0:7], v[8:15], 1.0 ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x11,0xca,0x1b]

0x10,0x40,0x40,0xcc,0x00,0x11,0x02,0x18 # src2 sgpr0
# W32: v_wmma_f32_16x16x16_f16 v[16:23], v[0:7], v[8:15], s[0:7]/*Invalid register, operand has 'VReg_256' register class*/ ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x11,0x02,0x18]
# W64: v_wmma_f32_16x16x16_f16 v[16:19], v[0:7], v[8:15], s[0:3]/*Invalid register, operand has 'VReg_128' register class*/ ; encoding: [0x10,0x40,0x40,0xcc,0x00,0x11,0x02,0x18]

0xdf,0x00,0x00,0x02
# W32-ERR: :[[@LINE-1]]:1: warning: invalid instruction encoding
# W64-ERR: :[[@LINE-2]]:1: warning: invalid instruction encoding

0x34,0x12,0x7f,0xbc
# W32: s_waitcnt_vscnt exec_hi, 0x1234         ; encoding: [0x34,0x12,0x7f,0xbc]
# W64: s_waitcnt_vscnt exec_hi, 0x1234         ; encoding: [0x34,0x12,0x7f,0xbc]

0x06,0x00,0x46,0xe4,0x01,0x10,0x80,0x00,0x05,0x06,0x07,0x00
# W32-ERR: :[[@LINE-1]]:1: warning: invalid instruction encoding
# W64-ERR: :[[@LINE-2]]:1: warning: invalid instruction encoding

0x00,0x00,0x6d,0xd8,0x01,0x00,0x00,0x00
# W32-ERR: :[[@LINE-1]]:1: warning: invalid instruction encoding
# W64-ERR: :[[@LINE-2]]:1: warning: invalid instruction encoding
