Matt Arsenault | a949dc6 | 2016-05-09 16:29:50 +0000 | [diff] [blame^] | 1 | ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s |
Marek Olsak | 7517077 | 2015-01-27 17:27:15 +0000 | [diff] [blame] | 2 | ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 3 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 4 | ; SI-LABEL: {{^}}load_i8_to_f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 5 | ; SI: buffer_load_ubyte [[LOADREG:v[0-9]+]], |
| 6 | ; SI-NOT: bfe |
| 7 | ; SI-NOT: lshr |
| 8 | ; SI: v_cvt_f32_ubyte0_e32 [[CONV:v[0-9]+]], [[LOADREG]] |
| 9 | ; SI: buffer_store_dword [[CONV]], |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 10 | define void @load_i8_to_f32(float addrspace(1)* noalias %out, i8 addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 11 | %load = load i8, i8 addrspace(1)* %in, align 1 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 12 | %cvt = uitofp i8 %load to float |
| 13 | store float %cvt, float addrspace(1)* %out, align 4 |
| 14 | ret void |
| 15 | } |
| 16 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 17 | ; SI-LABEL: {{^}}load_v2i8_to_v2f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 18 | ; SI: buffer_load_ushort [[LOADREG:v[0-9]+]], |
| 19 | ; SI-NOT: bfe |
| 20 | ; SI-NOT: lshr |
| 21 | ; SI-NOT: and |
| 22 | ; SI-DAG: v_cvt_f32_ubyte1_e32 v[[HIRESULT:[0-9]+]], [[LOADREG]] |
| 23 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v[[LORESULT:[0-9]+]], [[LOADREG]] |
| 24 | ; SI: buffer_store_dwordx2 v{{\[}}[[LORESULT]]:[[HIRESULT]]{{\]}}, |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 25 | define void @load_v2i8_to_v2f32(<2 x float> addrspace(1)* noalias %out, <2 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 26 | %load = load <2 x i8>, <2 x i8> addrspace(1)* %in, align 2 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 27 | %cvt = uitofp <2 x i8> %load to <2 x float> |
| 28 | store <2 x float> %cvt, <2 x float> addrspace(1)* %out, align 16 |
| 29 | ret void |
| 30 | } |
| 31 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 32 | ; SI-LABEL: {{^}}load_v3i8_to_v3f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 33 | ; SI-NOT: bfe |
| 34 | ; SI-NOT: v_cvt_f32_ubyte3_e32 |
| 35 | ; SI-DAG: v_cvt_f32_ubyte2_e32 |
Nicolai Haehnle | df77c9a | 2016-04-12 21:18:10 +0000 | [diff] [blame] | 36 | ; SI-DAG: v_cvt_f32_ubyte1_e32 v[[HIRESULT:[0-9]+]], |
| 37 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v[[LORESULT:[0-9]+]], |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 38 | ; SI: buffer_store_dwordx2 v{{\[}}[[LORESULT]]:[[HIRESULT]]{{\]}}, |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 39 | define void @load_v3i8_to_v3f32(<3 x float> addrspace(1)* noalias %out, <3 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 40 | %load = load <3 x i8>, <3 x i8> addrspace(1)* %in, align 4 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 41 | %cvt = uitofp <3 x i8> %load to <3 x float> |
| 42 | store <3 x float> %cvt, <3 x float> addrspace(1)* %out, align 16 |
| 43 | ret void |
| 44 | } |
| 45 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 46 | ; SI-LABEL: {{^}}load_v4i8_to_v4f32: |
Matt Arsenault | bd22342 | 2015-01-14 01:35:17 +0000 | [diff] [blame] | 47 | ; SI: buffer_load_dword [[LOADREG:v[0-9]+]] |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 48 | ; SI-NOT: bfe |
| 49 | ; SI-NOT: lshr |
| 50 | ; SI-DAG: v_cvt_f32_ubyte3_e32 v[[HIRESULT:[0-9]+]], [[LOADREG]] |
| 51 | ; SI-DAG: v_cvt_f32_ubyte2_e32 v{{[0-9]+}}, [[LOADREG]] |
| 52 | ; SI-DAG: v_cvt_f32_ubyte1_e32 v{{[0-9]+}}, [[LOADREG]] |
| 53 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v[[LORESULT:[0-9]+]], [[LOADREG]] |
| 54 | ; SI: buffer_store_dwordx4 v{{\[}}[[LORESULT]]:[[HIRESULT]]{{\]}}, |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 55 | define void @load_v4i8_to_v4f32(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 56 | %load = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4 |
Matt Arsenault | bd22342 | 2015-01-14 01:35:17 +0000 | [diff] [blame] | 57 | %cvt = uitofp <4 x i8> %load to <4 x float> |
| 58 | store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16 |
| 59 | ret void |
| 60 | } |
| 61 | |
| 62 | ; This should not be adding instructions to shift into the correct |
| 63 | ; position in the word for the component. |
| 64 | |
| 65 | ; SI-LABEL: {{^}}load_v4i8_to_v4f32_unaligned: |
Matt Arsenault | bd22342 | 2015-01-14 01:35:17 +0000 | [diff] [blame] | 66 | ; SI: buffer_load_ubyte [[LOADREG3:v[0-9]+]] |
Tom Stellard | 83f0bce | 2015-01-29 16:55:25 +0000 | [diff] [blame] | 67 | ; SI: buffer_load_ubyte [[LOADREG2:v[0-9]+]] |
| 68 | ; SI: buffer_load_ubyte [[LOADREG1:v[0-9]+]] |
| 69 | ; SI: buffer_load_ubyte [[LOADREG0:v[0-9]+]] |
Matt Arsenault | e698663 | 2015-01-14 01:35:22 +0000 | [diff] [blame] | 70 | ; SI-NOT: v_lshlrev_b32 |
| 71 | ; SI-NOT: v_or_b32 |
Matt Arsenault | bd22342 | 2015-01-14 01:35:17 +0000 | [diff] [blame] | 72 | |
Matt Arsenault | e698663 | 2015-01-14 01:35:22 +0000 | [diff] [blame] | 73 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v[[LORESULT:[0-9]+]], [[LOADREG0]] |
| 74 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v{{[0-9]+}}, [[LOADREG1]] |
| 75 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v{{[0-9]+}}, [[LOADREG2]] |
| 76 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v[[HIRESULT:[0-9]+]], [[LOADREG3]] |
Matt Arsenault | bd22342 | 2015-01-14 01:35:17 +0000 | [diff] [blame] | 77 | |
| 78 | ; SI: buffer_store_dwordx4 v{{\[}}[[LORESULT]]:[[HIRESULT]]{{\]}}, |
| 79 | define void @load_v4i8_to_v4f32_unaligned(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 80 | %load = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 1 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 81 | %cvt = uitofp <4 x i8> %load to <4 x float> |
| 82 | store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16 |
| 83 | ret void |
| 84 | } |
| 85 | |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 86 | ; XXX - This should really still be able to use the v_cvt_f32_ubyte0 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 87 | ; for each component, but computeKnownBits doesn't handle vectors very |
| 88 | ; well. |
| 89 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 90 | ; SI-LABEL: {{^}}load_v4i8_to_v4f32_2_uses: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 91 | ; SI: buffer_load_ubyte |
| 92 | ; SI: buffer_load_ubyte |
| 93 | ; SI: buffer_load_ubyte |
| 94 | ; SI: buffer_load_ubyte |
| 95 | ; SI: v_cvt_f32_ubyte0_e32 |
| 96 | ; SI: v_cvt_f32_ubyte0_e32 |
| 97 | ; SI: v_cvt_f32_ubyte0_e32 |
| 98 | ; SI: v_cvt_f32_ubyte0_e32 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 99 | |
| 100 | ; XXX - replace with this when v4i8 loads aren't scalarized anymore. |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 101 | ; XSI: buffer_load_dword |
| 102 | ; XSI: v_cvt_f32_u32_e32 |
| 103 | ; XSI: v_cvt_f32_u32_e32 |
| 104 | ; XSI: v_cvt_f32_u32_e32 |
| 105 | ; XSI: v_cvt_f32_u32_e32 |
| 106 | ; SI: s_endpgm |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 107 | define void @load_v4i8_to_v4f32_2_uses(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %out2, <4 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 108 | %load = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 109 | %cvt = uitofp <4 x i8> %load to <4 x float> |
| 110 | store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16 |
| 111 | %add = add <4 x i8> %load, <i8 9, i8 9, i8 9, i8 9> ; Second use of %load |
| 112 | store <4 x i8> %add, <4 x i8> addrspace(1)* %out2, align 4 |
| 113 | ret void |
| 114 | } |
| 115 | |
| 116 | ; Make sure this doesn't crash. |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 117 | ; SI-LABEL: {{^}}load_v7i8_to_v7f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 118 | ; SI: s_endpgm |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 119 | define void @load_v7i8_to_v7f32(<7 x float> addrspace(1)* noalias %out, <7 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 120 | %load = load <7 x i8>, <7 x i8> addrspace(1)* %in, align 1 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 121 | %cvt = uitofp <7 x i8> %load to <7 x float> |
| 122 | store <7 x float> %cvt, <7 x float> addrspace(1)* %out, align 16 |
| 123 | ret void |
| 124 | } |
| 125 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 126 | ; SI-LABEL: {{^}}load_v8i8_to_v8f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 127 | ; SI: buffer_load_dwordx2 v{{\[}}[[LOLOAD:[0-9]+]]:[[HILOAD:[0-9]+]]{{\]}}, |
| 128 | ; SI-NOT: bfe |
| 129 | ; SI-NOT: lshr |
| 130 | ; SI-DAG: v_cvt_f32_ubyte3_e32 v{{[0-9]+}}, v[[LOLOAD]] |
| 131 | ; SI-DAG: v_cvt_f32_ubyte2_e32 v{{[0-9]+}}, v[[LOLOAD]] |
| 132 | ; SI-DAG: v_cvt_f32_ubyte1_e32 v{{[0-9]+}}, v[[LOLOAD]] |
| 133 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v{{[0-9]+}}, v[[LOLOAD]] |
| 134 | ; SI-DAG: v_cvt_f32_ubyte3_e32 v{{[0-9]+}}, v[[HILOAD]] |
| 135 | ; SI-DAG: v_cvt_f32_ubyte2_e32 v{{[0-9]+}}, v[[HILOAD]] |
| 136 | ; SI-DAG: v_cvt_f32_ubyte1_e32 v{{[0-9]+}}, v[[HILOAD]] |
| 137 | ; SI-DAG: v_cvt_f32_ubyte0_e32 v{{[0-9]+}}, v[[HILOAD]] |
| 138 | ; SI-NOT: bfe |
| 139 | ; SI-NOT: lshr |
Matt Arsenault | 4d801cd | 2015-11-24 12:05:03 +0000 | [diff] [blame] | 140 | ; SI: buffer_store_dwordx4 |
| 141 | ; SI: buffer_store_dwordx4 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 142 | define void @load_v8i8_to_v8f32(<8 x float> addrspace(1)* noalias %out, <8 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 143 | %load = load <8 x i8>, <8 x i8> addrspace(1)* %in, align 8 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 144 | %cvt = uitofp <8 x i8> %load to <8 x float> |
| 145 | store <8 x float> %cvt, <8 x float> addrspace(1)* %out, align 16 |
| 146 | ret void |
| 147 | } |
| 148 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 149 | ; SI-LABEL: {{^}}i8_zext_inreg_i32_to_f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 150 | ; SI: buffer_load_dword [[LOADREG:v[0-9]+]], |
Matt Arsenault | e4d0c14 | 2015-08-29 07:16:50 +0000 | [diff] [blame] | 151 | ; SI: v_add_i32_e32 [[ADD:v[0-9]+]], vcc, 2, [[LOADREG]] |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 152 | ; SI-NEXT: v_cvt_f32_ubyte0_e32 [[CONV:v[0-9]+]], [[ADD]] |
| 153 | ; SI: buffer_store_dword [[CONV]], |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 154 | define void @i8_zext_inreg_i32_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 155 | %load = load i32, i32 addrspace(1)* %in, align 4 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 156 | %add = add i32 %load, 2 |
| 157 | %inreg = and i32 %add, 255 |
| 158 | %cvt = uitofp i32 %inreg to float |
| 159 | store float %cvt, float addrspace(1)* %out, align 4 |
| 160 | ret void |
| 161 | } |
| 162 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 163 | ; SI-LABEL: {{^}}i8_zext_inreg_hi1_to_f32: |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 164 | define void @i8_zext_inreg_hi1_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 165 | %load = load i32, i32 addrspace(1)* %in, align 4 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 166 | %inreg = and i32 %load, 65280 |
| 167 | %shr = lshr i32 %inreg, 8 |
| 168 | %cvt = uitofp i32 %shr to float |
| 169 | store float %cvt, float addrspace(1)* %out, align 4 |
| 170 | ret void |
| 171 | } |
| 172 | |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 173 | ; We don't get these ones because of the zext, but instcombine removes |
| 174 | ; them so it shouldn't really matter. |
Matt Arsenault | a949dc6 | 2016-05-09 16:29:50 +0000 | [diff] [blame^] | 175 | ; SI-LABEL: {{^}}i8_zext_i32_to_f32: |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 176 | define void @i8_zext_i32_to_f32(float addrspace(1)* noalias %out, i8 addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 177 | %load = load i8, i8 addrspace(1)* %in, align 1 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 178 | %ext = zext i8 %load to i32 |
| 179 | %cvt = uitofp i32 %ext to float |
| 180 | store float %cvt, float addrspace(1)* %out, align 4 |
| 181 | ret void |
| 182 | } |
| 183 | |
Matt Arsenault | a949dc6 | 2016-05-09 16:29:50 +0000 | [diff] [blame^] | 184 | ; SI-LABEL: {{^}}v4i8_zext_v4i32_to_v4f32: |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 185 | define void @v4i8_zext_v4i32_to_v4f32(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %in) nounwind { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 186 | %load = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 1 |
Matt Arsenault | 364a674 | 2014-06-11 17:50:44 +0000 | [diff] [blame] | 187 | %ext = zext <4 x i8> %load to <4 x i32> |
| 188 | %cvt = uitofp <4 x i32> %ext to <4 x float> |
| 189 | store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16 |
| 190 | ret void |
| 191 | } |
Matt Arsenault | a949dc6 | 2016-05-09 16:29:50 +0000 | [diff] [blame^] | 192 | |
| 193 | ; SI-LABEL: {{^}}extract_byte0_to_f32: |
| 194 | ; SI: buffer_load_dword [[VAL:v[0-9]+]] |
| 195 | ; SI-NOT: [[VAL]] |
| 196 | ; SI: v_cvt_f32_ubyte0_e32 [[CONV:v[0-9]+]], [[VAL]] |
| 197 | ; SI: buffer_store_dword [[CONV]] |
| 198 | define void @extract_byte0_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind { |
| 199 | %val = load i32, i32 addrspace(1)* %in |
| 200 | %and = and i32 %val, 255 |
| 201 | %cvt = uitofp i32 %and to float |
| 202 | store float %cvt, float addrspace(1)* %out |
| 203 | ret void |
| 204 | } |
| 205 | |
| 206 | ; SI-LABEL: {{^}}extract_byte1_to_f32: |
| 207 | ; SI: buffer_load_dword [[VAL:v[0-9]+]] |
| 208 | ; SI-NOT: [[VAL]] |
| 209 | ; SI: v_cvt_f32_ubyte1_e32 [[CONV:v[0-9]+]], [[VAL]] |
| 210 | ; SI: buffer_store_dword [[CONV]] |
| 211 | define void @extract_byte1_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind { |
| 212 | %val = load i32, i32 addrspace(1)* %in |
| 213 | %srl = lshr i32 %val, 8 |
| 214 | %and = and i32 %srl, 255 |
| 215 | %cvt = uitofp i32 %and to float |
| 216 | store float %cvt, float addrspace(1)* %out |
| 217 | ret void |
| 218 | } |
| 219 | |
| 220 | ; SI-LABEL: {{^}}extract_byte2_to_f32: |
| 221 | ; SI: buffer_load_dword [[VAL:v[0-9]+]] |
| 222 | ; SI-NOT: [[VAL]] |
| 223 | ; SI: v_cvt_f32_ubyte2_e32 [[CONV:v[0-9]+]], [[VAL]] |
| 224 | ; SI: buffer_store_dword [[CONV]] |
| 225 | define void @extract_byte2_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind { |
| 226 | %val = load i32, i32 addrspace(1)* %in |
| 227 | %srl = lshr i32 %val, 16 |
| 228 | %and = and i32 %srl, 255 |
| 229 | %cvt = uitofp i32 %and to float |
| 230 | store float %cvt, float addrspace(1)* %out |
| 231 | ret void |
| 232 | } |
| 233 | |
| 234 | ; SI-LABEL: {{^}}extract_byte3_to_f32: |
| 235 | ; SI: buffer_load_dword [[VAL:v[0-9]+]] |
| 236 | ; SI-NOT: [[VAL]] |
| 237 | ; SI: v_cvt_f32_ubyte3_e32 [[CONV:v[0-9]+]], [[VAL]] |
| 238 | ; SI: buffer_store_dword [[CONV]] |
| 239 | define void @extract_byte3_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind { |
| 240 | %val = load i32, i32 addrspace(1)* %in |
| 241 | %srl = lshr i32 %val, 24 |
| 242 | %and = and i32 %srl, 255 |
| 243 | %cvt = uitofp i32 %and to float |
| 244 | store float %cvt, float addrspace(1)* %out |
| 245 | ret void |
| 246 | } |