1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=fiji -verify-machineinstrs | FileCheck -check-prefix=VI %s
3 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx900 -verify-machineinstrs | FileCheck -check-prefix=GFX9 %s
4 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx1010 -verify-machineinstrs | FileCheck -check-prefix=GFX10 %s
5 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -verify-machineinstrs | FileCheck -check-prefix=GFX10 %s
7 ; ===================================================================================
9 ; ===================================================================================
11 define amdgpu_ps float @xor_add(i32 %a, i32 %b, i32 %c) {
14 ; VI-NEXT: v_xor_b32_e32 v0, v0, v1
15 ; VI-NEXT: v_add_u32_e32 v0, vcc, v0, v2
16 ; VI-NEXT: ; return to shader part epilog
18 ; GFX9-LABEL: xor_add:
20 ; GFX9-NEXT: v_xad_u32 v0, v0, v1, v2
21 ; GFX9-NEXT: ; return to shader part epilog
23 ; GFX10-LABEL: xor_add:
25 ; GFX10-NEXT: v_xad_u32 v0, v0, v1, v2
26 ; GFX10-NEXT: ; return to shader part epilog
28 %result = add i32 %x, %c
29 %bc = bitcast i32 %result to float
33 ; ThreeOp instruction variant not used due to Constant Bus Limitations
34 define amdgpu_ps float @xor_add_vgpr_a(i32 %a, i32 inreg %b, i32 inreg %c) {
35 ; VI-LABEL: xor_add_vgpr_a:
37 ; VI-NEXT: v_xor_b32_e32 v0, s2, v0
38 ; VI-NEXT: v_add_u32_e32 v0, vcc, s3, v0
39 ; VI-NEXT: ; return to shader part epilog
41 ; GFX9-LABEL: xor_add_vgpr_a:
43 ; GFX9-NEXT: v_xor_b32_e32 v0, s2, v0
44 ; GFX9-NEXT: v_add_u32_e32 v0, s3, v0
45 ; GFX9-NEXT: ; return to shader part epilog
47 ; GFX10-LABEL: xor_add_vgpr_a:
49 ; GFX10-NEXT: v_xad_u32 v0, v0, s2, s3
50 ; GFX10-NEXT: ; return to shader part epilog
52 %result = add i32 %x, %c
53 %bc = bitcast i32 %result to float
57 define amdgpu_ps float @xor_add_vgpr_all(i32 %a, i32 %b, i32 %c) {
58 ; VI-LABEL: xor_add_vgpr_all:
60 ; VI-NEXT: v_xor_b32_e32 v0, v0, v1
61 ; VI-NEXT: v_add_u32_e32 v0, vcc, v0, v2
62 ; VI-NEXT: ; return to shader part epilog
64 ; GFX9-LABEL: xor_add_vgpr_all:
66 ; GFX9-NEXT: v_xad_u32 v0, v0, v1, v2
67 ; GFX9-NEXT: ; return to shader part epilog
69 ; GFX10-LABEL: xor_add_vgpr_all:
71 ; GFX10-NEXT: v_xad_u32 v0, v0, v1, v2
72 ; GFX10-NEXT: ; return to shader part epilog
74 %result = add i32 %x, %c
75 %bc = bitcast i32 %result to float
79 define amdgpu_ps float @xor_add_vgpr_ab(i32 %a, i32 %b, i32 inreg %c) {
80 ; VI-LABEL: xor_add_vgpr_ab:
82 ; VI-NEXT: v_xor_b32_e32 v0, v0, v1
83 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
84 ; VI-NEXT: ; return to shader part epilog
86 ; GFX9-LABEL: xor_add_vgpr_ab:
88 ; GFX9-NEXT: v_xad_u32 v0, v0, v1, s2
89 ; GFX9-NEXT: ; return to shader part epilog
91 ; GFX10-LABEL: xor_add_vgpr_ab:
93 ; GFX10-NEXT: v_xad_u32 v0, v0, v1, s2
94 ; GFX10-NEXT: ; return to shader part epilog
96 %result = add i32 %x, %c
97 %bc = bitcast i32 %result to float
101 define amdgpu_ps float @xor_add_vgpr_const(i32 %a, i32 %b) {
102 ; VI-LABEL: xor_add_vgpr_const:
104 ; VI-NEXT: v_xor_b32_e32 v0, 3, v0
105 ; VI-NEXT: v_add_u32_e32 v0, vcc, v0, v1
106 ; VI-NEXT: ; return to shader part epilog
108 ; GFX9-LABEL: xor_add_vgpr_const:
110 ; GFX9-NEXT: v_xad_u32 v0, v0, 3, v1
111 ; GFX9-NEXT: ; return to shader part epilog
113 ; GFX10-LABEL: xor_add_vgpr_const:
115 ; GFX10-NEXT: v_xad_u32 v0, v0, 3, v1
116 ; GFX10-NEXT: ; return to shader part epilog
118 %result = add i32 %x, %b
119 %bc = bitcast i32 %result to float