comparison gcc/optabs.h @ 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 /* Definitions for code generation pass of GNU compiler. 1 /* Definitions for code generation pass of GNU compiler.
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
20 #ifndef GCC_OPTABS_H 20 #ifndef GCC_OPTABS_H
21 #define GCC_OPTABS_H 21 #define GCC_OPTABS_H
22 22
23 #include "optabs-query.h" 23 #include "optabs-query.h"
24 #include "optabs-libfuncs.h" 24 #include "optabs-libfuncs.h"
25 #include "vec-perm-indices.h"
25 26
26 /* Generate code for a widening multiply. */ 27 /* Generate code for a widening multiply. */
27 extern rtx expand_widening_mult (machine_mode, rtx, rtx, rtx, int, optab); 28 extern rtx expand_widening_mult (machine_mode, rtx, rtx, rtx, int, optab);
28 29
29 /* Describes the type of an expand_operand. Each value is associated 30 /* Describes the type of an expand_operand. Each value is associated
58 type-dependent meaning. */ 59 type-dependent meaning. */
59 ENUM_BITFIELD (machine_mode) mode : 16; 60 ENUM_BITFIELD (machine_mode) mode : 16;
60 61
61 /* The value of the operand. */ 62 /* The value of the operand. */
62 rtx value; 63 rtx value;
64
65 /* The value of an EXPAND_INTEGER operand. */
66 poly_int64 int_value;
63 }; 67 };
64 68
65 /* Initialize OP with the given fields. Initialise the other fields 69 /* Initialize OP with the given fields. Initialise the other fields
66 to their default values. */ 70 to their default values. */
67 71
68 static inline void 72 static inline void
69 create_expand_operand (struct expand_operand *op, 73 create_expand_operand (struct expand_operand *op,
70 enum expand_operand_type type, 74 enum expand_operand_type type,
71 rtx value, machine_mode mode, 75 rtx value, machine_mode mode,
72 bool unsigned_p) 76 bool unsigned_p, poly_int64 int_value = 0)
73 { 77 {
74 op->type = type; 78 op->type = type;
75 op->unsigned_p = unsigned_p; 79 op->unsigned_p = unsigned_p;
76 op->unused = 0; 80 op->unused = 0;
77 op->mode = mode; 81 op->mode = mode;
78 op->value = value; 82 op->value = value;
83 op->int_value = int_value;
79 } 84 }
80 85
81 /* Make OP describe an operand that must use rtx X, even if X is volatile. */ 86 /* Make OP describe an operand that must use rtx X, even if X is volatile. */
82 87
83 static inline void 88 static inline void
140 create_address_operand (struct expand_operand *op, rtx value) 145 create_address_operand (struct expand_operand *op, rtx value)
141 { 146 {
142 create_expand_operand (op, EXPAND_ADDRESS, value, Pmode, false); 147 create_expand_operand (op, EXPAND_ADDRESS, value, Pmode, false);
143 } 148 }
144 149
145 /* Make OP describe an input operand that has value INTVAL and that has 150 extern void create_integer_operand (struct expand_operand *, poly_int64);
146 no inherent mode. This function should only be used for operands that
147 are always expand-time constants. The backend may request that INTVAL
148 be copied into a different kind of rtx, but it must specify the mode
149 of that rtx if so. */
150
151 static inline void
152 create_integer_operand (struct expand_operand *op, HOST_WIDE_INT intval)
153 {
154 create_expand_operand (op, EXPAND_INTEGER, GEN_INT (intval), VOIDmode, false);
155 }
156
157 151
158 /* Passed to expand_simple_binop and expand_binop to say which options 152 /* Passed to expand_simple_binop and expand_binop to say which options
159 to try to use if the requested operation can't be open-coded on the 153 to try to use if the requested operation can't be open-coded on the
160 requisite mode. Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using 154 requisite mode. Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using
161 a library call. Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try 155 a library call. Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try
179 extern rtx simplify_expand_binop (machine_mode mode, optab binoptab, 173 extern rtx simplify_expand_binop (machine_mode mode, optab binoptab,
180 rtx op0, rtx op1, rtx target, int unsignedp, 174 rtx op0, rtx op1, rtx target, int unsignedp,
181 enum optab_methods methods); 175 enum optab_methods methods);
182 extern bool force_expand_binop (machine_mode, optab, rtx, rtx, rtx, int, 176 extern bool force_expand_binop (machine_mode, optab, rtx, rtx, rtx, int,
183 enum optab_methods); 177 enum optab_methods);
178 extern rtx expand_vector_broadcast (machine_mode, rtx);
184 179
185 /* Generate code for a simple binary or unary operation. "Simple" in 180 /* Generate code for a simple binary or unary operation. "Simple" in
186 this case means "can be unambiguously described by a (mode, code) 181 this case means "can be unambiguously described by a (mode, code)
187 pair and mapped to a single optab." */ 182 pair and mapped to a single optab." */
188 extern rtx expand_simple_binop (machine_mode, enum rtx_code, rtx, 183 extern rtx expand_simple_binop (machine_mode, enum rtx_code, rtx,
305 300
306 /* Generate a conditional trap instruction. */ 301 /* Generate a conditional trap instruction. */
307 extern rtx_insn *gen_cond_trap (enum rtx_code, rtx, rtx, rtx); 302 extern rtx_insn *gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
308 303
309 /* Generate code for VEC_PERM_EXPR. */ 304 /* Generate code for VEC_PERM_EXPR. */
310 extern rtx expand_vec_perm (machine_mode, rtx, rtx, rtx, rtx); 305 extern rtx expand_vec_perm_var (machine_mode, rtx, rtx, rtx, rtx);
306 extern rtx expand_vec_perm_const (machine_mode, rtx, rtx,
307 const vec_perm_builder &, machine_mode, rtx);
311 308
312 /* Generate code for vector comparison. */ 309 /* Generate code for vector comparison. */
313 extern rtx expand_vec_cmp_expr (tree, tree, rtx); 310 extern rtx expand_vec_cmp_expr (tree, tree, rtx);
314 311
315 /* Generate code for VEC_COND_EXPR. */ 312 /* Generate code for VEC_COND_EXPR. */
316 extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx); 313 extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx);
314
315 /* Generate code for VEC_SERIES_EXPR. */
316 extern rtx expand_vec_series_expr (machine_mode, rtx, rtx, rtx);
317 317
318 /* Generate code for MULT_HIGHPART_EXPR. */ 318 /* Generate code for MULT_HIGHPART_EXPR. */
319 extern rtx expand_mult_highpart (machine_mode, rtx, rtx, rtx, bool); 319 extern rtx expand_mult_highpart (machine_mode, rtx, rtx, rtx, bool);
320 320
321 extern rtx expand_sync_lock_test_and_set (rtx, rtx, rtx); 321 extern rtx expand_sync_lock_test_and_set (rtx, rtx, rtx);