summaryrefslogtreecommitdiffstats
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-05 18:26:21 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-05 18:26:21 +0000
commit21100898bcd3a99205f8506617bd46da165bc448 (patch)
tree17d1c63e8798f11f7740ed054434db57ed00af23 /gcc/ada/gcc-interface/utils.c
parent2b9124b1649cb2e38db9193058cf190f382a08b8 (diff)
downloadppe42-gcc-21100898bcd3a99205f8506617bd46da165bc448.tar.gz
ppe42-gcc-21100898bcd3a99205f8506617bd46da165bc448.zip
* gcc-interface/utils.c (gnat_type_for_mode): Handle vector modes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153949 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 6ee5a912856..c79dd4e7a65 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -2177,16 +2177,28 @@ gnat_type_for_mode (enum machine_mode mode, int unsignedp)
{
if (mode == BLKmode)
return NULL_TREE;
- else if (mode == VOIDmode)
+
+ if (mode == VOIDmode)
return void_type_node;
- else if (COMPLEX_MODE_P (mode))
+
+ if (COMPLEX_MODE_P (mode))
return NULL_TREE;
- else if (SCALAR_FLOAT_MODE_P (mode))
+
+ if (SCALAR_FLOAT_MODE_P (mode))
return float_type_for_precision (GET_MODE_PRECISION (mode), mode);
- else if (SCALAR_INT_MODE_P (mode))
+
+ if (SCALAR_INT_MODE_P (mode))
return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
- else
- return NULL_TREE;
+
+ if (VECTOR_MODE_P (mode))
+ {
+ enum machine_mode inner_mode = GET_MODE_INNER (mode);
+ tree inner_type = gnat_type_for_mode (inner_mode, unsignedp);
+ if (inner_type)
+ return build_vector_type_for_mode (inner_type, mode);
+ }
+
+ return NULL_TREE;
}
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
OpenPOWER on IntegriCloud