1 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX9 %s
2 ; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX10 %s
4 ; GCN-LABEL: {{^}}shl_i16:
5 ; GCN: v_lshlrev_b16_e{{32|64}} [[OP:v[0-9]+]],
6 ; GFX9-NEXT: s_setpc_b64
7 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
8 define i16 @shl_i16(i16 %x, i16 %y) {
13 ; GCN-LABEL: {{^}}lshr_i16:
14 ; GCN: v_lshrrev_b16_e{{32|64}} [[OP:v[0-9]+]],
15 ; GFX9-NEXT: s_setpc_b64
16 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
17 define i16 @lshr_i16(i16 %x, i16 %y) {
18 %res = lshr i16 %x, %y
22 ; GCN-LABEL: {{^}}ashr_i16:
23 ; GCN: v_ashrrev_i16_e{{32|64}} [[OP:v[0-9]+]],
24 ; GFX9-NEXT: s_setpc_b64
25 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
26 define i16 @ashr_i16(i16 %x, i16 %y) {
27 %res = ashr i16 %x, %y
31 ; GCN-LABEL: {{^}}add_u16:
32 ; GCN: v_add_{{(nc_)*}}u16_e{{32|64}} [[OP:v[0-9]+]],
33 ; GFX9-NEXT: s_setpc_b64
34 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
35 define i16 @add_u16(i16 %x, i16 %y) {
40 ; GCN-LABEL: {{^}}sub_u16:
41 ; GCN: v_sub_{{(nc_)*}}u16_e{{32|64}} [[OP:v[0-9]+]],
42 ; GFX9-NEXT: s_setpc_b64
43 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
44 define i16 @sub_u16(i16 %x, i16 %y) {
49 ; GCN-LABEL: {{^}}mul_lo_u16:
50 ; GCN: v_mul_lo_u16_e{{32|64}} [[OP:v[0-9]+]],
51 ; GFX9-NEXT: s_setpc_b64
52 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
53 define i16 @mul_lo_u16(i16 %x, i16 %y) {
58 ; GCN-LABEL: {{^}}min_u16:
59 ; GCN: v_min_u16_e{{32|64}} [[OP:v[0-9]+]],
60 ; GFX9-NEXT: s_setpc_b64
61 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
62 define i16 @min_u16(i16 %x, i16 %y) {
63 %cmp = icmp ule i16 %x, %y
64 %res = select i1 %cmp, i16 %x, i16 %y
68 ; GCN-LABEL: {{^}}min_i16:
69 ; GCN: v_min_i16_e{{32|64}} [[OP:v[0-9]+]],
70 ; GFX9-NEXT: s_setpc_b64
71 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
72 define i16 @min_i16(i16 %x, i16 %y) {
73 %cmp = icmp sle i16 %x, %y
74 %res = select i1 %cmp, i16 %x, i16 %y
78 ; GCN-LABEL: {{^}}max_u16:
79 ; GCN: v_max_u16_e{{32|64}} [[OP:v[0-9]+]],
80 ; GFX9-NEXT: s_setpc_b64
81 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
82 define i16 @max_u16(i16 %x, i16 %y) {
83 %cmp = icmp uge i16 %x, %y
84 %res = select i1 %cmp, i16 %x, i16 %y
88 ; GCN-LABEL: {{^}}max_i16:
89 ; GCN: v_max_i16_e{{32|64}} [[OP:v[0-9]+]],
90 ; GFX9-NEXT: s_setpc_b64
91 ; GFX10: v_and_b32_e32 v{{[0-9]+}}, 0xffff, [[OP]]
92 define i16 @max_i16(i16 %x, i16 %y) {
93 %cmp = icmp sge i16 %x, %y
94 %res = select i1 %cmp, i16 %x, i16 %y