This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add V4DFmode support to C
- From: Geoffrey Keating <gkeating at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Jul 2003 22:43:42 -0700 (PDT)
- Subject: Add V4DFmode support to C
On Altivec, you can have 'vector float'. Sometimes it's really useful
to have 'vector double' too, no matter how slow it might go.
Bootstrapped & tested on powerpc-darwin. The actual new functionality
is very lightly tested and is certainly incomplete, but you can at
least do 'x = a + b'.
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/gcc-v4dfmode.patch========================
2003-07-14 Geoffrey Keating <geoffk@apple.com>
* c-common.c (c_common_type_for_mode): Handle V4DFmode.
* tree.c: (build_common_tree_nodes_2): Likewise.
* tree.h (enum tree_index): Add TI_V4DF_TYPE.
(V4DF_type_node): New.
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.428
diff -u -p -u -p -r1.428 c-common.c
--- c-common.c 11 Jul 2003 08:33:02 -0000 1.428
+++ c-common.c 15 Jul 2003 05:42:05 -0000
@@ -1895,6 +1895,8 @@ c_common_type_for_mode (enum machine_mod
return V2SF_type_node;
case V2DFmode:
return V2DF_type_node;
+ case V4DFmode:
+ return V4DF_type_node;
default:
break;
}
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.316
diff -u -p -u -p -r1.316 tree.c
--- tree.c 14 Jul 2003 13:36:37 -0000 1.316
+++ tree.c 15 Jul 2003 05:42:05 -0000
@@ -4881,6 +4881,7 @@ build_common_tree_nodes_2 (int short_dou
V2DF_type_node = make_vector (V2DFmode, double_type_node, 0);
V16QI_type_node = make_vector (V16QImode, intQI_type_node, 0);
V1DI_type_node = make_vector (V1DImode, intDI_type_node, 0);
+ V4DF_type_node = make_vector (V4DFmode, double_type_node, 0);
}
/* Returns a vector tree node given a vector mode, the inner type, and
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.426
diff -u -p -u -p -r1.426 tree.h
--- tree.h 14 Jul 2003 13:36:37 -0000 1.426
+++ tree.h 15 Jul 2003 05:42:06 -0000
@@ -1822,6 +1822,7 @@ enum tree_index
TI_V2DI_TYPE,
TI_V1DI_TYPE,
TI_V16QI_TYPE,
+ TI_V4DF_TYPE,
TI_MAIN_IDENTIFIER,
@@ -1912,6 +1913,7 @@ extern GTY(()) tree global_trees[TI_MAX]
#define V2DF_type_node global_trees[TI_V2DF_TYPE]
#define V16SF_type_node global_trees[TI_V16SF_TYPE]
#define V1DI_type_node global_trees[TI_V1DI_TYPE]
+#define V4DF_type_node global_trees[TI_V4DF_TYPE]
/* An enumeration of the standard C integer types. These must be
ordered so that shorter types appear before longer ones, and so
============================================================