1 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s 2 ; RUN: llc -march=r600 -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s 3 4 ; FUNC-LABEL: @test2 5 ; EG: AND_INT {{\*? *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 6 ; EG: AND_INT {{\*? *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 7 8 ; SI: V_AND_B32_e32 v{{[0-9]+, v[0-9]+, v[0-9]+}} 9 ; SI: V_AND_B32_e32 v{{[0-9]+, v[0-9]+, v[0-9]+}} 10 11 define void @test2(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %in) { 12 %b_ptr = getelementptr <2 x i32> addrspace(1)* %in, i32 1 13 %a = load <2 x i32> addrspace(1) * %in 14 %b = load <2 x i32> addrspace(1) * %b_ptr 15 %result = and <2 x i32> %a, %b 16 store <2 x i32> %result, <2 x i32> addrspace(1)* %out 17 ret void 18 } 19 20 ; FUNC-LABEL: @test4 21 ; EG: AND_INT {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 22 ; EG: AND_INT {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 23 ; EG: AND_INT {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 24 ; EG: AND_INT {{\** *}}T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 25 26 ; SI: V_AND_B32_e32 v{{[0-9]+, v[0-9]+, v[0-9]+}} 27 ; SI: V_AND_B32_e32 v{{[0-9]+, v[0-9]+, v[0-9]+}} 28 ; SI: V_AND_B32_e32 v{{[0-9]+, v[0-9]+, v[0-9]+}} 29 ; SI: V_AND_B32_e32 v{{[0-9]+, v[0-9]+, v[0-9]+}} 30 31 define void @test4(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) { 32 %b_ptr = getelementptr <4 x i32> addrspace(1)* %in, i32 1 33 %a = load <4 x i32> addrspace(1) * %in 34 %b = load <4 x i32> addrspace(1) * %b_ptr 35 %result = and <4 x i32> %a, %b 36 store <4 x i32> %result, <4 x i32> addrspace(1)* %out 37 ret void 38 } 39 40 ; FUNC-LABEL: @s_and_i32 41 ; SI: S_AND_B32 42 define void @s_and_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) { 43 %and = and i32 %a, %b 44 store i32 %and, i32 addrspace(1)* %out, align 4 45 ret void 46 } 47 48 ; FUNC-LABEL: @s_and_constant_i32 49 ; SI: S_AND_B32 s{{[0-9]+}}, s{{[0-9]+}}, 0x12d687 50 define void @s_and_constant_i32(i32 addrspace(1)* %out, i32 %a) { 51 %and = and i32 %a, 1234567 52 store i32 %and, i32 addrspace(1)* %out, align 4 53 ret void 54 } 55 56 ; FUNC-LABEL: @v_and_i32 57 ; SI: V_AND_B32 58 define void @v_and_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %aptr, i32 addrspace(1)* %bptr) { 59 %a = load i32 addrspace(1)* %aptr, align 4 60 %b = load i32 addrspace(1)* %bptr, align 4 61 %and = and i32 %a, %b 62 store i32 %and, i32 addrspace(1)* %out, align 4 63 ret void 64 } 65 66 ; FUNC-LABEL: @v_and_constant_i32 67 ; SI: V_AND_B32 68 define void @v_and_constant_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %aptr) { 69 %a = load i32 addrspace(1)* %aptr, align 4 70 %and = and i32 %a, 1234567 71 store i32 %and, i32 addrspace(1)* %out, align 4 72 ret void 73 } 74 75 ; FUNC-LABEL: @s_and_i64 76 ; SI: S_AND_B64 77 define void @s_and_i64(i64 addrspace(1)* %out, i64 %a, i64 %b) { 78 %and = and i64 %a, %b 79 store i64 %and, i64 addrspace(1)* %out, align 8 80 ret void 81 } 82 83 ; FUNC-LABEL: @s_and_constant_i64 84 ; SI: S_AND_B64 85 define void @s_and_constant_i64(i64 addrspace(1)* %out, i64 %a) { 86 %and = and i64 %a, 281474976710655 87 store i64 %and, i64 addrspace(1)* %out, align 8 88 ret void 89 } 90 91 ; FUNC-LABEL: @v_and_i64 92 ; SI: V_AND_B32 93 ; SI: V_AND_B32 94 define void @v_and_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %aptr, i64 addrspace(1)* %bptr) { 95 %a = load i64 addrspace(1)* %aptr, align 8 96 %b = load i64 addrspace(1)* %bptr, align 8 97 %and = and i64 %a, %b 98 store i64 %and, i64 addrspace(1)* %out, align 8 99 ret void 100 } 101 102 ; FUNC-LABEL: @v_and_constant_i64 103 ; SI: V_AND_B32 104 ; SI: V_AND_B32 105 define void @v_and_constant_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %aptr) { 106 %a = load i64 addrspace(1)* %aptr, align 8 107 %and = and i64 %a, 1234567 108 store i64 %and, i64 addrspace(1)* %out, align 8 109 ret void 110 } 111