GCC Middle and Back End API Reference
optabs-libfuncs.h File Reference
#include "insn-opinit.h"
Include dependency graph for optabs-libfuncs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

rtx convert_optab_libfunc (convert_optab, machine_mode, machine_mode)
 
rtx optab_libfunc (optab, machine_mode)
 
void gen_int_libfunc (optab, const char *, char, machine_mode)
 
void gen_fp_libfunc (optab, const char *, char, machine_mode)
 
void gen_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_signed_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_unsigned_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_int_fp_libfunc (optab, const char *, char, machine_mode)
 
void gen_intv_fp_libfunc (optab, const char *, char, machine_mode)
 
void gen_int_fp_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_int_fp_signed_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_int_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_int_signed_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_int_unsigned_fixed_libfunc (optab, const char *, char, machine_mode)
 
void gen_interclass_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_int_to_fp_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_ufloat_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_int_to_fp_nondecimal_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_fp_to_int_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_intraclass_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_trunc_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_extend_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_fract_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_fractuns_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_satfract_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
void gen_satfractuns_conv_libfunc (convert_optab, const char *, machine_mode, machine_mode)
 
tree build_libfunc_function_visibility (const char *, symbol_visibility)
 
tree build_libfunc_function (const char *)
 
rtx init_one_libfunc_visibility (const char *, symbol_visibility)
 
rtx init_one_libfunc (const char *)
 
rtx set_user_assembler_libfunc (const char *, const char *)
 
void set_optab_libfunc (optab, machine_mode, const char *)
 
void set_conv_libfunc (convert_optab, machine_mode, machine_mode, const char *)
 
void init_optabs (void)
 
void init_sync_libfuncs (int max)
 

Function Documentation

◆ build_libfunc_function()

tree build_libfunc_function ( const char * name)
Build a decl for a libfunc named NAME.   

References build_libfunc_function_visibility(), and VISIBILITY_DEFAULT.

◆ build_libfunc_function_visibility()

tree build_libfunc_function_visibility ( const char * name,
symbol_visibility vis )

◆ convert_optab_libfunc()

rtx convert_optab_libfunc ( convert_optab optab,
machine_mode mode1,
machine_mode mode2 )
Mapping from optabs to underlying library functions
   Copyright (C) 2001-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

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/>.   
Return libfunc corresponding operation defined by OPTAB converting
from MODE2 to MODE1.  Trigger lazy initialization if needed, return NULL
if no libfunc is available.   

References libfunc_hash, libfunc_entry::mode1, libfunc_entry::mode2, NULL, NULL_RTX, and libfunc_entry::op.

Referenced by convert_mode_scalar(), debug_optab_libfuncs(), expand_fix(), expand_fixed_convert(), and expand_float().

◆ gen_extend_conv_libfunc()

void gen_extend_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Pick proper libcall for extend_optab.  We need to chose if we do
truncation or extension and interclass or intraclass.   

References gen_interclass_conv_libfunc(), gen_intraclass_conv_libfunc(), GET_MODE_CLASS, GET_MODE_PRECISION(), and is_a().

◆ gen_fixed_libfunc()

