aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-11-05 18:26:21 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-11-05 18:26:21 +0000
commit2799d18c92aa58f7f1f939c53e3bb765074a6e07 (patch)
tree17d1c63e8798f11f7740ed054434db57ed00af23 /gcc
parent22d12fc2cbe60ac835621b11cdaa52d8dc6e08ce (diff)
downloadgcc-2799d18c92aa58f7f1f939c53e3bb765074a6e07.zip
gcc-2799d18c92aa58f7f1f939c53e3bb765074a6e07.tar.gz
gcc-2799d18c92aa58f7f1f939c53e3bb765074a6e07.tar.bz2
* gcc-interface/utils.c (gnat_type_for_mode): Handle vector modes.
From-SVN: r153949
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/gcc-interface/utils.c24
2 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 42ad20e..8c98429 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,9 @@
2009-11-05 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/utils.c (gnat_type_for_mode): Handle vector modes.
+
+2009-11-05 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/trans.c (lvalue_required_p) <N_Unchecked_Conversion>:
New case.
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 6ee5a91..c79dd4e 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. */