From a97390bf6e92f6f9b0f4e20aff4390ca5c609e37 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 30 Aug 2017 11:21:04 +0000 Subject: [77/77] Add a complex_mode class This patch adds another machine_mode wrapper for modes that are known to be COMPLEX_MODE_P. There aren't yet many places that make use of it, but that might change in future. 2017-08-30 Richard Sandiford Alan Hayward David Sherwood gcc/ * coretypes.h (complex_mode): New type. * gdbhooks.py (build_pretty_printer): Handle it. * machmode.h (complex_mode): New class. (complex_mode::includes_p): New function. (is_complex_int_mode): Likewise. (is_complex_float_mode): Likewise. * genmodes.c (get_mode_class): Handle complex mode classes. * function.c (expand_function_end): Use is_complex_int_mode. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Use is_complex_float_mode. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r251527 --- gcc/function.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/function.c') diff --git a/gcc/function.c b/gcc/function.c index af5e050..4c77e19 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5491,6 +5491,7 @@ expand_function_end (void) : DECL_REGISTER (decl_result)) { rtx real_decl_rtl = crtl->return_rtx; + complex_mode cmode; /* This should be set in assign_parms. */ gcc_assert (REG_FUNCTION_VALUE_P (real_decl_rtl)); @@ -5531,8 +5532,8 @@ expand_function_end (void) need to generate some non-trivial bitfield insertions. Do that on a pseudo and not the hard register. */ else if (GET_CODE (decl_rtl) == CONCAT - && GET_MODE_CLASS (GET_MODE (decl_rtl)) == MODE_COMPLEX_INT - && GET_MODE_BITSIZE (GET_MODE (decl_rtl)) <= BITS_PER_WORD) + && is_complex_int_mode (GET_MODE (decl_rtl), &cmode) + && GET_MODE_BITSIZE (cmode) <= BITS_PER_WORD) { int old_generating_concat_p; rtx tmp; -- cgit v1.1