2552 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx1010 -mattr=-flat-for-global -mattr=-flat-for-global -show-mc-encoding < %s | FileCheck -check-prefix=GFX10 %s3; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx1100 -mattr=+real-true16 -mattr=-flat-for-global -mattr=-flat-for-global -show-mc-encoding < %s | FileCheck -check-prefixes=GFX11,GFX11-TRUE16 %s4; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx1100 -mattr=-real-true16 -mattr=-flat-for-global -mattr=-flat-for-global -show-mc-encoding < %s | FileCheck -check-prefixes=GFX11,GFX11-FAKE16 %s5; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=tonga -mattr=-flat-for-global -mattr=-flat-for-global -show-mc-encoding < %s | FileCheck -check-prefix=VI %s6; RUN: llc -mtriple=amdgcn -mcpu=tahiti < %s | FileCheck -check-prefix=SI %s7 8; FIXME: Merge into imm.ll9 10define amdgpu_kernel void @store_inline_imm_neg_0.0_i16(ptr addrspace(1) %out) {11; GFX10-LABEL: store_inline_imm_neg_0.0_i16:12; GFX10: ; %bb.0:13; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]14; GFX10-NEXT: v_mov_b32_e32 v0, 0xffff8000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x80,0xff,0xff]15; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]16; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]17; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]18; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]19; GFX10-NEXT: s_waitcnt_vscnt null, 0x0 ; encoding: [0x00,0x00,0xfd,0xbb]20; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]21;22; GFX11-TRUE16-LABEL: store_inline_imm_neg_0.0_i16:23; GFX11-TRUE16: ; %bb.0:24; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]25; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x8000 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0x80,0xff,0xff]26; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]27; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]28; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]29; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 dlc ; encoding: [0x00,0x20,0x64,0xe0,0x00,0x00,0x00,0x80]30; GFX11-TRUE16-NEXT: s_waitcnt_vscnt null, 0x0 ; encoding: [0x00,0x00,0x7c,0xbc]31; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]32;33; GFX11-FAKE16-LABEL: store_inline_imm_neg_0.0_i16:34; GFX11-FAKE16: ; %bb.0:35; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]36; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0xffff8000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x80,0xff,0xff]37; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]38; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]39; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]40; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 dlc ; encoding: [0x00,0x20,0x64,0xe0,0x00,0x00,0x00,0x80]41; GFX11-FAKE16-NEXT: s_waitcnt_vscnt null, 0x0 ; encoding: [0x00,0x00,0x7c,0xbc]42; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]43;44; VI-LABEL: store_inline_imm_neg_0.0_i16:45; VI: ; %bb.0:46; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]47; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]48; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]49; VI-NEXT: v_mov_b32_e32 v0, 0xffff8000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x80,0xff,0xff]50; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]51; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]52; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]53; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]54;55; SI-LABEL: store_inline_imm_neg_0.0_i16:56; SI: ; %bb.0:57; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x958; SI-NEXT: s_mov_b32 s3, 0xf00059; SI-NEXT: s_mov_b32 s2, -160; SI-NEXT: v_mov_b32_e32 v0, 0x800061; SI-NEXT: s_waitcnt lgkmcnt(0)62; SI-NEXT: buffer_store_short v0, off, s[0:3], 063; SI-NEXT: s_waitcnt vmcnt(0)64; SI-NEXT: s_endpgm65 store volatile i16 -32768, ptr addrspace(1) %out66 ret void67}68 69define amdgpu_kernel void @store_inline_imm_0.0_f16(ptr addrspace(1) %out) {70; GFX10-LABEL: store_inline_imm_0.0_f16:71; GFX10: ; %bb.0:72; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]73; GFX10-NEXT: v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]74; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]75; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]76; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]77; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]78; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]79;80; GFX11-TRUE16-LABEL: store_inline_imm_0.0_f16:81; GFX11-TRUE16: ; %bb.0:82; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]83; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0 ; encoding: [0x80,0x38,0x00,0x7e]84; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]85; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]86; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]87; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]88; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]89;90; GFX11-FAKE16-LABEL: store_inline_imm_0.0_f16:91; GFX11-FAKE16: ; %bb.0:92; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]93; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]94; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]95; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]96; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]97; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]98; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]99;100; VI-LABEL: store_inline_imm_0.0_f16:101; VI: ; %bb.0:102; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]103; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]104; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]105; VI-NEXT: v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]106; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]107; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]108; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]109;110; SI-LABEL: store_inline_imm_0.0_f16:111; SI: ; %bb.0:112; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9113; SI-NEXT: s_mov_b32 s3, 0xf000114; SI-NEXT: s_mov_b32 s2, -1115; SI-NEXT: v_mov_b32_e32 v0, 0116; SI-NEXT: s_waitcnt lgkmcnt(0)117; SI-NEXT: buffer_store_short v0, off, s[0:3], 0118; SI-NEXT: s_endpgm119 store half 0.0, ptr addrspace(1) %out120 ret void121}122 123define amdgpu_kernel void @store_imm_neg_0.0_f16(ptr addrspace(1) %out) {124; GFX10-LABEL: store_imm_neg_0.0_f16:125; GFX10: ; %bb.0:126; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]127; GFX10-NEXT: v_mov_b32_e32 v0, 0xffff8000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x80,0xff,0xff]128; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]129; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]130; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]131; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]132; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]133;134; GFX11-TRUE16-LABEL: store_imm_neg_0.0_f16:135; GFX11-TRUE16: ; %bb.0:136; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]137; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x8000 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0x80,0xff,0xff]138; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]139; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]140; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]141; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]142; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]143;144; GFX11-FAKE16-LABEL: store_imm_neg_0.0_f16:145; GFX11-FAKE16: ; %bb.0:146; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]147; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0xffff8000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x80,0xff,0xff]148; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]149; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]150; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]151; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]152; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]153;154; VI-LABEL: store_imm_neg_0.0_f16:155; VI: ; %bb.0:156; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]157; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]158; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]159; VI-NEXT: v_mov_b32_e32 v0, 0xffff8000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x80,0xff,0xff]160; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]161; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]162; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]163;164; SI-LABEL: store_imm_neg_0.0_f16:165; SI: ; %bb.0:166; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9167; SI-NEXT: s_mov_b32 s3, 0xf000168; SI-NEXT: s_mov_b32 s2, -1169; SI-NEXT: v_mov_b32_e32 v0, 0x8000170; SI-NEXT: s_waitcnt lgkmcnt(0)171; SI-NEXT: buffer_store_short v0, off, s[0:3], 0172; SI-NEXT: s_endpgm173 store half -0.0, ptr addrspace(1) %out174 ret void175}176 177define amdgpu_kernel void @store_inline_imm_0.5_f16(ptr addrspace(1) %out) {178; GFX10-LABEL: store_inline_imm_0.5_f16:179; GFX10: ; %bb.0:180; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]181; GFX10-NEXT: v_mov_b32_e32 v0, 0x3800 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x38,0x00,0x00]182; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]183; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]184; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]185; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]186; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]187;188; GFX11-TRUE16-LABEL: store_inline_imm_0.5_f16:189; GFX11-TRUE16: ; %bb.0:190; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]191; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x3800 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0x38,0x00,0x00]192; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]193; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]194; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]195; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]196; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]197;198; GFX11-FAKE16-LABEL: store_inline_imm_0.5_f16:199; GFX11-FAKE16: ; %bb.0:200; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]201; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0x3800 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x38,0x00,0x00]202; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]203; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]204; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]205; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]206; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]207;208; VI-LABEL: store_inline_imm_0.5_f16:209; VI: ; %bb.0:210; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]211; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]212; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]213; VI-NEXT: v_mov_b32_e32 v0, 0x3800 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x38,0x00,0x00]214; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]215; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]216; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]217;218; SI-LABEL: store_inline_imm_0.5_f16:219; SI: ; %bb.0:220; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9221; SI-NEXT: s_mov_b32 s3, 0xf000222; SI-NEXT: s_mov_b32 s2, -1223; SI-NEXT: v_mov_b32_e32 v0, 0x3800224; SI-NEXT: s_waitcnt lgkmcnt(0)225; SI-NEXT: buffer_store_short v0, off, s[0:3], 0226; SI-NEXT: s_endpgm227 store half 0.5, ptr addrspace(1) %out228 ret void229}230 231define amdgpu_kernel void @store_inline_imm_m_0.5_f16(ptr addrspace(1) %out) {232; GFX10-LABEL: store_inline_imm_m_0.5_f16:233; GFX10: ; %bb.0:234; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]235; GFX10-NEXT: v_mov_b32_e32 v0, 0xffffb800 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xb8,0xff,0xff]236; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]237; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]238; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]239; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]240; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]241;242; GFX11-TRUE16-LABEL: store_inline_imm_m_0.5_f16:243; GFX11-TRUE16: ; %bb.0:244; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]245; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0xb800 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0xb8,0xff,0xff]246; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]247; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]248; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]249; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]250; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]251;252; GFX11-FAKE16-LABEL: store_inline_imm_m_0.5_f16:253; GFX11-FAKE16: ; %bb.0:254; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]255; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0xffffb800 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xb8,0xff,0xff]256; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]257; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]258; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]259; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]260; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]261;262; VI-LABEL: store_inline_imm_m_0.5_f16:263; VI: ; %bb.0:264; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]265; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]266; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]267; VI-NEXT: v_mov_b32_e32 v0, 0xffffb800 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xb8,0xff,0xff]268; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]269; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]270; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]271;272; SI-LABEL: store_inline_imm_m_0.5_f16:273; SI: ; %bb.0:274; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9275; SI-NEXT: s_mov_b32 s3, 0xf000276; SI-NEXT: s_mov_b32 s2, -1277; SI-NEXT: v_mov_b32_e32 v0, 0xb800278; SI-NEXT: s_waitcnt lgkmcnt(0)279; SI-NEXT: buffer_store_short v0, off, s[0:3], 0280; SI-NEXT: s_endpgm281 store half -0.5, ptr addrspace(1) %out282 ret void283}284 285define amdgpu_kernel void @store_inline_imm_1.0_f16(ptr addrspace(1) %out) {286; GFX10-LABEL: store_inline_imm_1.0_f16:287; GFX10: ; %bb.0:288; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]289; GFX10-NEXT: v_mov_b32_e32 v0, 0x3c00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x3c,0x00,0x00]290; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]291; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]292; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]293; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]294; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]295;296; GFX11-TRUE16-LABEL: store_inline_imm_1.0_f16:297; GFX11-TRUE16: ; %bb.0:298; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]299; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x3c00 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0x3c,0x00,0x00]300; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]301; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]302; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]303; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]304; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]305;306; GFX11-FAKE16-LABEL: store_inline_imm_1.0_f16:307; GFX11-FAKE16: ; %bb.0:308; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]309; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0x3c00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x3c,0x00,0x00]310; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]311; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]312; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]313; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]314; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]315;316; VI-LABEL: store_inline_imm_1.0_f16:317; VI: ; %bb.0:318; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]319; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]320; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]321; VI-NEXT: v_mov_b32_e32 v0, 0x3c00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x3c,0x00,0x00]322; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]323; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]324; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]325;326; SI-LABEL: store_inline_imm_1.0_f16:327; SI: ; %bb.0:328; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9329; SI-NEXT: s_mov_b32 s3, 0xf000330; SI-NEXT: s_mov_b32 s2, -1331; SI-NEXT: v_mov_b32_e32 v0, 0x3c00332; SI-NEXT: s_waitcnt lgkmcnt(0)333; SI-NEXT: buffer_store_short v0, off, s[0:3], 0334; SI-NEXT: s_endpgm335 store half 1.0, ptr addrspace(1) %out336 ret void337}338 339define amdgpu_kernel void @store_inline_imm_m_1.0_f16(ptr addrspace(1) %out) {340; GFX10-LABEL: store_inline_imm_m_1.0_f16:341; GFX10: ; %bb.0:342; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]343; GFX10-NEXT: v_mov_b32_e32 v0, 0xffffbc00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xbc,0xff,0xff]344; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]345; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]346; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]347; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]348; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]349;350; GFX11-TRUE16-LABEL: store_inline_imm_m_1.0_f16:351; GFX11-TRUE16: ; %bb.0:352; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]353; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0xbc00 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0xbc,0xff,0xff]354; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]355; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]356; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]357; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]358; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]359;360; GFX11-FAKE16-LABEL: store_inline_imm_m_1.0_f16:361; GFX11-FAKE16: ; %bb.0:362; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]363; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0xffffbc00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xbc,0xff,0xff]364; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]365; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]366; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]367; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]368; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]369;370; VI-LABEL: store_inline_imm_m_1.0_f16:371; VI: ; %bb.0:372; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]373; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]374; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]375; VI-NEXT: v_mov_b32_e32 v0, 0xffffbc00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xbc,0xff,0xff]376; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]377; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]378; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]379;380; SI-LABEL: store_inline_imm_m_1.0_f16:381; SI: ; %bb.0:382; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9383; SI-NEXT: s_mov_b32 s3, 0xf000384; SI-NEXT: s_mov_b32 s2, -1385; SI-NEXT: v_mov_b32_e32 v0, 0xbc00386; SI-NEXT: s_waitcnt lgkmcnt(0)387; SI-NEXT: buffer_store_short v0, off, s[0:3], 0388; SI-NEXT: s_endpgm389 store half -1.0, ptr addrspace(1) %out390 ret void391}392 393define amdgpu_kernel void @store_inline_imm_2.0_f16(ptr addrspace(1) %out) {394; GFX10-LABEL: store_inline_imm_2.0_f16:395; GFX10: ; %bb.0:396; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]397; GFX10-NEXT: v_mov_b32_e32 v0, 0x4000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x40,0x00,0x00]398; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]399; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]400; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]401; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]402; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]403;404; GFX11-TRUE16-LABEL: store_inline_imm_2.0_f16:405; GFX11-TRUE16: ; %bb.0:406; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]407; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x4000 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0x40,0x00,0x00]408; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]409; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]410; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]411; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]412; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]413;414; GFX11-FAKE16-LABEL: store_inline_imm_2.0_f16:415; GFX11-FAKE16: ; %bb.0:416; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]417; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0x4000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x40,0x00,0x00]418; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]419; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]420; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]421; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]422; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]423;424; VI-LABEL: store_inline_imm_2.0_f16:425; VI: ; %bb.0:426; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]427; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]428; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]429; VI-NEXT: v_mov_b32_e32 v0, 0x4000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x40,0x00,0x00]430; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]431; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]432; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]433;434; SI-LABEL: store_inline_imm_2.0_f16:435; SI: ; %bb.0:436; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9437; SI-NEXT: s_mov_b32 s3, 0xf000438; SI-NEXT: s_mov_b32 s2, -1439; SI-NEXT: v_mov_b32_e32 v0, 0x4000440; SI-NEXT: s_waitcnt lgkmcnt(0)441; SI-NEXT: buffer_store_short v0, off, s[0:3], 0442; SI-NEXT: s_endpgm443 store half 2.0, ptr addrspace(1) %out444 ret void445}446 447define amdgpu_kernel void @store_inline_imm_m_2.0_f16(ptr addrspace(1) %out) {448; GFX10-LABEL: store_inline_imm_m_2.0_f16:449; GFX10: ; %bb.0:450; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]451; GFX10-NEXT: v_mov_b32_e32 v0, 0xffffc000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xc0,0xff,0xff]452; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]453; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]454; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]455; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]456; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]457;458; GFX11-TRUE16-LABEL: store_inline_imm_m_2.0_f16:459; GFX11-TRUE16: ; %bb.0:460; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]461; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0xc000 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0xc0,0xff,0xff]462; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]463; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]464; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]465; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]466; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]467;468; GFX11-FAKE16-LABEL: store_inline_imm_m_2.0_f16:469; GFX11-FAKE16: ; %bb.0:470; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]471; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0xffffc000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xc0,0xff,0xff]472; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]473; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]474; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]475; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]476; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]477;478; VI-LABEL: store_inline_imm_m_2.0_f16:479; VI: ; %bb.0:480; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]481; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]482; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]483; VI-NEXT: v_mov_b32_e32 v0, 0xffffc000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xc0,0xff,0xff]484; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]485; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]486; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]487;488; SI-LABEL: store_inline_imm_m_2.0_f16:489; SI: ; %bb.0:490; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9491; SI-NEXT: s_mov_b32 s3, 0xf000492; SI-NEXT: s_mov_b32 s2, -1493; SI-NEXT: v_mov_b32_e32 v0, 0xc000494; SI-NEXT: s_waitcnt lgkmcnt(0)495; SI-NEXT: buffer_store_short v0, off, s[0:3], 0496; SI-NEXT: s_endpgm497 store half -2.0, ptr addrspace(1) %out498 ret void499}500 501define amdgpu_kernel void @store_inline_imm_4.0_f16(ptr addrspace(1) %out) {502; GFX10-LABEL: store_inline_imm_4.0_f16:503; GFX10: ; %bb.0:504; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]505; GFX10-NEXT: v_mov_b32_e32 v0, 0x4400 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x44,0x00,0x00]506; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]507; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]508; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]509; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]510; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]511;512; GFX11-TRUE16-LABEL: store_inline_imm_4.0_f16:513; GFX11-TRUE16: ; %bb.0:514; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]515; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x4400 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0x44,0x00,0x00]516; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]517; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]518; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]519; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]520; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]521;522; GFX11-FAKE16-LABEL: store_inline_imm_4.0_f16:523; GFX11-FAKE16: ; %bb.0:524; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]525; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0x4400 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x44,0x00,0x00]526; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]527; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]528; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]529; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]530; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]531;532; VI-LABEL: store_inline_imm_4.0_f16:533; VI: ; %bb.0:534; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]535; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]536; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]537; VI-NEXT: v_mov_b32_e32 v0, 0x4400 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x44,0x00,0x00]538; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]539; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]540; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]541;542; SI-LABEL: store_inline_imm_4.0_f16:543; SI: ; %bb.0:544; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9545; SI-NEXT: s_mov_b32 s3, 0xf000546; SI-NEXT: s_mov_b32 s2, -1547; SI-NEXT: v_mov_b32_e32 v0, 0x4400548; SI-NEXT: s_waitcnt lgkmcnt(0)549; SI-NEXT: buffer_store_short v0, off, s[0:3], 0550; SI-NEXT: s_endpgm551 store half 4.0, ptr addrspace(1) %out552 ret void553}554 555define amdgpu_kernel void @store_inline_imm_m_4.0_f16(ptr addrspace(1) %out) {556; GFX10-LABEL: store_inline_imm_m_4.0_f16:557; GFX10: ; %bb.0:558; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]559; GFX10-NEXT: v_mov_b32_e32 v0, 0xffffc400 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xc4,0xff,0xff]560; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]561; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]562; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]563; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]564; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]565;566; GFX11-TRUE16-LABEL: store_inline_imm_m_4.0_f16:567; GFX11-TRUE16: ; %bb.0:568; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]569; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0xc400 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0xc4,0xff,0xff]570; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]571; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]572; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]573; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]574; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]575;576; GFX11-FAKE16-LABEL: store_inline_imm_m_4.0_f16:577; GFX11-FAKE16: ; %bb.0:578; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]579; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0xffffc400 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xc4,0xff,0xff]580; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]581; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]582; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]583; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]584; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]585;586; VI-LABEL: store_inline_imm_m_4.0_f16:587; VI: ; %bb.0:588; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]589; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]590; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]591; VI-NEXT: v_mov_b32_e32 v0, 0xffffc400 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0xc4,0xff,0xff]592; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]593; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]594; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]595;596; SI-LABEL: store_inline_imm_m_4.0_f16:597; SI: ; %bb.0:598; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9599; SI-NEXT: s_mov_b32 s3, 0xf000600; SI-NEXT: s_mov_b32 s2, -1601; SI-NEXT: v_mov_b32_e32 v0, 0xc400602; SI-NEXT: s_waitcnt lgkmcnt(0)603; SI-NEXT: buffer_store_short v0, off, s[0:3], 0604; SI-NEXT: s_endpgm605 store half -4.0, ptr addrspace(1) %out606 ret void607}608 609define amdgpu_kernel void @store_inline_imm_inv_2pi_f16(ptr addrspace(1) %out) {610; GFX10-LABEL: store_inline_imm_inv_2pi_f16:611; GFX10: ; %bb.0:612; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]613; GFX10-NEXT: v_mov_b32_e32 v0, 0x3118 ; encoding: [0xff,0x02,0x00,0x7e,0x18,0x31,0x00,0x00]614; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]615; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]616; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]617; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]618; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]619;620; GFX11-TRUE16-LABEL: store_inline_imm_inv_2pi_f16:621; GFX11-TRUE16: ; %bb.0:622; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]623; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x3118 ; encoding: [0xff,0x38,0x00,0x7e,0x18,0x31,0x00,0x00]624; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]625; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]626; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]627; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]628; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]629;630; GFX11-FAKE16-LABEL: store_inline_imm_inv_2pi_f16:631; GFX11-FAKE16: ; %bb.0:632; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]633; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0x3118 ; encoding: [0xff,0x02,0x00,0x7e,0x18,0x31,0x00,0x00]634; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]635; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]636; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]637; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]638; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]639;640; VI-LABEL: store_inline_imm_inv_2pi_f16:641; VI: ; %bb.0:642; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]643; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]644; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]645; VI-NEXT: v_mov_b32_e32 v0, 0x3118 ; encoding: [0xff,0x02,0x00,0x7e,0x18,0x31,0x00,0x00]646; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]647; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]648; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]649;650; SI-LABEL: store_inline_imm_inv_2pi_f16:651; SI: ; %bb.0:652; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9653; SI-NEXT: s_mov_b32 s3, 0xf000654; SI-NEXT: s_mov_b32 s2, -1655; SI-NEXT: v_mov_b32_e32 v0, 0x3118656; SI-NEXT: s_waitcnt lgkmcnt(0)657; SI-NEXT: buffer_store_short v0, off, s[0:3], 0658; SI-NEXT: s_endpgm659 store half 0xH3118, ptr addrspace(1) %out660 ret void661}662 663define amdgpu_kernel void @store_inline_imm_m_inv_2pi_f16(ptr addrspace(1) %out) {664; GFX10-LABEL: store_inline_imm_m_inv_2pi_f16:665; GFX10: ; %bb.0:666; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]667; GFX10-NEXT: v_mov_b32_e32 v0, 0xffffb118 ; encoding: [0xff,0x02,0x00,0x7e,0x18,0xb1,0xff,0xff]668; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]669; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]670; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]671; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]672; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]673;674; GFX11-TRUE16-LABEL: store_inline_imm_m_inv_2pi_f16:675; GFX11-TRUE16: ; %bb.0:676; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]677; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0xb118 ; encoding: [0xff,0x38,0x00,0x7e,0x18,0xb1,0xff,0xff]678; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]679; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]680; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]681; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]682; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]683;684; GFX11-FAKE16-LABEL: store_inline_imm_m_inv_2pi_f16:685; GFX11-FAKE16: ; %bb.0:686; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]687; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0xffffb118 ; encoding: [0xff,0x02,0x00,0x7e,0x18,0xb1,0xff,0xff]688; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]689; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]690; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]691; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]692; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]693;694; VI-LABEL: store_inline_imm_m_inv_2pi_f16:695; VI: ; %bb.0:696; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]697; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]698; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]699; VI-NEXT: v_mov_b32_e32 v0, 0xffffb118 ; encoding: [0xff,0x02,0x00,0x7e,0x18,0xb1,0xff,0xff]700; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]701; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]702; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]703;704; SI-LABEL: store_inline_imm_m_inv_2pi_f16:705; SI: ; %bb.0:706; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9707; SI-NEXT: s_mov_b32 s3, 0xf000708; SI-NEXT: s_mov_b32 s2, -1709; SI-NEXT: v_mov_b32_e32 v0, 0xb118710; SI-NEXT: s_waitcnt lgkmcnt(0)711; SI-NEXT: buffer_store_short v0, off, s[0:3], 0712; SI-NEXT: s_endpgm713 store half 0xHB118, ptr addrspace(1) %out714 ret void715}716 717define amdgpu_kernel void @store_literal_imm_f16(ptr addrspace(1) %out) {718; GFX10-LABEL: store_literal_imm_f16:719; GFX10: ; %bb.0:720; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]721; GFX10-NEXT: v_mov_b32_e32 v0, 0x6c00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x6c,0x00,0x00]722; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]723; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]724; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]725; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]726; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]727;728; GFX11-TRUE16-LABEL: store_literal_imm_f16:729; GFX11-TRUE16: ; %bb.0:730; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]731; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, 0x6c00 ; encoding: [0xff,0x38,0x00,0x7e,0x00,0x6c,0x00,0x00]732; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]733; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]734; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]735; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]736; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]737;738; GFX11-FAKE16-LABEL: store_literal_imm_f16:739; GFX11-FAKE16: ; %bb.0:740; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]741; GFX11-FAKE16-NEXT: v_mov_b32_e32 v0, 0x6c00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x6c,0x00,0x00]742; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]743; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]744; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]745; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]746; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]747;748; VI-LABEL: store_literal_imm_f16:749; VI: ; %bb.0:750; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]751; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]752; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]753; VI-NEXT: v_mov_b32_e32 v0, 0x6c00 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x6c,0x00,0x00]754; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]755; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]756; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]757;758; SI-LABEL: store_literal_imm_f16:759; SI: ; %bb.0:760; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9761; SI-NEXT: s_mov_b32 s3, 0xf000762; SI-NEXT: s_mov_b32 s2, -1763; SI-NEXT: v_mov_b32_e32 v0, 0x6c00764; SI-NEXT: s_waitcnt lgkmcnt(0)765; SI-NEXT: buffer_store_short v0, off, s[0:3], 0766; SI-NEXT: s_endpgm767 store half 4096.0, ptr addrspace(1) %out768 ret void769}770 771define amdgpu_kernel void @add_inline_imm_0.0_f16(ptr addrspace(1) %out, half %x) {772; GFX10-LABEL: add_inline_imm_0.0_f16:773; GFX10: ; %bb.0:774; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]775; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]776; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]777; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]778; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]779; GFX10-NEXT: v_add_f16_e64 v0, s2, 0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x00,0x01,0x00]780; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]781; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]782; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]783;784; GFX11-TRUE16-LABEL: add_inline_imm_0.0_f16:785; GFX11-TRUE16: ; %bb.0:786; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]787; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]788; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]789; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]790; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]791; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x00,0x01,0x00]792; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]793; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]794; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]795;796; GFX11-FAKE16-LABEL: add_inline_imm_0.0_f16:797; GFX11-FAKE16: ; %bb.0:798; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]799; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]800; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]801; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]802; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]803; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x00,0x01,0x00]804; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]805; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]806; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]807;808; VI-LABEL: add_inline_imm_0.0_f16:809; VI: ; %bb.0:810; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]811; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]812; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]813; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]814; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]815; VI-NEXT: v_add_f16_e64 v0, s4, 0 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0x00,0x01,0x00]816; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]817; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]818;819; SI-LABEL: add_inline_imm_0.0_f16:820; SI: ; %bb.0:821; SI-NEXT: s_load_dword s0, s[4:5], 0xb822; SI-NEXT: s_mov_b32 s3, 0xf000823; SI-NEXT: s_mov_b32 s2, -1824; SI-NEXT: s_waitcnt lgkmcnt(0)825; SI-NEXT: v_cvt_f32_f16_e32 v0, s0826; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9827; SI-NEXT: v_add_f32_e32 v0, 0, v0828; SI-NEXT: v_cvt_f16_f32_e32 v0, v0829; SI-NEXT: s_waitcnt lgkmcnt(0)830; SI-NEXT: buffer_store_short v0, off, s[0:3], 0831; SI-NEXT: s_endpgm832 %y = fadd half %x, 0.0833 store half %y, ptr addrspace(1) %out834 ret void835}836 837define amdgpu_kernel void @add_inline_imm_0.5_f16(ptr addrspace(1) %out, half %x) {838; GFX10-LABEL: add_inline_imm_0.5_f16:839; GFX10: ; %bb.0:840; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]841; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]842; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]843; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]844; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]845; GFX10-NEXT: v_add_f16_e64 v0, s2, 0.5 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe0,0x01,0x00]846; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]847; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]848; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]849;850; GFX11-TRUE16-LABEL: add_inline_imm_0.5_f16:851; GFX11-TRUE16: ; %bb.0:852; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]853; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]854; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]855; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]856; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]857; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 0.5 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe0,0x01,0x00]858; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]859; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]860; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]861;862; GFX11-FAKE16-LABEL: add_inline_imm_0.5_f16:863; GFX11-FAKE16: ; %bb.0:864; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]865; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]866; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]867; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]868; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]869; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 0.5 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe0,0x01,0x00]870; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]871; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]872; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]873;874; VI-LABEL: add_inline_imm_0.5_f16:875; VI: ; %bb.0:876; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]877; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]878; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]879; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]880; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]881; VI-NEXT: v_add_f16_e64 v0, s4, 0.5 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xe0,0x01,0x00]882; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]883; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]884;885; SI-LABEL: add_inline_imm_0.5_f16:886; SI: ; %bb.0:887; SI-NEXT: s_load_dword s0, s[4:5], 0xb888; SI-NEXT: s_mov_b32 s3, 0xf000889; SI-NEXT: s_mov_b32 s2, -1890; SI-NEXT: s_waitcnt lgkmcnt(0)891; SI-NEXT: v_cvt_f32_f16_e32 v0, s0892; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9893; SI-NEXT: v_add_f32_e32 v0, 0.5, v0894; SI-NEXT: v_cvt_f16_f32_e32 v0, v0895; SI-NEXT: s_waitcnt lgkmcnt(0)896; SI-NEXT: buffer_store_short v0, off, s[0:3], 0897; SI-NEXT: s_endpgm898 %y = fadd half %x, 0.5899 store half %y, ptr addrspace(1) %out900 ret void901}902 903define amdgpu_kernel void @add_inline_imm_neg_0.5_f16(ptr addrspace(1) %out, half %x) {904; GFX10-LABEL: add_inline_imm_neg_0.5_f16:905; GFX10: ; %bb.0:906; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]907; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]908; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]909; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]910; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]911; GFX10-NEXT: v_add_f16_e64 v0, s2, -0.5 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe2,0x01,0x00]912; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]913; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]914; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]915;916; GFX11-TRUE16-LABEL: add_inline_imm_neg_0.5_f16:917; GFX11-TRUE16: ; %bb.0:918; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]919; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]920; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]921; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]922; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]923; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, -0.5 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe2,0x01,0x00]924; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]925; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]926; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]927;928; GFX11-FAKE16-LABEL: add_inline_imm_neg_0.5_f16:929; GFX11-FAKE16: ; %bb.0:930; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]931; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]932; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]933; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]934; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]935; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, -0.5 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe2,0x01,0x00]936; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]937; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]938; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]939;940; VI-LABEL: add_inline_imm_neg_0.5_f16:941; VI: ; %bb.0:942; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]943; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]944; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]945; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]946; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]947; VI-NEXT: v_add_f16_e64 v0, s4, -0.5 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xe2,0x01,0x00]948; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]949; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]950;951; SI-LABEL: add_inline_imm_neg_0.5_f16:952; SI: ; %bb.0:953; SI-NEXT: s_load_dword s0, s[4:5], 0xb954; SI-NEXT: s_mov_b32 s3, 0xf000955; SI-NEXT: s_mov_b32 s2, -1956; SI-NEXT: s_waitcnt lgkmcnt(0)957; SI-NEXT: v_cvt_f32_f16_e32 v0, s0958; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9959; SI-NEXT: v_add_f32_e32 v0, -0.5, v0960; SI-NEXT: v_cvt_f16_f32_e32 v0, v0961; SI-NEXT: s_waitcnt lgkmcnt(0)962; SI-NEXT: buffer_store_short v0, off, s[0:3], 0963; SI-NEXT: s_endpgm964 %y = fadd half %x, -0.5965 store half %y, ptr addrspace(1) %out966 ret void967}968 969define amdgpu_kernel void @add_inline_imm_1.0_f16(ptr addrspace(1) %out, half %x) {970; GFX10-LABEL: add_inline_imm_1.0_f16:971; GFX10: ; %bb.0:972; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]973; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]974; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]975; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]976; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]977; GFX10-NEXT: v_add_f16_e64 v0, s2, 1.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe4,0x01,0x00]978; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]979; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]980; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]981;982; GFX11-TRUE16-LABEL: add_inline_imm_1.0_f16:983; GFX11-TRUE16: ; %bb.0:984; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]985; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]986; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]987; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]988; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]989; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 1.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe4,0x01,0x00]990; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]991; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]992; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]993;994; GFX11-FAKE16-LABEL: add_inline_imm_1.0_f16:995; GFX11-FAKE16: ; %bb.0:996; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]997; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]998; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]999; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1000; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1001; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 1.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe4,0x01,0x00]1002; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1003; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1004; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1005;1006; VI-LABEL: add_inline_imm_1.0_f16:1007; VI: ; %bb.0:1008; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1009; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1010; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1011; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1012; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1013; VI-NEXT: v_add_f16_e64 v0, s4, 1.0 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xe4,0x01,0x00]1014; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1015; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1016;1017; SI-LABEL: add_inline_imm_1.0_f16:1018; SI: ; %bb.0:1019; SI-NEXT: s_load_dword s0, s[4:5], 0xb1020; SI-NEXT: s_mov_b32 s3, 0xf0001021; SI-NEXT: s_mov_b32 s2, -11022; SI-NEXT: s_waitcnt lgkmcnt(0)1023; SI-NEXT: v_cvt_f32_f16_e32 v0, s01024; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91025; SI-NEXT: v_add_f32_e32 v0, 1.0, v01026; SI-NEXT: v_cvt_f16_f32_e32 v0, v01027; SI-NEXT: s_waitcnt lgkmcnt(0)1028; SI-NEXT: buffer_store_short v0, off, s[0:3], 01029; SI-NEXT: s_endpgm1030 %y = fadd half %x, 1.01031 store half %y, ptr addrspace(1) %out1032 ret void1033}1034 1035define amdgpu_kernel void @add_inline_imm_neg_1.0_f16(ptr addrspace(1) %out, half %x) {1036; GFX10-LABEL: add_inline_imm_neg_1.0_f16:1037; GFX10: ; %bb.0:1038; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1039; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1040; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1041; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1042; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1043; GFX10-NEXT: v_add_f16_e64 v0, s2, -1.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe6,0x01,0x00]1044; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1045; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1046; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1047;1048; GFX11-TRUE16-LABEL: add_inline_imm_neg_1.0_f16:1049; GFX11-TRUE16: ; %bb.0:1050; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1051; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1052; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1053; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1054; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1055; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, -1.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe6,0x01,0x00]1056; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1057; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1058; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1059;1060; GFX11-FAKE16-LABEL: add_inline_imm_neg_1.0_f16:1061; GFX11-FAKE16: ; %bb.0:1062; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1063; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1064; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1065; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1066; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1067; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, -1.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe6,0x01,0x00]1068; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1069; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1070; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1071;1072; VI-LABEL: add_inline_imm_neg_1.0_f16:1073; VI: ; %bb.0:1074; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1075; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1076; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1077; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1078; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1079; VI-NEXT: v_add_f16_e64 v0, s4, -1.0 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xe6,0x01,0x00]1080; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1081; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1082;1083; SI-LABEL: add_inline_imm_neg_1.0_f16:1084; SI: ; %bb.0:1085; SI-NEXT: s_load_dword s0, s[4:5], 0xb1086; SI-NEXT: s_mov_b32 s3, 0xf0001087; SI-NEXT: s_mov_b32 s2, -11088; SI-NEXT: s_waitcnt lgkmcnt(0)1089; SI-NEXT: v_cvt_f32_f16_e32 v0, s01090; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91091; SI-NEXT: v_add_f32_e32 v0, -1.0, v01092; SI-NEXT: v_cvt_f16_f32_e32 v0, v01093; SI-NEXT: s_waitcnt lgkmcnt(0)1094; SI-NEXT: buffer_store_short v0, off, s[0:3], 01095; SI-NEXT: s_endpgm1096 %y = fadd half %x, -1.01097 store half %y, ptr addrspace(1) %out1098 ret void1099}1100 1101define amdgpu_kernel void @add_inline_imm_2.0_f16(ptr addrspace(1) %out, half %x) {1102; GFX10-LABEL: add_inline_imm_2.0_f16:1103; GFX10: ; %bb.0:1104; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1105; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1106; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1107; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1108; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1109; GFX10-NEXT: v_add_f16_e64 v0, s2, 2.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe8,0x01,0x00]1110; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1111; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1112; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1113;1114; GFX11-TRUE16-LABEL: add_inline_imm_2.0_f16:1115; GFX11-TRUE16: ; %bb.0:1116; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1117; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1118; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1119; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1120; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1121; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 2.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe8,0x01,0x00]1122; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1123; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1124; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1125;1126; GFX11-FAKE16-LABEL: add_inline_imm_2.0_f16:1127; GFX11-FAKE16: ; %bb.0:1128; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1129; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1130; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1131; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1132; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1133; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 2.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xe8,0x01,0x00]1134; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1135; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1136; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1137;1138; VI-LABEL: add_inline_imm_2.0_f16:1139; VI: ; %bb.0:1140; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1141; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1142; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1143; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1144; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1145; VI-NEXT: v_add_f16_e64 v0, s4, 2.0 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xe8,0x01,0x00]1146; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1147; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1148;1149; SI-LABEL: add_inline_imm_2.0_f16:1150; SI: ; %bb.0:1151; SI-NEXT: s_load_dword s0, s[4:5], 0xb1152; SI-NEXT: s_mov_b32 s3, 0xf0001153; SI-NEXT: s_mov_b32 s2, -11154; SI-NEXT: s_waitcnt lgkmcnt(0)1155; SI-NEXT: v_cvt_f32_f16_e32 v0, s01156; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91157; SI-NEXT: v_add_f32_e32 v0, 2.0, v01158; SI-NEXT: v_cvt_f16_f32_e32 v0, v01159; SI-NEXT: s_waitcnt lgkmcnt(0)1160; SI-NEXT: buffer_store_short v0, off, s[0:3], 01161; SI-NEXT: s_endpgm1162 %y = fadd half %x, 2.01163 store half %y, ptr addrspace(1) %out1164 ret void1165}1166 1167define amdgpu_kernel void @add_inline_imm_neg_2.0_f16(ptr addrspace(1) %out, half %x) {1168; GFX10-LABEL: add_inline_imm_neg_2.0_f16:1169; GFX10: ; %bb.0:1170; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1171; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1172; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1173; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1174; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1175; GFX10-NEXT: v_add_f16_e64 v0, s2, -2.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xea,0x01,0x00]1176; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1177; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1178; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1179;1180; GFX11-TRUE16-LABEL: add_inline_imm_neg_2.0_f16:1181; GFX11-TRUE16: ; %bb.0:1182; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1183; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1184; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1185; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1186; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1187; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, -2.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xea,0x01,0x00]1188; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1189; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1190; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1191;1192; GFX11-FAKE16-LABEL: add_inline_imm_neg_2.0_f16:1193; GFX11-FAKE16: ; %bb.0:1194; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1195; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1196; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1197; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1198; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1199; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, -2.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xea,0x01,0x00]1200; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1201; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1202; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1203;1204; VI-LABEL: add_inline_imm_neg_2.0_f16:1205; VI: ; %bb.0:1206; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1207; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1208; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1209; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1210; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1211; VI-NEXT: v_add_f16_e64 v0, s4, -2.0 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xea,0x01,0x00]1212; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1213; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1214;1215; SI-LABEL: add_inline_imm_neg_2.0_f16:1216; SI: ; %bb.0:1217; SI-NEXT: s_load_dword s0, s[4:5], 0xb1218; SI-NEXT: s_mov_b32 s3, 0xf0001219; SI-NEXT: s_mov_b32 s2, -11220; SI-NEXT: s_waitcnt lgkmcnt(0)1221; SI-NEXT: v_cvt_f32_f16_e32 v0, s01222; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91223; SI-NEXT: v_add_f32_e32 v0, -2.0, v01224; SI-NEXT: v_cvt_f16_f32_e32 v0, v01225; SI-NEXT: s_waitcnt lgkmcnt(0)1226; SI-NEXT: buffer_store_short v0, off, s[0:3], 01227; SI-NEXT: s_endpgm1228 %y = fadd half %x, -2.01229 store half %y, ptr addrspace(1) %out1230 ret void1231}1232 1233define amdgpu_kernel void @add_inline_imm_4.0_f16(ptr addrspace(1) %out, half %x) {1234; GFX10-LABEL: add_inline_imm_4.0_f16:1235; GFX10: ; %bb.0:1236; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1237; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1238; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1239; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1240; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1241; GFX10-NEXT: v_add_f16_e64 v0, s2, 4.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xec,0x01,0x00]1242; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1243; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1244; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1245;1246; GFX11-TRUE16-LABEL: add_inline_imm_4.0_f16:1247; GFX11-TRUE16: ; %bb.0:1248; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1249; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1250; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1251; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1252; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1253; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 4.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xec,0x01,0x00]1254; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1255; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1256; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1257;1258; GFX11-FAKE16-LABEL: add_inline_imm_4.0_f16:1259; GFX11-FAKE16: ; %bb.0:1260; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1261; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1262; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1263; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1264; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1265; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 4.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xec,0x01,0x00]1266; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1267; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1268; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1269;1270; VI-LABEL: add_inline_imm_4.0_f16:1271; VI: ; %bb.0:1272; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1273; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1274; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1275; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1276; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1277; VI-NEXT: v_add_f16_e64 v0, s4, 4.0 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xec,0x01,0x00]1278; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1279; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1280;1281; SI-LABEL: add_inline_imm_4.0_f16:1282; SI: ; %bb.0:1283; SI-NEXT: s_load_dword s0, s[4:5], 0xb1284; SI-NEXT: s_mov_b32 s3, 0xf0001285; SI-NEXT: s_mov_b32 s2, -11286; SI-NEXT: s_waitcnt lgkmcnt(0)1287; SI-NEXT: v_cvt_f32_f16_e32 v0, s01288; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91289; SI-NEXT: v_add_f32_e32 v0, 4.0, v01290; SI-NEXT: v_cvt_f16_f32_e32 v0, v01291; SI-NEXT: s_waitcnt lgkmcnt(0)1292; SI-NEXT: buffer_store_short v0, off, s[0:3], 01293; SI-NEXT: s_endpgm1294 %y = fadd half %x, 4.01295 store half %y, ptr addrspace(1) %out1296 ret void1297}1298 1299define amdgpu_kernel void @add_inline_imm_neg_4.0_f16(ptr addrspace(1) %out, half %x) {1300; GFX10-LABEL: add_inline_imm_neg_4.0_f16:1301; GFX10: ; %bb.0:1302; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1303; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1304; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1305; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1306; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1307; GFX10-NEXT: v_add_f16_e64 v0, s2, -4.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xee,0x01,0x00]1308; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1309; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1310; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1311;1312; GFX11-TRUE16-LABEL: add_inline_imm_neg_4.0_f16:1313; GFX11-TRUE16: ; %bb.0:1314; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1315; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1316; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1317; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1318; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1319; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, -4.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xee,0x01,0x00]1320; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1321; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1322; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1323;1324; GFX11-FAKE16-LABEL: add_inline_imm_neg_4.0_f16:1325; GFX11-FAKE16: ; %bb.0:1326; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1327; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1328; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1329; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1330; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1331; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, -4.0 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0xee,0x01,0x00]1332; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1333; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1334; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1335;1336; VI-LABEL: add_inline_imm_neg_4.0_f16:1337; VI: ; %bb.0:1338; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1339; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1340; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1341; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1342; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1343; VI-NEXT: v_add_f16_e64 v0, s4, -4.0 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0xee,0x01,0x00]1344; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1345; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1346;1347; SI-LABEL: add_inline_imm_neg_4.0_f16:1348; SI: ; %bb.0:1349; SI-NEXT: s_load_dword s0, s[4:5], 0xb1350; SI-NEXT: s_mov_b32 s3, 0xf0001351; SI-NEXT: s_mov_b32 s2, -11352; SI-NEXT: s_waitcnt lgkmcnt(0)1353; SI-NEXT: v_cvt_f32_f16_e32 v0, s01354; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91355; SI-NEXT: v_add_f32_e32 v0, -4.0, v01356; SI-NEXT: v_cvt_f16_f32_e32 v0, v01357; SI-NEXT: s_waitcnt lgkmcnt(0)1358; SI-NEXT: buffer_store_short v0, off, s[0:3], 01359; SI-NEXT: s_endpgm1360 %y = fadd half %x, -4.01361 store half %y, ptr addrspace(1) %out1362 ret void1363}1364 1365define amdgpu_kernel void @commute_add_inline_imm_0.5_f16(ptr addrspace(1) %out, ptr addrspace(1) %in) {1366; GFX10-LABEL: commute_add_inline_imm_0.5_f16:1367; GFX10: ; %bb.0:1368; GFX10-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x08,0xf4,0x00,0x00,0x00,0xfa]1369; GFX10-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x03,0x86,0xbe]1370; GFX10-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x03,0x87,0xbe,0x00,0x60,0x01,0x31]1371; GFX10-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x03,0x8a,0xbe]1372; GFX10-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x03,0x8b,0xbe]1373; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1374; GFX10-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x03,0x88,0xbe]1375; GFX10-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x03,0x89,0xbe]1376; GFX10-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x03,0x84,0xbe]1377; GFX10-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x28,0xe0,0x00,0x00,0x02,0x80]1378; GFX10-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x03,0x85,0xbe]1379; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]1380; GFX10-NEXT: v_add_f16_e32 v0, 0.5, v0 ; encoding: [0xf0,0x00,0x00,0x64]1381; GFX10-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1382; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1383;1384; GFX11-TRUE16-LABEL: commute_add_inline_imm_0.5_f16:1385; GFX11-TRUE16: ; %bb.0:1386; GFX11-TRUE16-NEXT: s_load_b128 s[0:3], s[4:5], 0x0 ; encoding: [0x02,0x00,0x08,0xf4,0x00,0x00,0x00,0xf8]1387; GFX11-TRUE16-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1388; GFX11-TRUE16-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0x60,0x01,0x31]1389; GFX11-TRUE16-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1390; GFX11-TRUE16-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1391; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1392; GFX11-TRUE16-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1393; GFX11-TRUE16-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1394; GFX11-TRUE16-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1395; GFX11-TRUE16-NEXT: buffer_load_u16 v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1396; GFX11-TRUE16-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1397; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]1398; GFX11-TRUE16-NEXT: v_add_f16_e32 v0.l, 0.5, v0.l ; encoding: [0xf0,0x00,0x00,0x64]1399; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x01,0x80]1400; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1401;1402; GFX11-FAKE16-LABEL: commute_add_inline_imm_0.5_f16:1403; GFX11-FAKE16: ; %bb.0:1404; GFX11-FAKE16-NEXT: s_load_b128 s[0:3], s[4:5], 0x0 ; encoding: [0x02,0x00,0x08,0xf4,0x00,0x00,0x00,0xf8]1405; GFX11-FAKE16-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1406; GFX11-FAKE16-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0x60,0x01,0x31]1407; GFX11-FAKE16-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1408; GFX11-FAKE16-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1409; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1410; GFX11-FAKE16-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1411; GFX11-FAKE16-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1412; GFX11-FAKE16-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1413; GFX11-FAKE16-NEXT: buffer_load_u16 v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1414; GFX11-FAKE16-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1415; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]1416; GFX11-FAKE16-NEXT: v_add_f16_e32 v0, 0.5, v0 ; encoding: [0xf0,0x00,0x00,0x64]1417; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x01,0x80]1418; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1419;1420; VI-LABEL: commute_add_inline_imm_0.5_f16:1421; VI: ; %bb.0:1422; VI-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x0a,0xc0,0x00,0x00,0x00,0x00]1423; VI-NEXT: s_mov_b32 s7, 0x1100f000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0xf0,0x00,0x11]1424; VI-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1425; VI-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1426; VI-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1427; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1428; VI-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1429; VI-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1430; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1431; VI-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1432; VI-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1433; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]1434; VI-NEXT: v_add_f16_e32 v0, 0.5, v0 ; encoding: [0xf0,0x00,0x00,0x3e]1435; VI-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1436; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1437;1438; SI-LABEL: commute_add_inline_imm_0.5_f16:1439; SI: ; %bb.0:1440; SI-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x91441; SI-NEXT: s_mov_b32 s7, 0xf0001442; SI-NEXT: s_mov_b32 s6, -11443; SI-NEXT: s_mov_b32 s10, s61444; SI-NEXT: s_mov_b32 s11, s71445; SI-NEXT: s_waitcnt lgkmcnt(0)1446; SI-NEXT: s_mov_b32 s8, s21447; SI-NEXT: s_mov_b32 s9, s31448; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 01449; SI-NEXT: s_mov_b32 s4, s01450; SI-NEXT: s_mov_b32 s5, s11451; SI-NEXT: s_waitcnt vmcnt(0)1452; SI-NEXT: v_cvt_f32_f16_e32 v0, v01453; SI-NEXT: v_add_f32_e32 v0, 0.5, v01454; SI-NEXT: v_cvt_f16_f32_e32 v0, v01455; SI-NEXT: buffer_store_short v0, off, s[4:7], 01456; SI-NEXT: s_endpgm1457 %x = load half, ptr addrspace(1) %in1458 %y = fadd half %x, 0.51459 store half %y, ptr addrspace(1) %out1460 ret void1461}1462 1463define amdgpu_kernel void @commute_add_literal_f16(ptr addrspace(1) %out, ptr addrspace(1) %in) {1464; GFX10-LABEL: commute_add_literal_f16:1465; GFX10: ; %bb.0:1466; GFX10-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x08,0xf4,0x00,0x00,0x00,0xfa]1467; GFX10-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x03,0x86,0xbe]1468; GFX10-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x03,0x87,0xbe,0x00,0x60,0x01,0x31]1469; GFX10-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x03,0x8a,0xbe]1470; GFX10-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x03,0x8b,0xbe]1471; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1472; GFX10-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x03,0x88,0xbe]1473; GFX10-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x03,0x89,0xbe]1474; GFX10-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x03,0x84,0xbe]1475; GFX10-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x28,0xe0,0x00,0x00,0x02,0x80]1476; GFX10-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x03,0x85,0xbe]1477; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]1478; GFX10-NEXT: v_add_f16_e32 v0, 0x6400, v0 ; encoding: [0xff,0x00,0x00,0x64,0x00,0x64,0x00,0x00]1479; GFX10-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1480; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1481;1482; GFX11-TRUE16-LABEL: commute_add_literal_f16:1483; GFX11-TRUE16: ; %bb.0:1484; GFX11-TRUE16-NEXT: s_load_b128 s[0:3], s[4:5], 0x0 ; encoding: [0x02,0x00,0x08,0xf4,0x00,0x00,0x00,0xf8]1485; GFX11-TRUE16-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1486; GFX11-TRUE16-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0x60,0x01,0x31]1487; GFX11-TRUE16-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1488; GFX11-TRUE16-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1489; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1490; GFX11-TRUE16-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1491; GFX11-TRUE16-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1492; GFX11-TRUE16-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1493; GFX11-TRUE16-NEXT: buffer_load_u16 v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1494; GFX11-TRUE16-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1495; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]1496; GFX11-TRUE16-NEXT: v_add_f16_e32 v0.l, 0x6400, v0.l ; encoding: [0xff,0x00,0x00,0x64,0x00,0x64,0x00,0x00]1497; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x01,0x80]1498; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1499;1500; GFX11-FAKE16-LABEL: commute_add_literal_f16:1501; GFX11-FAKE16: ; %bb.0:1502; GFX11-FAKE16-NEXT: s_load_b128 s[0:3], s[4:5], 0x0 ; encoding: [0x02,0x00,0x08,0xf4,0x00,0x00,0x00,0xf8]1503; GFX11-FAKE16-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1504; GFX11-FAKE16-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0x60,0x01,0x31]1505; GFX11-FAKE16-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1506; GFX11-FAKE16-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1507; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1508; GFX11-FAKE16-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1509; GFX11-FAKE16-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1510; GFX11-FAKE16-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1511; GFX11-FAKE16-NEXT: buffer_load_u16 v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1512; GFX11-FAKE16-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1513; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]1514; GFX11-FAKE16-NEXT: v_add_f16_e32 v0, 0x6400, v0 ; encoding: [0xff,0x00,0x00,0x64,0x00,0x64,0x00,0x00]1515; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x01,0x80]1516; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1517;1518; VI-LABEL: commute_add_literal_f16:1519; VI: ; %bb.0:1520; VI-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x0a,0xc0,0x00,0x00,0x00,0x00]1521; VI-NEXT: s_mov_b32 s7, 0x1100f000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0xf0,0x00,0x11]1522; VI-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1523; VI-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1524; VI-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1525; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1526; VI-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1527; VI-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1528; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1529; VI-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1530; VI-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1531; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]1532; VI-NEXT: v_add_f16_e32 v0, 0x6400, v0 ; encoding: [0xff,0x00,0x00,0x3e,0x00,0x64,0x00,0x00]1533; VI-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1534; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1535;1536; SI-LABEL: commute_add_literal_f16:1537; SI: ; %bb.0:1538; SI-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x91539; SI-NEXT: s_mov_b32 s7, 0xf0001540; SI-NEXT: s_mov_b32 s6, -11541; SI-NEXT: s_mov_b32 s10, s61542; SI-NEXT: s_mov_b32 s11, s71543; SI-NEXT: s_waitcnt lgkmcnt(0)1544; SI-NEXT: s_mov_b32 s8, s21545; SI-NEXT: s_mov_b32 s9, s31546; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 01547; SI-NEXT: s_mov_b32 s4, s01548; SI-NEXT: s_mov_b32 s5, s11549; SI-NEXT: s_waitcnt vmcnt(0)1550; SI-NEXT: v_cvt_f32_f16_e32 v0, v01551; SI-NEXT: v_add_f32_e32 v0, 0x44800000, v01552; SI-NEXT: v_cvt_f16_f32_e32 v0, v01553; SI-NEXT: buffer_store_short v0, off, s[4:7], 01554; SI-NEXT: s_endpgm1555 %x = load half, ptr addrspace(1) %in1556 %y = fadd half %x, 1024.01557 store half %y, ptr addrspace(1) %out1558 ret void1559}1560 1561define amdgpu_kernel void @add_inline_imm_1_f16(ptr addrspace(1) %out, half %x) {1562; GFX10-LABEL: add_inline_imm_1_f16:1563; GFX10: ; %bb.0:1564; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1565; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1566; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1567; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1568; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1569; GFX10-NEXT: v_add_f16_e64 v0, s2, 1 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x02,0x01,0x00]1570; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1571; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1572; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1573;1574; GFX11-TRUE16-LABEL: add_inline_imm_1_f16:1575; GFX11-TRUE16: ; %bb.0:1576; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1577; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1578; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1579; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1580; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1581; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 1 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x02,0x01,0x00]1582; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1583; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1584; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1585;1586; GFX11-FAKE16-LABEL: add_inline_imm_1_f16:1587; GFX11-FAKE16: ; %bb.0:1588; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1589; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1590; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1591; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1592; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1593; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 1 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x02,0x01,0x00]1594; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1595; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1596; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1597;1598; VI-LABEL: add_inline_imm_1_f16:1599; VI: ; %bb.0:1600; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1601; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1602; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1603; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1604; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1605; VI-NEXT: v_add_f16_e64 v0, s4, 1 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0x02,0x01,0x00]1606; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1607; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1608;1609; SI-LABEL: add_inline_imm_1_f16:1610; SI: ; %bb.0:1611; SI-NEXT: s_load_dword s0, s[4:5], 0xb1612; SI-NEXT: s_mov_b32 s3, 0xf0001613; SI-NEXT: s_mov_b32 s2, -11614; SI-NEXT: s_waitcnt lgkmcnt(0)1615; SI-NEXT: v_cvt_f32_f16_e32 v0, s01616; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91617; SI-NEXT: v_add_f32_e32 v0, 0x33800000, v01618; SI-NEXT: v_cvt_f16_f32_e32 v0, v01619; SI-NEXT: s_waitcnt lgkmcnt(0)1620; SI-NEXT: buffer_store_short v0, off, s[0:3], 01621; SI-NEXT: s_endpgm1622 %y = fadd half %x, 0xH00011623 store half %y, ptr addrspace(1) %out1624 ret void1625}1626 1627define amdgpu_kernel void @add_inline_imm_2_f16(ptr addrspace(1) %out, half %x) {1628; GFX10-LABEL: add_inline_imm_2_f16:1629; GFX10: ; %bb.0:1630; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1631; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1632; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1633; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1634; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1635; GFX10-NEXT: v_add_f16_e64 v0, s2, 2 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x04,0x01,0x00]1636; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1637; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1638; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1639;1640; GFX11-TRUE16-LABEL: add_inline_imm_2_f16:1641; GFX11-TRUE16: ; %bb.0:1642; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1643; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1644; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1645; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1646; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1647; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 2 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x04,0x01,0x00]1648; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1649; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1650; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1651;1652; GFX11-FAKE16-LABEL: add_inline_imm_2_f16:1653; GFX11-FAKE16: ; %bb.0:1654; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1655; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1656; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1657; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1658; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1659; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 2 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x04,0x01,0x00]1660; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1661; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1662; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1663;1664; VI-LABEL: add_inline_imm_2_f16:1665; VI: ; %bb.0:1666; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1667; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1668; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1669; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1670; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1671; VI-NEXT: v_add_f16_e64 v0, s4, 2 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0x04,0x01,0x00]1672; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1673; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1674;1675; SI-LABEL: add_inline_imm_2_f16:1676; SI: ; %bb.0:1677; SI-NEXT: s_load_dword s0, s[4:5], 0xb1678; SI-NEXT: s_mov_b32 s3, 0xf0001679; SI-NEXT: s_mov_b32 s2, -11680; SI-NEXT: s_waitcnt lgkmcnt(0)1681; SI-NEXT: v_cvt_f32_f16_e32 v0, s01682; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91683; SI-NEXT: v_add_f32_e32 v0, 0x34000000, v01684; SI-NEXT: v_cvt_f16_f32_e32 v0, v01685; SI-NEXT: s_waitcnt lgkmcnt(0)1686; SI-NEXT: buffer_store_short v0, off, s[0:3], 01687; SI-NEXT: s_endpgm1688 %y = fadd half %x, 0xH00021689 store half %y, ptr addrspace(1) %out1690 ret void1691}1692 1693define amdgpu_kernel void @add_inline_imm_16_f16(ptr addrspace(1) %out, half %x) {1694; GFX10-LABEL: add_inline_imm_16_f16:1695; GFX10: ; %bb.0:1696; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]1697; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]1698; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]1699; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]1700; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1701; GFX10-NEXT: v_add_f16_e64 v0, s2, 16 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x20,0x01,0x00]1702; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]1703; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1704; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1705;1706; GFX11-TRUE16-LABEL: add_inline_imm_16_f16:1707; GFX11-TRUE16: ; %bb.0:1708; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1709; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1710; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1711; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1712; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1713; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 16 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x20,0x01,0x00]1714; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1715; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1716; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1717;1718; GFX11-FAKE16-LABEL: add_inline_imm_16_f16:1719; GFX11-FAKE16: ; %bb.0:1720; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]1721; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]1722; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]1723; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]1724; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1725; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 16 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x20,0x01,0x00]1726; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1727; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]1728; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1729;1730; VI-LABEL: add_inline_imm_16_f16:1731; VI: ; %bb.0:1732; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]1733; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]1734; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]1735; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]1736; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1737; VI-NEXT: v_add_f16_e64 v0, s4, 16 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0x20,0x01,0x00]1738; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]1739; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1740;1741; SI-LABEL: add_inline_imm_16_f16:1742; SI: ; %bb.0:1743; SI-NEXT: s_load_dword s0, s[4:5], 0xb1744; SI-NEXT: s_mov_b32 s3, 0xf0001745; SI-NEXT: s_mov_b32 s2, -11746; SI-NEXT: s_waitcnt lgkmcnt(0)1747; SI-NEXT: v_cvt_f32_f16_e32 v0, s01748; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x91749; SI-NEXT: v_add_f32_e32 v0, 0x35800000, v01750; SI-NEXT: v_cvt_f16_f32_e32 v0, v01751; SI-NEXT: s_waitcnt lgkmcnt(0)1752; SI-NEXT: buffer_store_short v0, off, s[0:3], 01753; SI-NEXT: s_endpgm1754 %y = fadd half %x, 0xH00101755 store half %y, ptr addrspace(1) %out1756 ret void1757}1758 1759define amdgpu_kernel void @add_inline_imm_neg_1_f16(ptr addrspace(1) %out, ptr addrspace(1) %in) {1760; GFX10-LABEL: add_inline_imm_neg_1_f16:1761; GFX10: ; %bb.0:1762; GFX10-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x08,0xf4,0x00,0x00,0x00,0xfa]1763; GFX10-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x03,0x86,0xbe]1764; GFX10-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x03,0x87,0xbe,0x00,0x60,0x01,0x31]1765; GFX10-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x03,0x8a,0xbe]1766; GFX10-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x03,0x8b,0xbe]1767; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1768; GFX10-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x03,0x88,0xbe]1769; GFX10-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x03,0x89,0xbe]1770; GFX10-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x03,0x84,0xbe]1771; GFX10-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x28,0xe0,0x00,0x00,0x02,0x80]1772; GFX10-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x03,0x85,0xbe]1773; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]1774; GFX10-NEXT: v_add_nc_u32_e32 v0, -1, v0 ; encoding: [0xc1,0x00,0x00,0x4a]1775; GFX10-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1776; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1777;1778; GFX11-LABEL: add_inline_imm_neg_1_f16:1779; GFX11: ; %bb.0:1780; GFX11-NEXT: s_load_b128 s[0:3], s[4:5], 0x0 ; encoding: [0x02,0x00,0x08,0xf4,0x00,0x00,0x00,0xf8]1781; GFX11-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1782; GFX11-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0x60,0x01,0x31]1783; GFX11-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1784; GFX11-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1785; GFX11-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1786; GFX11-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1787; GFX11-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1788; GFX11-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1789; GFX11-NEXT: buffer_load_u16 v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1790; GFX11-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1791; GFX11-NEXT: s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]1792; GFX11-NEXT: v_add_nc_u32_e32 v0, -1, v0 ; encoding: [0xc1,0x00,0x00,0x4a]1793; GFX11-NEXT: buffer_store_b16 v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x01,0x80]1794; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1795;1796; VI-LABEL: add_inline_imm_neg_1_f16:1797; VI: ; %bb.0:1798; VI-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x0a,0xc0,0x00,0x00,0x00,0x00]1799; VI-NEXT: s_mov_b32 s7, 0x1100f000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0xf0,0x00,0x11]1800; VI-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1801; VI-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1802; VI-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1803; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1804; VI-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1805; VI-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1806; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1807; VI-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1808; VI-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1809; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]1810; VI-NEXT: v_add_u32_e32 v0, vcc, -1, v0 ; encoding: [0xc1,0x00,0x00,0x32]1811; VI-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1812; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1813;1814; SI-LABEL: add_inline_imm_neg_1_f16:1815; SI: ; %bb.0:1816; SI-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x91817; SI-NEXT: s_mov_b32 s7, 0xf0001818; SI-NEXT: s_mov_b32 s6, -11819; SI-NEXT: s_mov_b32 s10, s61820; SI-NEXT: s_mov_b32 s11, s71821; SI-NEXT: s_waitcnt lgkmcnt(0)1822; SI-NEXT: s_mov_b32 s8, s21823; SI-NEXT: s_mov_b32 s9, s31824; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 01825; SI-NEXT: s_mov_b32 s4, s01826; SI-NEXT: s_mov_b32 s5, s11827; SI-NEXT: s_waitcnt vmcnt(0)1828; SI-NEXT: v_add_i32_e32 v0, vcc, -1, v01829; SI-NEXT: buffer_store_short v0, off, s[4:7], 01830; SI-NEXT: s_endpgm1831 %x = load i16, ptr addrspace(1) %in1832 %y = add i16 %x, -11833 %ybc = bitcast i16 %y to half1834 store half %ybc, ptr addrspace(1) %out1835 ret void1836}1837 1838define amdgpu_kernel void @add_inline_imm_neg_2_f16(ptr addrspace(1) %out, ptr addrspace(1) %in) {1839; GFX10-LABEL: add_inline_imm_neg_2_f16:1840; GFX10: ; %bb.0:1841; GFX10-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x08,0xf4,0x00,0x00,0x00,0xfa]1842; GFX10-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x03,0x86,0xbe]1843; GFX10-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x03,0x87,0xbe,0x00,0x60,0x01,0x31]1844; GFX10-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x03,0x8a,0xbe]1845; GFX10-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x03,0x8b,0xbe]1846; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1847; GFX10-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x03,0x88,0xbe]1848; GFX10-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x03,0x89,0xbe]1849; GFX10-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x03,0x84,0xbe]1850; GFX10-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x28,0xe0,0x00,0x00,0x02,0x80]1851; GFX10-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x03,0x85,0xbe]1852; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]1853; GFX10-NEXT: v_add_nc_u32_e32 v0, 0xfffe, v0 ; encoding: [0xff,0x00,0x00,0x4a,0xfe,0xff,0x00,0x00]1854; GFX10-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1855; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1856;1857; GFX11-LABEL: add_inline_imm_neg_2_f16:1858; GFX11: ; %bb.0:1859; GFX11-NEXT: s_load_b128 s[0:3], s[4:5], 0x0 ; encoding: [0x02,0x00,0x08,0xf4,0x00,0x00,0x00,0xf8]1860; GFX11-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1861; GFX11-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0x60,0x01,0x31]1862; GFX11-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1863; GFX11-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1864; GFX11-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1865; GFX11-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1866; GFX11-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1867; GFX11-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1868; GFX11-NEXT: buffer_load_u16 v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1869; GFX11-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1870; GFX11-NEXT: s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]1871; GFX11-NEXT: v_add_nc_u32_e32 v0, 0xfffe, v0 ; encoding: [0xff,0x00,0x00,0x4a,0xfe,0xff,0x00,0x00]1872; GFX11-NEXT: buffer_store_b16 v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x01,0x80]1873; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1874;1875; VI-LABEL: add_inline_imm_neg_2_f16:1876; VI: ; %bb.0:1877; VI-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x0a,0xc0,0x00,0x00,0x00,0x00]1878; VI-NEXT: s_mov_b32 s7, 0x1100f000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0xf0,0x00,0x11]1879; VI-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1880; VI-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1881; VI-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1882; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1883; VI-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1884; VI-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1885; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1886; VI-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1887; VI-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1888; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]1889; VI-NEXT: v_add_u32_e32 v0, vcc, 0xfffe, v0 ; encoding: [0xff,0x00,0x00,0x32,0xfe,0xff,0x00,0x00]1890; VI-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1891; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1892;1893; SI-LABEL: add_inline_imm_neg_2_f16:1894; SI: ; %bb.0:1895; SI-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x91896; SI-NEXT: s_mov_b32 s7, 0xf0001897; SI-NEXT: s_mov_b32 s6, -11898; SI-NEXT: s_mov_b32 s10, s61899; SI-NEXT: s_mov_b32 s11, s71900; SI-NEXT: s_waitcnt lgkmcnt(0)1901; SI-NEXT: s_mov_b32 s8, s21902; SI-NEXT: s_mov_b32 s9, s31903; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 01904; SI-NEXT: s_mov_b32 s4, s01905; SI-NEXT: s_mov_b32 s5, s11906; SI-NEXT: s_waitcnt vmcnt(0)1907; SI-NEXT: v_add_i32_e32 v0, vcc, -2, v01908; SI-NEXT: buffer_store_short v0, off, s[4:7], 01909; SI-NEXT: s_endpgm1910 %x = load i16, ptr addrspace(1) %in1911 %y = add i16 %x, -21912 %ybc = bitcast i16 %y to half1913 store half %ybc, ptr addrspace(1) %out1914 ret void1915}1916 1917define amdgpu_kernel void @add_inline_imm_neg_16_f16(ptr addrspace(1) %out, ptr addrspace(1) %in) {1918; GFX10-LABEL: add_inline_imm_neg_16_f16:1919; GFX10: ; %bb.0:1920; GFX10-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x08,0xf4,0x00,0x00,0x00,0xfa]1921; GFX10-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x03,0x86,0xbe]1922; GFX10-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x03,0x87,0xbe,0x00,0x60,0x01,0x31]1923; GFX10-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x03,0x8a,0xbe]1924; GFX10-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x03,0x8b,0xbe]1925; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]1926; GFX10-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x03,0x88,0xbe]1927; GFX10-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x03,0x89,0xbe]1928; GFX10-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x03,0x84,0xbe]1929; GFX10-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x28,0xe0,0x00,0x00,0x02,0x80]1930; GFX10-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x03,0x85,0xbe]1931; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]1932; GFX10-NEXT: v_add_nc_u32_e32 v0, 0xfff0, v0 ; encoding: [0xff,0x00,0x00,0x4a,0xf0,0xff,0x00,0x00]1933; GFX10-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1934; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1935;1936; GFX11-LABEL: add_inline_imm_neg_16_f16:1937; GFX11: ; %bb.0:1938; GFX11-NEXT: s_load_b128 s[0:3], s[4:5], 0x0 ; encoding: [0x02,0x00,0x08,0xf4,0x00,0x00,0x00,0xf8]1939; GFX11-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1940; GFX11-NEXT: s_mov_b32 s7, 0x31016000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0x60,0x01,0x31]1941; GFX11-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1942; GFX11-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1943; GFX11-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]1944; GFX11-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1945; GFX11-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1946; GFX11-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1947; GFX11-NEXT: buffer_load_u16 v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1948; GFX11-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1949; GFX11-NEXT: s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]1950; GFX11-NEXT: v_add_nc_u32_e32 v0, 0xfff0, v0 ; encoding: [0xff,0x00,0x00,0x4a,0xf0,0xff,0x00,0x00]1951; GFX11-NEXT: buffer_store_b16 v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x01,0x80]1952; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]1953;1954; VI-LABEL: add_inline_imm_neg_16_f16:1955; VI: ; %bb.0:1956; VI-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0 ; encoding: [0x04,0x00,0x0a,0xc0,0x00,0x00,0x00,0x00]1957; VI-NEXT: s_mov_b32 s7, 0x1100f000 ; encoding: [0xff,0x00,0x87,0xbe,0x00,0xf0,0x00,0x11]1958; VI-NEXT: s_mov_b32 s6, -1 ; encoding: [0xc1,0x00,0x86,0xbe]1959; VI-NEXT: s_mov_b32 s10, s6 ; encoding: [0x06,0x00,0x8a,0xbe]1960; VI-NEXT: s_mov_b32 s11, s7 ; encoding: [0x07,0x00,0x8b,0xbe]1961; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]1962; VI-NEXT: s_mov_b32 s8, s2 ; encoding: [0x02,0x00,0x88,0xbe]1963; VI-NEXT: s_mov_b32 s9, s3 ; encoding: [0x03,0x00,0x89,0xbe]1964; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0 ; encoding: [0x00,0x00,0x48,0xe0,0x00,0x00,0x02,0x80]1965; VI-NEXT: s_mov_b32 s4, s0 ; encoding: [0x00,0x00,0x84,0xbe]1966; VI-NEXT: s_mov_b32 s5, s1 ; encoding: [0x01,0x00,0x85,0xbe]1967; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]1968; VI-NEXT: v_add_u32_e32 v0, vcc, 0xfff0, v0 ; encoding: [0xff,0x00,0x00,0x32,0xf0,0xff,0x00,0x00]1969; VI-NEXT: buffer_store_short v0, off, s[4:7], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x01,0x80]1970; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]1971;1972; SI-LABEL: add_inline_imm_neg_16_f16:1973; SI: ; %bb.0:1974; SI-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x91975; SI-NEXT: s_mov_b32 s7, 0xf0001976; SI-NEXT: s_mov_b32 s6, -11977; SI-NEXT: s_mov_b32 s10, s61978; SI-NEXT: s_mov_b32 s11, s71979; SI-NEXT: s_waitcnt lgkmcnt(0)1980; SI-NEXT: s_mov_b32 s8, s21981; SI-NEXT: s_mov_b32 s9, s31982; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 01983; SI-NEXT: s_mov_b32 s4, s01984; SI-NEXT: s_mov_b32 s5, s11985; SI-NEXT: s_waitcnt vmcnt(0)1986; SI-NEXT: v_add_i32_e32 v0, vcc, -16, v01987; SI-NEXT: buffer_store_short v0, off, s[4:7], 01988; SI-NEXT: s_endpgm1989 %x = load i16, ptr addrspace(1) %in1990 %y = add i16 %x, -161991 %ybc = bitcast i16 %y to half1992 store half %ybc, ptr addrspace(1) %out1993 ret void1994}1995 1996define amdgpu_kernel void @add_inline_imm_63_f16(ptr addrspace(1) %out, half %x) {1997; GFX10-LABEL: add_inline_imm_63_f16:1998; GFX10: ; %bb.0:1999; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]2000; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]2001; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]2002; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]2003; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]2004; GFX10-NEXT: v_add_f16_e64 v0, s2, 63 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x7e,0x01,0x00]2005; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]2006; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]2007; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]2008;2009; GFX11-TRUE16-LABEL: add_inline_imm_63_f16:2010; GFX11-TRUE16: ; %bb.0:2011; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]2012; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]2013; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]2014; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]2015; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]2016; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 63 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x7e,0x01,0x00]2017; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]2018; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]2019; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]2020;2021; GFX11-FAKE16-LABEL: add_inline_imm_63_f16:2022; GFX11-FAKE16: ; %bb.0:2023; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]2024; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]2025; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]2026; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]2027; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]2028; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 63 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x7e,0x01,0x00]2029; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]2030; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]2031; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]2032;2033; VI-LABEL: add_inline_imm_63_f16:2034; VI: ; %bb.0:2035; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]2036; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]2037; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]2038; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]2039; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]2040; VI-NEXT: v_add_f16_e64 v0, s4, 63 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0x7e,0x01,0x00]2041; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]2042; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]2043;2044; SI-LABEL: add_inline_imm_63_f16:2045; SI: ; %bb.0:2046; SI-NEXT: s_load_dword s0, s[4:5], 0xb2047; SI-NEXT: s_mov_b32 s3, 0xf0002048; SI-NEXT: s_mov_b32 s2, -12049; SI-NEXT: s_waitcnt lgkmcnt(0)2050; SI-NEXT: v_cvt_f32_f16_e32 v0, s02051; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x92052; SI-NEXT: v_add_f32_e32 v0, 0x367c0000, v02053; SI-NEXT: v_cvt_f16_f32_e32 v0, v02054; SI-NEXT: s_waitcnt lgkmcnt(0)2055; SI-NEXT: buffer_store_short v0, off, s[0:3], 02056; SI-NEXT: s_endpgm2057 %y = fadd half %x, 0xH003F2058 store half %y, ptr addrspace(1) %out2059 ret void2060}2061 2062define amdgpu_kernel void @add_inline_imm_64_f16(ptr addrspace(1) %out, half %x) {2063; GFX10-LABEL: add_inline_imm_64_f16:2064; GFX10: ; %bb.0:2065; GFX10-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0xa1,0xbf]2066; GFX10-NEXT: s_load_dword s2, s[8:9], 0x8 ; encoding: [0x84,0x00,0x00,0xf4,0x08,0x00,0x00,0xfa]2067; GFX10-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x04,0xf4,0x00,0x00,0x00,0xfa]2068; GFX10-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x03,0x83,0xbe,0x00,0x60,0x01,0x31]2069; GFX10-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0xc0,0x8c,0xbf]2070; GFX10-NEXT: v_add_f16_e64 v0, s2, 64 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x80,0x01,0x00]2071; GFX10-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x03,0x82,0xbe]2072; GFX10-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]2073; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]2074;2075; GFX11-TRUE16-LABEL: add_inline_imm_64_f16:2076; GFX11-TRUE16: ; %bb.0:2077; GFX11-TRUE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]2078; GFX11-TRUE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]2079; GFX11-TRUE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]2080; GFX11-TRUE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]2081; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]2082; GFX11-TRUE16-NEXT: v_add_f16_e64 v0.l, s2, 64 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x80,0x01,0x00]2083; GFX11-TRUE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]2084; GFX11-TRUE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]2085; GFX11-TRUE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]2086;2087; GFX11-FAKE16-LABEL: add_inline_imm_64_f16:2088; GFX11-FAKE16: ; %bb.0:2089; GFX11-FAKE16-NEXT: s_clause 0x1 ; encoding: [0x01,0x00,0x85,0xbf]2090; GFX11-FAKE16-NEXT: s_load_b32 s2, s[4:5], 0x8 ; encoding: [0x82,0x00,0x00,0xf4,0x08,0x00,0x00,0xf8]2091; GFX11-FAKE16-NEXT: s_load_b64 s[0:1], s[4:5], 0x0 ; encoding: [0x02,0x00,0x04,0xf4,0x00,0x00,0x00,0xf8]2092; GFX11-FAKE16-NEXT: s_mov_b32 s3, 0x31016000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0x60,0x01,0x31]2093; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x07,0xfc,0x89,0xbf]2094; GFX11-FAKE16-NEXT: v_add_f16_e64 v0, s2, 64 ; encoding: [0x00,0x00,0x32,0xd5,0x02,0x80,0x01,0x00]2095; GFX11-FAKE16-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]2096; GFX11-FAKE16-NEXT: buffer_store_b16 v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x64,0xe0,0x00,0x00,0x00,0x80]2097; GFX11-FAKE16-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]2098;2099; VI-LABEL: add_inline_imm_64_f16:2100; VI: ; %bb.0:2101; VI-NEXT: s_load_dword s4, s[8:9], 0x8 ; encoding: [0x04,0x01,0x02,0xc0,0x08,0x00,0x00,0x00]2102; VI-NEXT: s_load_dwordx2 s[0:1], s[8:9], 0x0 ; encoding: [0x04,0x00,0x06,0xc0,0x00,0x00,0x00,0x00]2103; VI-NEXT: s_mov_b32 s3, 0x1100f000 ; encoding: [0xff,0x00,0x83,0xbe,0x00,0xf0,0x00,0x11]2104; VI-NEXT: s_mov_b32 s2, -1 ; encoding: [0xc1,0x00,0x82,0xbe]2105; VI-NEXT: s_waitcnt lgkmcnt(0) ; encoding: [0x7f,0x00,0x8c,0xbf]2106; VI-NEXT: v_add_f16_e64 v0, s4, 64 ; encoding: [0x00,0x00,0x1f,0xd1,0x04,0x80,0x01,0x00]2107; VI-NEXT: buffer_store_short v0, off, s[0:3], 0 ; encoding: [0x00,0x00,0x68,0xe0,0x00,0x00,0x00,0x80]2108; VI-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]2109;2110; SI-LABEL: add_inline_imm_64_f16:2111; SI: ; %bb.0:2112; SI-NEXT: s_load_dword s0, s[4:5], 0xb2113; SI-NEXT: s_mov_b32 s3, 0xf0002114; SI-NEXT: s_mov_b32 s2, -12115; SI-NEXT: s_waitcnt lgkmcnt(0)2116; SI-NEXT: v_cvt_f32_f16_e32 v0, s02117; SI-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x92118; SI-NEXT: v_add_f32_e32 v0, 0x36800000, v02119; SI-NEXT: v_cvt_f16_f32_e32 v0, v02120; SI-NEXT: s_waitcnt lgkmcnt(0)2121; SI-NEXT: buffer_store_short v0, off, s[0:3], 02122; SI-NEXT: s_endpgm2123 %y = fadd half %x, 0xH00402124 store half %y, ptr addrspace(1) %out2125 ret void2126}2127 2128; This needs to be emitted as a literal constant since the 16-bit2129; float values do not work for 16-bit integer operations.2130define void @mul_inline_imm_0.5_i16(ptr addrspace(1) %out, i16 %x) {2131; GFX10-LABEL: mul_inline_imm_0.5_i16:2132; GFX10: ; %bb.0:2133; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2134; GFX10-NEXT: v_mul_lo_u16 v2, 0x3800, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x38,0x00,0x00]2135; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2136; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2137;2138; GFX11-TRUE16-LABEL: mul_inline_imm_0.5_i16:2139; GFX11-TRUE16: ; %bb.0:2140; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2141; GFX11-TRUE16-NEXT: v_mul_lo_u16 v2.l, 0x3800, v2.l ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x38,0x00,0x00]2142; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2143; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2144;2145; GFX11-FAKE16-LABEL: mul_inline_imm_0.5_i16:2146; GFX11-FAKE16: ; %bb.0:2147; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2148; GFX11-FAKE16-NEXT: v_mul_lo_u16 v2, 0x3800, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x38,0x00,0x00]2149; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2150; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2151;2152; VI-LABEL: mul_inline_imm_0.5_i16:2153; VI: ; %bb.0:2154; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2155; VI-NEXT: v_mul_lo_u16_e32 v2, 0x3800, v2 ; encoding: [0xff,0x04,0x04,0x52,0x00,0x38,0x00,0x00]2156; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2157; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2158; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2159;2160; SI-LABEL: mul_inline_imm_0.5_i16:2161; SI: ; %bb.0:2162; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2163; SI-NEXT: s_mov_b32 s6, 02164; SI-NEXT: v_and_b32_e32 v2, 0xffff, v22165; SI-NEXT: s_mov_b32 s7, 0xf0002166; SI-NEXT: s_mov_b32 s4, s62167; SI-NEXT: s_mov_b32 s5, s62168; SI-NEXT: v_mul_u32_u24_e32 v2, 0x3800, v22169; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642170; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2171; SI-NEXT: s_setpc_b64 s[30:31]2172 %y = mul i16 %x, bitcast (half 0.5 to i16)2173 store i16 %y, ptr addrspace(1) %out2174 ret void2175}2176 2177define void @mul_inline_imm_neg_0.5_i16(ptr addrspace(1) %out, i16 %x) {2178; GFX10-LABEL: mul_inline_imm_neg_0.5_i16:2179; GFX10: ; %bb.0:2180; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2181; GFX10-NEXT: v_mul_lo_u16 v2, 0xb800, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xb8,0xff,0xff]2182; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2183; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2184;2185; GFX11-TRUE16-LABEL: mul_inline_imm_neg_0.5_i16:2186; GFX11-TRUE16: ; %bb.0:2187; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2188; GFX11-TRUE16-NEXT: v_mul_lo_u16 v2.l, 0xb800, v2.l ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xb8,0xff,0xff]2189; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2190; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2191;2192; GFX11-FAKE16-LABEL: mul_inline_imm_neg_0.5_i16:2193; GFX11-FAKE16: ; %bb.0:2194; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2195; GFX11-FAKE16-NEXT: v_mul_lo_u16 v2, 0xb800, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xb8,0xff,0xff]2196; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2197; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2198;2199; VI-LABEL: mul_inline_imm_neg_0.5_i16:2200; VI: ; %bb.0:2201; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2202; VI-NEXT: v_mul_lo_u16_e32 v2, 0xb800, v2 ; encoding: [0xff,0x04,0x04,0x52,0x00,0xb8,0xff,0xff]2203; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2204; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2205; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2206;2207; SI-LABEL: mul_inline_imm_neg_0.5_i16:2208; SI: ; %bb.0:2209; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2210; SI-NEXT: s_mov_b32 s6, 02211; SI-NEXT: v_and_b32_e32 v2, 0xffff, v22212; SI-NEXT: s_mov_b32 s7, 0xf0002213; SI-NEXT: s_mov_b32 s4, s62214; SI-NEXT: s_mov_b32 s5, s62215; SI-NEXT: v_mul_u32_u24_e32 v2, 0xb800, v22216; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642217; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2218; SI-NEXT: s_setpc_b64 s[30:31]2219 %y = mul i16 %x, bitcast (half -0.5 to i16)2220 store i16 %y, ptr addrspace(1) %out2221 ret void2222}2223 2224define void @mul_inline_imm_1.0_i16(ptr addrspace(1) %out, i16 %x) {2225; GFX10-LABEL: mul_inline_imm_1.0_i16:2226; GFX10: ; %bb.0:2227; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2228; GFX10-NEXT: v_mul_lo_u16 v2, 0x3c00, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x3c,0x00,0x00]2229; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2230; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2231;2232; GFX11-TRUE16-LABEL: mul_inline_imm_1.0_i16:2233; GFX11-TRUE16: ; %bb.0:2234; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2235; GFX11-TRUE16-NEXT: v_mul_lo_u16 v2.l, 0x3c00, v2.l ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x3c,0x00,0x00]2236; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2237; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2238;2239; GFX11-FAKE16-LABEL: mul_inline_imm_1.0_i16:2240; GFX11-FAKE16: ; %bb.0:2241; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2242; GFX11-FAKE16-NEXT: v_mul_lo_u16 v2, 0x3c00, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x3c,0x00,0x00]2243; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2244; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2245;2246; VI-LABEL: mul_inline_imm_1.0_i16:2247; VI: ; %bb.0:2248; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2249; VI-NEXT: v_mul_lo_u16_e32 v2, 0x3c00, v2 ; encoding: [0xff,0x04,0x04,0x52,0x00,0x3c,0x00,0x00]2250; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2251; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2252; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2253;2254; SI-LABEL: mul_inline_imm_1.0_i16:2255; SI: ; %bb.0:2256; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2257; SI-NEXT: s_mov_b32 s6, 02258; SI-NEXT: v_and_b32_e32 v2, 0xffff, v22259; SI-NEXT: s_mov_b32 s7, 0xf0002260; SI-NEXT: s_mov_b32 s4, s62261; SI-NEXT: s_mov_b32 s5, s62262; SI-NEXT: v_mul_u32_u24_e32 v2, 0x3c00, v22263; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642264; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2265; SI-NEXT: s_setpc_b64 s[30:31]2266 %y = mul i16 %x, bitcast (half 1.0 to i16)2267 store i16 %y, ptr addrspace(1) %out2268 ret void2269}2270 2271define void @mul_inline_imm_neg_1.0_i16(ptr addrspace(1) %out, i16 %x) {2272; GFX10-LABEL: mul_inline_imm_neg_1.0_i16:2273; GFX10: ; %bb.0:2274; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2275; GFX10-NEXT: v_mul_lo_u16 v2, 0xbc00, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xbc,0xff,0xff]2276; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2277; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2278;2279; GFX11-TRUE16-LABEL: mul_inline_imm_neg_1.0_i16:2280; GFX11-TRUE16: ; %bb.0:2281; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2282; GFX11-TRUE16-NEXT: v_mul_lo_u16 v2.l, 0xbc00, v2.l ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xbc,0xff,0xff]2283; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2284; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2285;2286; GFX11-FAKE16-LABEL: mul_inline_imm_neg_1.0_i16:2287; GFX11-FAKE16: ; %bb.0:2288; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2289; GFX11-FAKE16-NEXT: v_mul_lo_u16 v2, 0xbc00, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xbc,0xff,0xff]2290; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2291; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2292;2293; VI-LABEL: mul_inline_imm_neg_1.0_i16:2294; VI: ; %bb.0:2295; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2296; VI-NEXT: v_mul_lo_u16_e32 v2, 0xbc00, v2 ; encoding: [0xff,0x04,0x04,0x52,0x00,0xbc,0xff,0xff]2297; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2298; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2299; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2300;2301; SI-LABEL: mul_inline_imm_neg_1.0_i16:2302; SI: ; %bb.0:2303; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2304; SI-NEXT: s_mov_b32 s6, 02305; SI-NEXT: v_and_b32_e32 v2, 0xffff, v22306; SI-NEXT: s_mov_b32 s7, 0xf0002307; SI-NEXT: s_mov_b32 s4, s62308; SI-NEXT: s_mov_b32 s5, s62309; SI-NEXT: v_mul_u32_u24_e32 v2, 0xbc00, v22310; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642311; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2312; SI-NEXT: s_setpc_b64 s[30:31]2313 %y = mul i16 %x, bitcast (half -1.0 to i16)2314 store i16 %y, ptr addrspace(1) %out2315 ret void2316}2317 2318define void @shl_inline_imm_2.0_i16(ptr addrspace(1) %out, i16 %x) {2319; GFX10-LABEL: shl_inline_imm_2.0_i16:2320; GFX10: ; %bb.0:2321; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2322; GFX10-NEXT: v_lshlrev_b16 v2, v2, 0x4000 ; encoding: [0x02,0x00,0x14,0xd7,0x02,0xff,0x01,0x00,0x00,0x40,0x00,0x00]2323; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2324; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2325;2326; GFX11-TRUE16-LABEL: shl_inline_imm_2.0_i16:2327; GFX11-TRUE16: ; %bb.0:2328; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2329; GFX11-TRUE16-NEXT: v_lshlrev_b16 v2.l, v2.l, 0x4000 ; encoding: [0x02,0x00,0x38,0xd7,0x02,0xff,0x01,0x00,0x00,0x40,0x00,0x00]2330; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2331; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2332;2333; GFX11-FAKE16-LABEL: shl_inline_imm_2.0_i16:2334; GFX11-FAKE16: ; %bb.0:2335; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2336; GFX11-FAKE16-NEXT: v_lshlrev_b16 v2, v2, 0x4000 ; encoding: [0x02,0x00,0x38,0xd7,0x02,0xff,0x01,0x00,0x00,0x40,0x00,0x00]2337; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2338; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2339;2340; VI-LABEL: shl_inline_imm_2.0_i16:2341; VI: ; %bb.0:2342; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2343; VI-NEXT: s_movk_i32 s4, 0x4000 ; encoding: [0x00,0x40,0x04,0xb0]2344; VI-NEXT: v_lshlrev_b16_e64 v2, v2, s4 ; encoding: [0x02,0x00,0x2a,0xd1,0x02,0x09,0x00,0x00]2345; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2346; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2347; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2348;2349; SI-LABEL: shl_inline_imm_2.0_i16:2350; SI: ; %bb.0:2351; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2352; SI-NEXT: s_mov_b32 s6, 02353; SI-NEXT: s_mov_b32 s7, 0xf0002354; SI-NEXT: s_mov_b32 s4, s62355; SI-NEXT: s_mov_b32 s5, s62356; SI-NEXT: v_lshl_b32_e32 v2, 0x4000, v22357; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642358; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2359; SI-NEXT: s_setpc_b64 s[30:31]2360 %y = shl i16 bitcast (half 2.0 to i16), %x2361 store i16 %y, ptr addrspace(1) %out2362 ret void2363}2364 2365define void @shl_inline_imm_neg_2.0_i16(ptr addrspace(1) %out, i16 %x) {2366; GFX10-LABEL: shl_inline_imm_neg_2.0_i16:2367; GFX10: ; %bb.0:2368; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2369; GFX10-NEXT: v_lshlrev_b16 v2, v2, 0xc000 ; encoding: [0x02,0x00,0x14,0xd7,0x02,0xff,0x01,0x00,0x00,0xc0,0xff,0xff]2370; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2371; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2372;2373; GFX11-TRUE16-LABEL: shl_inline_imm_neg_2.0_i16:2374; GFX11-TRUE16: ; %bb.0:2375; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2376; GFX11-TRUE16-NEXT: v_lshlrev_b16 v2.l, v2.l, 0xc000 ; encoding: [0x02,0x00,0x38,0xd7,0x02,0xff,0x01,0x00,0x00,0xc0,0xff,0xff]2377; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2378; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2379;2380; GFX11-FAKE16-LABEL: shl_inline_imm_neg_2.0_i16:2381; GFX11-FAKE16: ; %bb.0:2382; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2383; GFX11-FAKE16-NEXT: v_lshlrev_b16 v2, v2, 0xc000 ; encoding: [0x02,0x00,0x38,0xd7,0x02,0xff,0x01,0x00,0x00,0xc0,0xff,0xff]2384; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2385; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2386;2387; VI-LABEL: shl_inline_imm_neg_2.0_i16:2388; VI: ; %bb.0:2389; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2390; VI-NEXT: s_movk_i32 s4, 0xc000 ; encoding: [0x00,0xc0,0x04,0xb0]2391; VI-NEXT: v_lshlrev_b16_e64 v2, v2, s4 ; encoding: [0x02,0x00,0x2a,0xd1,0x02,0x09,0x00,0x00]2392; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2393; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2394; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2395;2396; SI-LABEL: shl_inline_imm_neg_2.0_i16:2397; SI: ; %bb.0:2398; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2399; SI-NEXT: s_mov_b32 s6, 02400; SI-NEXT: s_mov_b32 s7, 0xf0002401; SI-NEXT: s_mov_b32 s4, s62402; SI-NEXT: s_mov_b32 s5, s62403; SI-NEXT: v_lshl_b32_e32 v2, 0xffffc000, v22404; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642405; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2406; SI-NEXT: s_setpc_b64 s[30:31]2407 %y = shl i16 bitcast (half -2.0 to i16), %x2408 store i16 %y, ptr addrspace(1) %out2409 ret void2410}2411 2412define void @mul_inline_imm_4.0_i16(ptr addrspace(1) %out, i16 %x) {2413; GFX10-LABEL: mul_inline_imm_4.0_i16:2414; GFX10: ; %bb.0:2415; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2416; GFX10-NEXT: v_mul_lo_u16 v2, 0x4400, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x44,0x00,0x00]2417; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2418; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2419;2420; GFX11-TRUE16-LABEL: mul_inline_imm_4.0_i16:2421; GFX11-TRUE16: ; %bb.0:2422; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2423; GFX11-TRUE16-NEXT: v_mul_lo_u16 v2.l, 0x4400, v2.l ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x44,0x00,0x00]2424; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2425; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2426;2427; GFX11-FAKE16-LABEL: mul_inline_imm_4.0_i16:2428; GFX11-FAKE16: ; %bb.0:2429; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2430; GFX11-FAKE16-NEXT: v_mul_lo_u16 v2, 0x4400, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0x44,0x00,0x00]2431; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2432; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2433;2434; VI-LABEL: mul_inline_imm_4.0_i16:2435; VI: ; %bb.0:2436; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2437; VI-NEXT: v_mul_lo_u16_e32 v2, 0x4400, v2 ; encoding: [0xff,0x04,0x04,0x52,0x00,0x44,0x00,0x00]2438; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2439; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2440; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2441;2442; SI-LABEL: mul_inline_imm_4.0_i16:2443; SI: ; %bb.0:2444; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2445; SI-NEXT: s_mov_b32 s6, 02446; SI-NEXT: v_and_b32_e32 v2, 0xffff, v22447; SI-NEXT: s_mov_b32 s7, 0xf0002448; SI-NEXT: s_mov_b32 s4, s62449; SI-NEXT: s_mov_b32 s5, s62450; SI-NEXT: v_mul_u32_u24_e32 v2, 0x4400, v22451; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642452; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2453; SI-NEXT: s_setpc_b64 s[30:31]2454 %y = mul i16 %x, bitcast (half 4.0 to i16)2455 store i16 %y, ptr addrspace(1) %out2456 ret void2457}2458 2459define void @mul_inline_imm_neg_4.0_i16(ptr addrspace(1) %out, i16 %x) {2460; GFX10-LABEL: mul_inline_imm_neg_4.0_i16:2461; GFX10: ; %bb.0:2462; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2463; GFX10-NEXT: v_mul_lo_u16 v2, 0xc400, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xc4,0xff,0xff]2464; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2465; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2466;2467; GFX11-TRUE16-LABEL: mul_inline_imm_neg_4.0_i16:2468; GFX11-TRUE16: ; %bb.0:2469; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2470; GFX11-TRUE16-NEXT: v_mul_lo_u16 v2.l, 0xc400, v2.l ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xc4,0xff,0xff]2471; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2472; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2473;2474; GFX11-FAKE16-LABEL: mul_inline_imm_neg_4.0_i16:2475; GFX11-FAKE16: ; %bb.0:2476; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2477; GFX11-FAKE16-NEXT: v_mul_lo_u16 v2, 0xc400, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x00,0xc4,0xff,0xff]2478; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2479; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2480;2481; VI-LABEL: mul_inline_imm_neg_4.0_i16:2482; VI: ; %bb.0:2483; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2484; VI-NEXT: v_mul_lo_u16_e32 v2, 0xc400, v2 ; encoding: [0xff,0x04,0x04,0x52,0x00,0xc4,0xff,0xff]2485; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2486; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2487; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2488;2489; SI-LABEL: mul_inline_imm_neg_4.0_i16:2490; SI: ; %bb.0:2491; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2492; SI-NEXT: s_mov_b32 s6, 02493; SI-NEXT: v_and_b32_e32 v2, 0xffff, v22494; SI-NEXT: s_mov_b32 s7, 0xf0002495; SI-NEXT: s_mov_b32 s4, s62496; SI-NEXT: s_mov_b32 s5, s62497; SI-NEXT: v_mul_u32_u24_e32 v2, 0xc400, v22498; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642499; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2500; SI-NEXT: s_setpc_b64 s[30:31]2501 %y = mul i16 %x, bitcast (half -4.0 to i16)2502 store i16 %y, ptr addrspace(1) %out2503 ret void2504}2505 2506define void @mul_inline_imm_inv2pi_i16(ptr addrspace(1) %out, i16 %x) {2507; GFX10-LABEL: mul_inline_imm_inv2pi_i16:2508; GFX10: ; %bb.0:2509; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2510; GFX10-NEXT: v_mul_lo_u16 v2, 0x3118, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x18,0x31,0x00,0x00]2511; GFX10-NEXT: global_store_short v[0:1], v2, off ; encoding: [0x00,0x80,0x68,0xdc,0x00,0x02,0x7d,0x00]2512; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]2513;2514; GFX11-TRUE16-LABEL: mul_inline_imm_inv2pi_i16:2515; GFX11-TRUE16: ; %bb.0:2516; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2517; GFX11-TRUE16-NEXT: v_mul_lo_u16 v2.l, 0x3118, v2.l ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x18,0x31,0x00,0x00]2518; GFX11-TRUE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2519; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2520;2521; GFX11-FAKE16-LABEL: mul_inline_imm_inv2pi_i16:2522; GFX11-FAKE16: ; %bb.0:2523; GFX11-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]2524; GFX11-FAKE16-NEXT: v_mul_lo_u16 v2, 0x3118, v2 ; encoding: [0x02,0x00,0x05,0xd7,0xff,0x04,0x02,0x00,0x18,0x31,0x00,0x00]2525; GFX11-FAKE16-NEXT: global_store_b16 v[0:1], v2, off ; encoding: [0x00,0x00,0x66,0xdc,0x00,0x02,0x7c,0x00]2526; GFX11-FAKE16-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]2527;2528; VI-LABEL: mul_inline_imm_inv2pi_i16:2529; VI: ; %bb.0:2530; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]2531; VI-NEXT: v_mul_lo_u16_e32 v2, 0x3118, v2 ; encoding: [0xff,0x04,0x04,0x52,0x18,0x31,0x00,0x00]2532; VI-NEXT: flat_store_short v[0:1], v2 ; encoding: [0x00,0x00,0x68,0xdc,0x00,0x02,0x00,0x00]2533; VI-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]2534; VI-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]2535;2536; SI-LABEL: mul_inline_imm_inv2pi_i16:2537; SI: ; %bb.0:2538; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2539; SI-NEXT: s_mov_b32 s6, 02540; SI-NEXT: v_and_b32_e32 v2, 0xffff, v22541; SI-NEXT: s_mov_b32 s7, 0xf0002542; SI-NEXT: s_mov_b32 s4, s62543; SI-NEXT: s_mov_b32 s5, s62544; SI-NEXT: v_mul_u32_u24_e32 v2, 0x3118, v22545; SI-NEXT: buffer_store_short v2, v[0:1], s[4:7], 0 addr642546; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)2547; SI-NEXT: s_setpc_b64 s[30:31]2548 %y = mul i16 %x, bitcast (half 0xH3118 to i16)2549 store i16 %y, ptr addrspace(1) %out2550 ret void2551}2552