summaryrefslogtreecommitdiff
path: root/gcc/optabs.def
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-12-02 09:06:28 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-12-02 09:06:28 +0000
commit886456e210ef12d77f625ace8f312ab23d208aff (patch)
tree5b44d07d2d4f3d21be039ca6d049269722224bbf /gcc/optabs.def
parente970b4b0002d0bc24cf4461fb0eadd7ee2241cab (diff)
Check for invalid FAILs
This patch makes it a compile-time error for an internal-fn optab to FAIL. There are certainly other optabs and patterns besides these that aren't allowed to fail, but this at least deals with the immediate point of controversy. Tested normally on x86_64-linux-gnu. Also tested by building one configuration per cpu directory. arc-elf and pdp11 didn't build for unrelated reasons, but I checked that insn-emit.o built for both without error. gcc/ * Makefile.in (GENSUPPORT_H): New macro. (build/gensupport.o, build/read-rtl.o, build/genattr.o) (build/genattr-common.o, build/genattrtab.o, build/genautomata.o) (build/gencodes.o, build/genconditions.o, build/genconfig.o) (build/genconstants.o, build/genextract.o, build/genflags.o) (build/gentarget-def.o): Use it. (build/genemit.o): Likewise. Depend on internal-fn.def. * genopinit.c: Move block comment to optabs.def. (optab_tag, optab_def): Move to gensupport.h (pattern): Likewise, renaming to optab_pattern. (match_pattern): Move to gensupport.c (gen_insn): Use find_optab. (patterns, pattern_cmp): Replace pattern with optab_pattern. (main): Likewise. Use num_optabs. * optabs.def: Add comment that was previously in genopinit.c. * gensupport.h (optab_tag): Moved from genopinit.c (optab_def): Likewise, expanding commentary. (optab_pattern): Likewise, after renaming from pattern. (optabs, num_optabs, find_optab): Declare. * gensupport.c (optabs): Moved from genopinit.c. (num_optabs): New variable. (match_pattern): Moved from genopinit.c. (find_optab): New function, extracted from genopinit.c:gen_insn. * genemit.c (nofail_optabs): New variable. (emit_c_code): New function. (gen_expand): Check whether the instruction is an optab that isn't allowed to fail. Call emit_c_code. (gen_split): Call emit_c_code here too. (main): Initialize nofail_optabs. Don't emit FAIL and DONE here. From-SVN: r231160
Diffstat (limited to 'gcc/optabs.def')
-rw-r--r--gcc/optabs.def25
1 files changed, 23 insertions, 2 deletions
diff --git a/gcc/optabs.def b/gcc/optabs.def
index 20e4225d733..8feb3942ac5 100644
--- a/gcc/optabs.def
+++ b/gcc/optabs.def
@@ -17,8 +17,29 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* Entries here are categorized C, D, N, V. See genopinit.c for details
- on the meaning of the categories and for the pattern dollar codes. */
+/* The entries in optabs.def are categorized:
+ C: A "conversion" optab, which uses two modes; has libcall data.
+ N: A "normal" optab, which uses one mode; has libcall data.
+ D: A "direct" optab, which uses one mode; does not have libcall data.
+ V: An "oVerflow" optab. Like N, but does not record its code in
+ code_to_optab.
+
+ CX, NX, VX: An extra pattern entry for a conversion or normal optab.
+
+ These patterns may be present in the MD file with names that contain
+ the mode(s) used and the name of the operation. This array contains
+ a list of optabs that need to be initialized. Within each name,
+ $a and $b are used to match a short mode name (the part of the mode
+ name not including `mode' and converted to lower-case).
+
+ $I means that only full integer modes should be considered for the
+ next mode, and $F means that only float modes should be considered.
+ $P means that both full and partial integer modes should be considered.
+ $Q means that only fixed-point modes should be considered.
+
+ The pattern may be NULL if the optab exists only for the libcalls
+ that we plan to attach to it, and there are no named patterns in
+ the md files. */
/* The extension libcalls are used for float extension. */
OPTAB_CL(sext_optab, "extend$b$a2", SIGN_EXTEND, "extend", gen_extend_conv_libfunc)