comparison gcc/brig/brigfrontend/brig-cmp-inst-handler.cc @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* brig-cmp-inst-handler.cc -- brig cmp instruction handling 1 /* brig-cmp-inst-handler.cc -- brig cmp instruction handling
2 Copyright (C) 2016-2017 Free Software Foundation, Inc. 2 Copyright (C) 2016-2018 Free Software Foundation, Inc.
3 Contributed by Pekka Jaaskelainen <pekka.jaaskelainen@parmance.com> 3 Contributed by Pekka Jaaskelainen <pekka.jaaskelainen@parmance.com>
4 for General Processor Tech. 4 for General Processor Tech.
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
178 { 178 {
179 /* Because F16 comparison is emulated as an F32 comparison with S32 179 /* Because F16 comparison is emulated as an F32 comparison with S32
180 results, we must now truncate the result vector to S16s so it 180 results, we must now truncate the result vector to S16s so it
181 fits to the destination register. We can build the target vector 181 fits to the destination register. We can build the target vector
182 type from the f16 storage type (unsigned ints). */ 182 type from the f16 storage type (unsigned ints). */
183 expr = add_temp_var ("wide_cmp_result", expr); 183 expr = m_parent.m_cf->add_temp_var ("wide_cmp_result", expr);
184 tree_stl_vec wide_elements; 184 tree_stl_vec wide_elements;
185 tree_stl_vec shrunk_elements; 185 tree_stl_vec shrunk_elements;
186 unpack (expr, wide_elements); 186 m_parent.m_cf->unpack (expr, wide_elements);
187 for (size_t i = 0; i < wide_elements.size (); ++i) 187 for (size_t i = 0; i < wide_elements.size (); ++i)
188 { 188 {
189 tree wide = wide_elements.at (i); 189 tree wide = wide_elements.at (i);
190 shrunk_elements.push_back 190 shrunk_elements.push_back
191 (convert_to_integer (short_integer_type_node, wide)); 191 (convert_to_integer (short_integer_type_node, wide));
192 } 192 }
193 expr = pack (shrunk_elements); 193 expr = m_parent.m_cf->pack (shrunk_elements);
194 } 194 }
195 build_output_assignment (*inst_base, operands[0], expr); 195 build_output_assignment (*inst_base, operands[0], expr);
196 196
197 return base->byteCount; 197 return base->byteCount;
198 } 198 }