void gen_fixed_libfunc ( optab optable,
const char * opname,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that fixed-point operation is involved.   

References ALL_FIXED_POINT_MODE_P, and gen_libfunc().

Referenced by gen_int_fixed_libfunc(), and gen_int_fp_fixed_libfunc().

◆ gen_fp_libfunc()

void gen_fp_libfunc ( optab optable,
const char * opname,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that FP and set decimal prefix if needed.   

References DECIMAL_FLOAT_MODE_P, DECIMAL_PREFIX, gen_libfunc(), and GET_MODE_CLASS.

Referenced by gen_int_fp_fixed_libfunc(), gen_int_fp_libfunc(), gen_int_fp_signed_fixed_libfunc(), and gen_intv_fp_libfunc().

◆ gen_fp_to_int_conv_libfunc()

void gen_fp_to_int_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Same as gen_interclass_conv_libfunc but verify that we are producing
fp->int conversion with no decimal floating point involved.   

References DECIMAL_FLOAT_MODE_P, gen_interclass_conv_libfunc(), and GET_MODE_CLASS.

◆ gen_fract_conv_libfunc()

void gen_fract_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Pick proper libcall for fract_optab.  We need to chose if we do
interclass or intraclass.   

References ALL_FIXED_POINT_MODE_P, gen_interclass_conv_libfunc(), gen_intraclass_conv_libfunc(), and GET_MODE_CLASS.

◆ gen_fractuns_conv_libfunc()

void gen_fractuns_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Pick proper libcall for fractuns_optab.   

References ALL_FIXED_POINT_MODE_P, gen_interclass_conv_libfunc(), and GET_MODE_CLASS.

◆ gen_int_fixed_libfunc()

void gen_int_fixed_libfunc ( optab optable,
const char * name,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that INT or FIXED operation is
involved.   

References ALL_FIXED_POINT_MODE_P, gen_fixed_libfunc(), gen_int_libfunc(), and INTEGRAL_MODE_P.

◆ gen_int_fp_fixed_libfunc()

void gen_int_fp_fixed_libfunc ( optab optable,
const char * name,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that FP or INT or FIXED operation is
involved.   

References ALL_FIXED_POINT_MODE_P, DECIMAL_FLOAT_MODE_P, gen_fixed_libfunc(), gen_fp_libfunc(), gen_int_libfunc(), GET_MODE_CLASS, and INTEGRAL_MODE_P.

◆ gen_int_fp_libfunc()

void gen_int_fp_libfunc ( optab optable,
const char * name,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that FP or INT operation is involved.   

References DECIMAL_FLOAT_MODE_P, gen_fp_libfunc(), gen_int_libfunc(), GET_MODE_CLASS, and INTEGRAL_MODE_P.

◆ gen_int_fp_signed_fixed_libfunc()

void gen_int_fp_signed_fixed_libfunc ( optab optable,
const char * name,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that FP or INT or signed FIXED operation is
involved.   

References DECIMAL_FLOAT_MODE_P, gen_fp_libfunc(), gen_int_libfunc(), gen_signed_fixed_libfunc(), GET_MODE_CLASS, INTEGRAL_MODE_P, and SIGNED_FIXED_POINT_MODE_P.

◆ gen_int_libfunc()

void gen_int_libfunc ( optab optable,
const char * opname,
char suffix,
machine_mode mode )

◆ gen_int_signed_fixed_libfunc()

void gen_int_signed_fixed_libfunc ( optab optable,
const char * name,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that INT or signed FIXED operation is
involved.   

References gen_int_libfunc(), gen_signed_fixed_libfunc(), INTEGRAL_MODE_P, and SIGNED_FIXED_POINT_MODE_P.

◆ gen_int_to_fp_conv_libfunc()

void gen_int_to_fp_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Same as gen_interclass_conv_libfunc but verify that we are producing
int->fp conversion.   

References DECIMAL_FLOAT_MODE_P, gen_interclass_conv_libfunc(), and GET_MODE_CLASS.

Referenced by gen_ufloat_conv_libfunc().

◆ gen_int_to_fp_nondecimal_conv_libfunc()

void gen_int_to_fp_nondecimal_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Same as gen_interclass_conv_libfunc but verify that we are producing
fp->int conversion.   

References gen_interclass_conv_libfunc(), and GET_MODE_CLASS.

◆ gen_int_unsigned_fixed_libfunc()

void gen_int_unsigned_fixed_libfunc ( optab optable,
const char * name,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that INT or unsigned FIXED operation is
involved.   

References gen_int_libfunc(), gen_unsigned_fixed_libfunc(), INTEGRAL_MODE_P, and UNSIGNED_FIXED_POINT_MODE_P.

◆ gen_interclass_conv_libfunc()

void gen_interclass_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Initialize the libfunc fields of an entire group of entries of an
inter-mode-class conversion optab.  The string formation rules are
similar to the ones for init_libfuncs, above, but instead of having
a mode name and an operand count these functions have two mode names
and no operand count.   

References DECIMAL_FLOAT_MODE_P, DECIMAL_PREFIX, GET_MODE_NAME, ggc_alloc_string(), set_conv_libfunc(), and targetm.

Referenced by gen_extend_conv_libfunc(), gen_fp_to_int_conv_libfunc(), gen_fract_conv_libfunc(), gen_fractuns_conv_libfunc(), gen_int_to_fp_conv_libfunc(), gen_int_to_fp_nondecimal_conv_libfunc(), gen_satfract_conv_libfunc(), gen_satfractuns_conv_libfunc(), and gen_trunc_conv_libfunc().

◆ gen_intraclass_conv_libfunc()

void gen_intraclass_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Initialize the libfunc fields of an of an intra-mode-class conversion optab.
The string formation rules are
similar to the ones for init_libfunc, above.   

References DECIMAL_FLOAT_MODE_P, DECIMAL_PREFIX, GET_MODE_NAME, ggc_alloc_string(), set_conv_libfunc(), and targetm.

Referenced by gen_extend_conv_libfunc(), gen_fract_conv_libfunc(), gen_satfract_conv_libfunc(), and gen_trunc_conv_libfunc().

◆ gen_intv_fp_libfunc()

void gen_intv_fp_libfunc ( optab optable,
const char * name,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that FP or INT operation is involved
and add 'v' suffix for integer operation.   

References DECIMAL_FLOAT_MODE_P, gen_fp_libfunc(), gen_int_libfunc(), and GET_MODE_CLASS.

◆ gen_satfract_conv_libfunc()

void gen_satfract_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Pick proper libcall for satfract_optab.  We need to chose if we do
interclass or intraclass.   

References ALL_FIXED_POINT_MODE_P, gen_interclass_conv_libfunc(), gen_intraclass_conv_libfunc(), and GET_MODE_CLASS.

◆ gen_satfractuns_conv_libfunc()

void gen_satfractuns_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Pick proper libcall for satfractuns_optab.   

References ALL_FIXED_POINT_MODE_P, gen_interclass_conv_libfunc(), and GET_MODE_CLASS.

◆ gen_signed_fixed_libfunc()

void gen_signed_fixed_libfunc ( optab optable,
const char * opname,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that signed fixed-point operation is
involved.   

References gen_libfunc(), and SIGNED_FIXED_POINT_MODE_P.

Referenced by gen_int_fp_signed_fixed_libfunc(), and gen_int_signed_fixed_libfunc().

◆ gen_trunc_conv_libfunc()

void gen_trunc_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
Pick proper libcall for trunc_optab.  We need to chose if we do
truncation or extension and interclass or intraclass.   

References arm_bfloat_half_format, gen_interclass_conv_libfunc(), gen_intraclass_conv_libfunc(), GET_MODE_CLASS, GET_MODE_PRECISION(), ibm_extended_format, ieee_half_format, ieee_quad_format, is_a(), and REAL_MODE_FORMAT.

◆ gen_ufloat_conv_libfunc()

void gen_ufloat_conv_libfunc ( convert_optab tab,
const char * opname,
machine_mode tmode,
machine_mode fmode )
ufloat_optab is special by using floatun for FP and floatuns decimal fp
naming scheme.   

References DECIMAL_FLOAT_MODE_P, and gen_int_to_fp_conv_libfunc().

◆ gen_unsigned_fixed_libfunc()

void gen_unsigned_fixed_libfunc ( optab optable,
const char * opname,
char suffix,
machine_mode mode )
Like gen_libfunc, but verify that unsigned fixed-point operation is
involved.   

References gen_libfunc(), and UNSIGNED_FIXED_POINT_MODE_P.

Referenced by gen_int_unsigned_fixed_libfunc().

◆ init_one_libfunc()

◆ init_one_libfunc_visibility()

rtx init_one_libfunc_visibility ( const char * name,
symbol_visibility vis )
Return a libfunc for NAME, creating one if we don't already have one.
The decl is given visibility VIS.  The returned rtx is a SYMBOL_REF.   

References build_libfunc_function_visibility(), hash_table< Descriptor, Lazy, Allocator >::create_ggc(), DECL_RTL, get_identifier(), IDENTIFIER_HASH_VALUE, libfunc_decls, NULL, and XEXP.

Referenced by init_one_libfunc().

◆ init_optabs()

◆ init_sync_libfuncs()

void init_sync_libfuncs ( int max)

◆ optab_libfunc()

◆ set_conv_libfunc()

void set_conv_libfunc ( convert_optab optab,
machine_mode tmode,
machine_mode fmode,
const char * name )
Call this to reset the function entry for one conversion optab
(OPTABLE) from mode FMODE to mode TMODE to NAME, which should be
either 0 or a string constant.   

References ggc_alloc(), init_one_libfunc(), libfunc_hash, libfunc_entry::mode1, libfunc_entry::mode2, NULL, and libfunc_entry::op.

Referenced by gen_interclass_conv_libfunc(), and gen_intraclass_conv_libfunc().

◆ set_optab_libfunc()

void set_optab_libfunc ( optab op,
machine_mode mode,
const char * name )
Call this to reset the function entry for one optab (OPTABLE) in mode
MODE to NAME, which should be either 0 or a string constant.   

References ggc_alloc(), init_one_libfunc(), libfunc_hash, libfunc_entry::mode1, libfunc_entry::mode2, NULL, and libfunc_entry::op.

Referenced by gen_libfunc(), init_optabs(), init_sync_libfuncs_1(), and set_builtin_user_assembler_name().

◆ set_user_assembler_libfunc()

rtx set_user_assembler_libfunc ( const char * name,
const char * asmspec )
Adjust the assembler name of libfunc NAME to ASMSPEC.   

References DECL_RTL, gcc_assert, get_identifier(), IDENTIFIER_HASH_VALUE, libfunc_decls, set_user_assembler_name(), and XEXP.

Referenced by set_builtin_user_assembler_name().