aboutsummaryrefslogtreecommitdiff
path: root/gcc/genmodes.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@linux.vnet.ibm.com>2016-05-02 23:23:45 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2016-05-02 23:23:45 +0000
commit4304ccfd019194af658e777c9d5d2a3dbebbc825 (patch)
tree7e53a4f7ecf1db3452d71051ae33009438550f2a /gcc/genmodes.c
parentfd39794afaedab9f102cede19852ec74e8a1ee17 (diff)
downloadgcc-4304ccfd019194af658e777c9d5d2a3dbebbc825.zip
gcc-4304ccfd019194af658e777c9d5d2a3dbebbc825.tar.gz
gcc-4304ccfd019194af658e777c9d5d2a3dbebbc825.tar.bz2
machmode.h (mode_complex): Add support to give the complex mode for a given mode.
[gcc] 2016-05-02 Michael Meissner <meissner@linux.vnet.ibm.com> * machmode.h (mode_complex): Add support to give the complex mode for a given mode. (GET_MODE_COMPLEX_MODE): Likewise. * stor-layout.c (layout_type): For COMPLEX_TYPE, use the mode stored by build_complex_type and gfc_build_complex_type instead of trying to figure out the appropriate mode based on the size. Raise an assertion error, if the type was not set. * genmodes.c (struct mode_data): Add field for the complex type of the given type. (blank_mode): Likewise. (make_complex_modes): Remember the complex mode created in the base type. (emit_mode_complex): Write out the mode_complex array to map a type mode to the complex version. (emit_insn_modes_c): Likewise. * tree.c (build_complex_type): Set the complex type to use before calling layout_type. * config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Add support for __float128 complex datatypes. (rs6000_hard_regno_mode_ok): Likewise. (rs6000_setup_reg_addr_masks): Likewise. (rs6000_complex_function_value): Likewise. * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Likewise. __float128 and __ibm128 complex. (FLOAT128_IBM_P): Likewise. (ALTIVEC_ARG_MAX_RETURN): Likewise. * doc/extend.texi (Additional Floating Types): Document that -mfloat128 must be used to enable __float128. Document complex __float128 and __ibm128 support. [gcc/fortran] 2016-05-02 Michael Meissner <meissner@linux.vnet.ibm.com> * trans-types.c (gfc_build_complex_type): [gcc/testsuite] 2016-05-02 Michael Meissner <meissner@linux.vnet.ibm.com> * gcc.target/powerpc/float128-complex-1.c: New tests for complex __float128. * gcc.target/powerpc/float128-complex-2.c: Likewise. From-SVN: r235794
Diffstat (limited to 'gcc/genmodes.c')
-rw-r--r--gcc/genmodes.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index 2bfba3ef..788031b 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -66,6 +66,7 @@ struct mode_data
this mode as a component. */
struct mode_data *next_cont; /* Next mode in that list. */
+ struct mode_data *complex; /* complex type with mode as component. */
const char *file; /* file and line of definition, */
unsigned int line; /* for error reporting */
unsigned int counter; /* Rank ordering of modes */
@@ -83,7 +84,7 @@ static struct mode_data *void_mode;
static const struct mode_data blank_mode = {
0, "<unknown>", MAX_MODE_CLASS,
-1U, -1U, -1U, -1U,
- 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
"<unknown>", 0, 0, 0, 0, false, 0
};
@@ -472,6 +473,7 @@ make_complex_modes (enum mode_class cl,
c = new_mode (cclass, buf, file, line);
c->component = m;
+ m->complex = c;
}
}
@@ -1381,6 +1383,22 @@ emit_mode_wider (void)
}
static void
+emit_mode_complex (void)
+{
+ int c;
+ struct mode_data *m;
+
+ print_decl ("unsigned char", "mode_complex", "NUM_MACHINE_MODES");
+
+ for_all_modes (c, m)
+ tagged_printf ("%smode",
+ m->complex ? m->complex->name : void_mode->name,
+ m->name);
+
+ print_closer ();
+}
+
+static void
emit_mode_mask (void)
{
int c;
@@ -1745,6 +1763,7 @@ emit_insn_modes_c (void)
emit_mode_size ();
emit_mode_nunits ();
emit_mode_wider ();
+ emit_mode_complex ();
emit_mode_mask ();
emit_mode_inner ();
emit_mode_unit_size ();