144 lines · plain
1// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1030 -show-encoding %s | FileCheck --check-prefix=GFX10 %s2// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -show-encoding %s | FileCheck --check-prefix=GFX11 %s3// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1100 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX11-ERR %s4 5// On GFX11+, EXECZ and VCCZ are no longer allowed to be used as sources to SALU and VALU instructions.6// The inline constants are removed. VCCZ and EXECZ still exist and can be use for conditional branches.7// LDS_DIRECT and POPS_EXITING_WAVE_ID are also no longer allowed.8 9//---------------------------------------------------------------------------//10// EXECZ11//---------------------------------------------------------------------------//12 13s_cbranch_execz 0x10014// GFX10: encoding: [0x00,0x01,0x88,0xbf]15// GFX11: encoding: [0x00,0x01,0xa5,0xbf]16 17s_add_i32 s0, execz, s218// GFX10: encoding: [0xfc,0x02,0x00,0x81]19// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU20 21s_add_i32 s0, src_execz, s222// GFX10: encoding: [0xfc,0x02,0x00,0x81]23// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU24 25s_add_i32 s0, s1, execz26// GFX10: encoding: [0x01,0xfc,0x00,0x81]27// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU28 29s_add_i32 s0, s1, src_execz30// GFX10: encoding: [0x01,0xfc,0x00,0x81]31// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU32 33v_add_f64 v[0:1], execz, v[2:3]34// GFX10: encoding: [0x00,0x00,0x64,0xd5,0xfc,0x04,0x02,0x00]35// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU36 37v_add_f64 v[0:1], src_execz, v[2:3]38// GFX10: encoding: [0x00,0x00,0x64,0xd5,0xfc,0x04,0x02,0x00]39// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU40 41v_add_f64 v[0:1], v[1:2], execz42// GFX10: encoding: [0x00,0x00,0x64,0xd5,0x01,0xf9,0x01,0x00]43// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU44 45v_add_f64 v[0:1], v[1:2], src_execz46// GFX10: encoding: [0x00,0x00,0x64,0xd5,0x01,0xf9,0x01,0x00]47// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_execz register not available on this GPU48 49//---------------------------------------------------------------------------//50// VCCZ51//---------------------------------------------------------------------------//52 53s_cbranch_vccz 0x10054// GFX10: encoding: [0x00,0x01,0x86,0xbf]55// GFX11: encoding: [0x00,0x01,0xa3,0xbf]56 57s_add_i32 s0, vccz, s258// GFX10: encoding: [0xfb,0x02,0x00,0x81]59// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU60 61s_add_i32 s0, src_vccz, s262// GFX10: encoding: [0xfb,0x02,0x00,0x81]63// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU64 65s_add_i32 s0, s1, vccz66// GFX10: encoding: [0x01,0xfb,0x00,0x81]67// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU68 69s_add_i32 s0, s1, src_vccz70// GFX10: encoding: [0x01,0xfb,0x00,0x81]71// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU72 73v_add_f64 v[0:1], vccz, v[2:3]74// GFX10: encoding: [0x00,0x00,0x64,0xd5,0xfb,0x04,0x02,0x00]75// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU76 77v_add_f64 v[0:1], src_vccz, v[2:3]78// GFX10: encoding: [0x00,0x00,0x64,0xd5,0xfb,0x04,0x02,0x00]79// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU80 81v_add_f64 v[0:1], v[1:2], vccz82// GFX10: encoding: [0x00,0x00,0x64,0xd5,0x01,0xf7,0x01,0x00]83// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU84 85v_add_f64 v[0:1], v[1:2], src_vccz86// GFX10: encoding: [0x00,0x00,0x64,0xd5,0x01,0xf7,0x01,0x00]87// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_vccz register not available on this GPU88 89//---------------------------------------------------------------------------//90// LDS_DIRECT91//---------------------------------------------------------------------------//92 93v_readfirstlane_b32 s0, lds_direct94// GFX10: encoding: [0xfe,0x04,0x00,0x7e]95// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: lds_direct is not supported on this GPU96 97v_readfirstlane_b32 s0, src_lds_direct98// GFX10: encoding: [0xfe,0x04,0x00,0x7e]99// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: lds_direct is not supported on this GPU100 101v_mov_b32 v0, lds_direct102// GFX10: encoding: [0xfe,0x02,0x00,0x7e]103// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: lds_direct is not supported on this GPU104 105v_mov_b32 v0, src_lds_direct106// GFX10: encoding: [0xfe,0x02,0x00,0x7e]107// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: lds_direct is not supported on this GPU108 109//---------------------------------------------------------------------------//110// POPS_EXITING_WAVE_ID111//---------------------------------------------------------------------------//112 113s_add_i32 s0, src_pops_exiting_wave_id, s1114// GFX10: encoding: [0xef,0x01,0x00,0x81]115// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU116 117s_add_i32 s0, s1, src_pops_exiting_wave_id118// GFX10: encoding: [0x01,0xef,0x00,0x81]119// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU120 121s_add_i32 s0, pops_exiting_wave_id, s1122// GFX10: encoding: [0xef,0x01,0x00,0x81]123// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU124 125s_add_i32 s0, s1, pops_exiting_wave_id126// GFX10: encoding: [0x01,0xef,0x00,0x81]127// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU128 129v_add_co_u32 v0, s0, pops_exiting_wave_id, v1130// GFX10: encoding: [0x00,0x00,0x0f,0xd7,0xef,0x02,0x02,0x00]131// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU132 133v_add_co_u32 v0, s0, src_pops_exiting_wave_id, v1134// GFX10: encoding: [0x00,0x00,0x0f,0xd7,0xef,0x02,0x02,0x00]135// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU136 137v_add_co_u32 v0, s0, v1, pops_exiting_wave_id138// GFX10: encoding: [0x00,0x00,0x0f,0xd7,0x01,0xdf,0x01,0x00]139// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU140 141v_add_co_u32 v0, s0, v1, src_pops_exiting_wave_id142// GFX10: encoding: [0x00,0x00,0x0f,0xd7,0x01,0xdf,0x01,0x00]143// GFX11-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: src_pops_exiting_wave_id register not available on this GPU144