diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-11-05 18:26:21 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-11-05 18:26:21 +0000 |
commit | 2799d18c92aa58f7f1f939c53e3bb765074a6e07 (patch) | |
tree | 17d1c63e8798f11f7740ed054434db57ed00af23 /gcc/ada/gcc-interface/utils.c | |
parent | 22d12fc2cbe60ac835621b11cdaa52d8dc6e08ce (diff) | |
download | gcc-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/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 24 |
1 files changed, 18 insertions, 6 deletions
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. */ |