comparison gcc/optabs-query.h @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children 1830386684a0
comparison
equal deleted inserted replaced
130:e108057fa461 132:d34655255c78
1 /* IR-agnostic target query functions relating to optabs 1 /* IR-agnostic target query functions relating to optabs
2 Copyright (C) 2001-2017 Free Software Foundation, Inc. 2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify 6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
21 #define GCC_OPTABS_QUERY_H 21 #define GCC_OPTABS_QUERY_H
22 22
23 #include "insn-opinit.h" 23 #include "insn-opinit.h"
24 #include "target.h" 24 #include "target.h"
25 25
26 /* Return true if OP is a conversion optab. */
27
28 inline bool
29 convert_optab_p (optab op)
30 {
31 return op > unknown_optab && op <= LAST_CONV_OPTAB;
32 }
33
26 /* Return the insn used to implement mode MODE of OP, or CODE_FOR_nothing 34 /* Return the insn used to implement mode MODE of OP, or CODE_FOR_nothing
27 if the target does not have such an insn. */ 35 if the target does not have such an insn. */
28 36
29 inline enum insn_code 37 inline enum insn_code
30 optab_handler (optab op, machine_mode mode) 38 optab_handler (optab op, machine_mode mode)
41 inline enum insn_code 49 inline enum insn_code
42 convert_optab_handler (convert_optab op, machine_mode to_mode, 50 convert_optab_handler (convert_optab op, machine_mode to_mode,
43 machine_mode from_mode) 51 machine_mode from_mode)
44 { 52 {
45 unsigned scode = (op << 16) | (from_mode << 8) | to_mode; 53 unsigned scode = (op << 16) | (from_mode << 8) | to_mode;
46 gcc_assert (op > unknown_optab && op <= LAST_CONV_OPTAB); 54 gcc_assert (convert_optab_p (op));
47 return raw_optab_handler (scode); 55 return raw_optab_handler (scode);
48 } 56 }
49 57
50 enum insn_code convert_optab_handler (convert_optab, machine_mode, 58 enum insn_code convert_optab_handler (convert_optab, machine_mode,
51 machine_mode, optimization_type); 59 machine_mode, optimization_type);
164 172
165 enum insn_code can_extend_p (machine_mode, machine_mode, int); 173 enum insn_code can_extend_p (machine_mode, machine_mode, int);
166 enum insn_code can_float_p (machine_mode, machine_mode, int); 174 enum insn_code can_float_p (machine_mode, machine_mode, int);
167 enum insn_code can_fix_p (machine_mode, machine_mode, int, bool *); 175 enum insn_code can_fix_p (machine_mode, machine_mode, int, bool *);
168 bool can_conditionally_move_p (machine_mode mode); 176 bool can_conditionally_move_p (machine_mode mode);
169 bool can_vec_perm_p (machine_mode, bool, vec_perm_indices *); 177 opt_machine_mode qimode_for_vec_perm (machine_mode);
170 enum insn_code widening_optab_handler (optab, machine_mode, machine_mode); 178 bool selector_fits_mode_p (machine_mode, const vec_perm_indices &);
179 bool can_vec_perm_var_p (machine_mode);
180 bool can_vec_perm_const_p (machine_mode, const vec_perm_indices &,
181 bool = true);
171 /* Find a widening optab even if it doesn't widen as much as we want. */ 182 /* Find a widening optab even if it doesn't widen as much as we want. */
172 #define find_widening_optab_handler(A,B,C,D) \ 183 #define find_widening_optab_handler(A, B, C) \
173 find_widening_optab_handler_and_mode (A, B, C, D, NULL) 184 find_widening_optab_handler_and_mode (A, B, C, NULL)
174 enum insn_code find_widening_optab_handler_and_mode (optab, machine_mode, 185 enum insn_code find_widening_optab_handler_and_mode (optab, machine_mode,
175 machine_mode, int, 186 machine_mode,
176 machine_mode *); 187 machine_mode *);
177 int can_mult_highpart_p (machine_mode, bool); 188 int can_mult_highpart_p (machine_mode, bool);
178 bool can_vec_mask_load_store_p (machine_mode, machine_mode, bool); 189 bool can_vec_mask_load_store_p (machine_mode, machine_mode, bool);
179 bool can_compare_and_swap_p (machine_mode, bool); 190 bool can_compare_and_swap_p (machine_mode, bool);
180 bool can_atomic_exchange_p (machine_mode, bool); 191 bool can_atomic_exchange_p (machine_mode, bool);
181 bool can_atomic_load_p (machine_mode); 192 bool can_atomic_load_p (machine_mode);
182 bool lshift_cheap_p (bool); 193 bool lshift_cheap_p (bool);
194 bool supports_vec_gather_load_p ();
195 bool supports_vec_scatter_store_p ();
196
197 /* Version of find_widening_optab_handler_and_mode that operates on
198 specific mode types. */
199
200 template<typename T>
201 inline enum insn_code
202 find_widening_optab_handler_and_mode (optab op, const T &to_mode,
203 const T &from_mode, T *found_mode)
204 {
205 machine_mode tmp;
206 enum insn_code icode = find_widening_optab_handler_and_mode
207 (op, machine_mode (to_mode), machine_mode (from_mode), &tmp);
208 if (icode != CODE_FOR_nothing && found_mode)
209 *found_mode = as_a <T> (tmp);
210 return icode;
211 }
183 212
184 #endif 213 #endif