summaryrefslogtreecommitdiff
path: root/gcc/fold-const-call.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright years.jakub2017-01-011-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243994 138bc75d-0d04-0410-961f-82ee72b054a4
* Fold __builtin_str{n}{case}cmp functionsmarxin2016-10-141-0/+1
| | | | | | | | | | | | | | | | * builtins.c (fold_builtin_strcmp): Remove function. (fold_builtin_strncmp): Likewise. (fold_builtin_2): Remove call of the function. (fold_builtin_3): Likewise. * fold-const-call.c (fold_const_call): Add constant folding for CFN_BUILT_IN_STRCASECMP and CFN_BUILT_IN_STRNCASECMP. * fold-const-call.h (build_cmp_result): Declare the function. * gimple-fold.c (gimple_load_first_char): New function. (gimple_fold_builtin_string_compare): Likewise. (gimple_fold_builtin): Call the function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241159 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years.jakub2016-01-041-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232055 138bc75d-0d04-0410-961f-82ee72b054a4
* Extend fold_const_call to combined_fnrsandifo2015-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | This patch extends fold_const_call so that it can handle internal as well as built-in functions. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. gcc/ * fold-const-call.h (fold_const_call): Replace built_in_function arguments with combined_fn arguments. * fold-const-call.c: Include case-cfn-macros.h. (fold_const_call_ss, fold_const_call_cs, fold_const_call_sc) (fold_const_call_cc, fold_const_call_sss, fold_const_call_ccc) (fold_const_call_ssss, fold_const_call_1, fold_const_call): Replace built_in_function arguments with combined_fn arguments. * builtins.c (fold_builtin_sincos, fold_builtin_1, fold_builtin_2) (fold_builtin_3): Update calls to fold_const_call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230477 138bc75d-0d04-0410-961f-82ee72b054a4
* Move constant folds for maths functions to new filersandifo2015-11-021-0/+28
The new routines operate on the built-in enum rather than on tree decls. The idea is to extend this to handle internal functions too, with a combined enum for both. The patch also moves fold_fma too, with the same prototype. The long-term plan is to replace FMA_EXPR with an internal function, for consistency with the way that things like SQRT will be handled. Tested on x86_64-linux-gnu, arm-linux-gnueabi and aarch64-linux-gnu. gcc/ * builtins.h (fold_fma): Move to fold-const-call.h. * builtins.c: Include fold-const-call.h. (mathfn_built_in_2): New function, split out from... (mathfn_built_in_1): ...here. (do_real_to_int_conversion, fold_const_builtin_pow) (fold_const_builtin_logb, fold_const_builtin_significand) (fold_const_builtin_load_exponent, do_mpfr_arg1, do_mpfr_arg2) (do_mpfr_arg3, do_mpfr_sincos, do_mpfr_bessel_n, do_mpc_arg1): Delete. (fold_builtin_sincos): Use fold_const_call to handle constants. (fold_builtin_1, fold_builtin_2, fold_builtin_3): Add explicit checks for ERROR_MARK. Use fold_const_call to handle constant folds for math functions. (fold_fma): Move to fold-const-call.c. * fold-const.c: Include fold-const-call.h. * Makefile.in (OBJS): Add fold-const-call.o. (PLUGIN_HEADERS): Add fold-const-call.h. * realmpfr.h (real_from_mpfr): Allow the format to be specified directly. * realmpfr.c (real_from_mpfr): Likewise. * fold-const-call.h, fold-const-call.c: New files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229669 138bc75d-0d04-0410-961f-82ee72b054a4