diff options
author | DJ Delorie <dj@redhat.com> | 2014-10-16 16:50:18 -0400 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2014-10-16 16:50:18 -0400 |
commit | 92d0307de0b768b1f7e904c3e109b98164462cfc (patch) | |
tree | 38bbcd370df4a0c6b2105fcbe7283cf258c5b2b9 /gcc | |
parent | 299874d5226450fc4f7277b45e40bcfc961385dd (diff) | |
download | gcc-92d0307de0b768b1f7e904c3e109b98164462cfc.zip gcc-92d0307de0b768b1f7e904c3e109b98164462cfc.tar.gz gcc-92d0307de0b768b1f7e904c3e109b98164462cfc.tar.bz2 |
rs6000-c.c (rid_int128): New.
* config/rs6000/rs6000-c.c (rid_int128): New.
(rs6000_macro_to_expand): Use instead of RID_INT128.
From-SVN: r216348
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000-c.c | 19 |
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7e4b5d4..cf31da6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-16 DJ Delorie <dj@redhat.com> + + * config/rs6000/rs6000-c.c (rid_int128): New. + (rs6000_macro_to_expand): Use instead of RID_INT128. + 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * function.h: Flatten file. Remove includes, adjust prototypes to diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index f024dcc..18a2688 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -160,6 +160,23 @@ init_vector_keywords (void) } } +/* Helper function to find out which RID_INT_N_* code is the one for + __int128, if any. Returns RID_MAX+1 if none apply, which is safe + (for our purposes, since we always expect to have __int128) to + compare against. */ +static int +rid_int128(void) +{ + int i; + + for (i = 0; i < NUM_INT_N_ENTS; i ++) + if (int_n_enabled_p[i] + && int_n_data[i].bitsize == 128) + return RID_INT_N_0 + i; + + return RID_MAX + 1; +} + /* Called to decide whether a conditional macro should be expanded. Since we have exactly one such macro (i.e, 'vector'), we do not need to examine the 'tok' parameter. */ @@ -234,7 +251,7 @@ rs6000_macro_to_expand (cpp_reader *pfile, const cpp_token *tok) || rid_code == RID_INT || rid_code == RID_CHAR || rid_code == RID_FLOAT || (rid_code == RID_DOUBLE && TARGET_VSX) - || (rid_code == RID_INT128 && TARGET_VADDUQM)) + || (rid_code == rid_int128 () && TARGET_VADDUQM)) { expand_this = C_CPP_HASHNODE (__vector_keyword); /* If the next keyword is bool or pixel, it |