From 853d50d3c82212fee406279c386cef1673adfbc3 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 22 Sep 2014 07:36:42 +0000 Subject: [PATCH] gcc/ * hard-reg-set.h (COPY_HARD_REG_SET, COMPL_HARD_REG_SET) (AND_HARD_REG_SET, AND_COMPL_HARD_REG_SET, IOR_HARD_REG_SET) (IOR_COMPL_HARD_REG_SET): Allow the "from" set to be constant. From-SVN: r215446 --- gcc/ChangeLog | 6 ++++ gcc/hard-reg-set.h | 72 ++++++++++++++++++++++++++++++---------------- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0471bba2330..3420fb03455 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-09-22 Richard Sandiford + + * hard-reg-set.h (COPY_HARD_REG_SET, COMPL_HARD_REG_SET) + (AND_HARD_REG_SET, AND_COMPL_HARD_REG_SET, IOR_HARD_REG_SET) + (IOR_COMPL_HARD_REG_SET): Allow the "from" set to be constant. + 2014-09-22 Zhenqiang Chen * config/arm/arm.c: #include "tm-constrs.h" diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h index b8ab3df7a15..401fea1bab8 100644 --- a/gcc/hard-reg-set.h +++ b/gcc/hard-reg-set.h @@ -168,32 +168,38 @@ do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ scan_tp_[1] = -1; } while (0) #define COPY_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] = scan_fp_[0]; \ scan_tp_[1] = scan_fp_[1]; } while (0) #define COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] = ~ scan_fp_[0]; \ scan_tp_[1] = ~ scan_fp_[1]; } while (0) #define AND_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] &= scan_fp_[0]; \ scan_tp_[1] &= scan_fp_[1]; } while (0) #define AND_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] &= ~ scan_fp_[0]; \ scan_tp_[1] &= ~ scan_fp_[1]; } while (0) #define IOR_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] |= scan_fp_[0]; \ scan_tp_[1] |= scan_fp_[1]; } while (0) #define IOR_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] |= ~ scan_fp_[0]; \ scan_tp_[1] |= ~ scan_fp_[1]; } while (0) @@ -236,37 +242,43 @@ do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ scan_tp_[2] = -1; } while (0) #define COPY_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] = scan_fp_[0]; \ scan_tp_[1] = scan_fp_[1]; \ scan_tp_[2] = scan_fp_[2]; } while (0) #define COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] = ~ scan_fp_[0]; \ scan_tp_[1] = ~ scan_fp_[1]; \ scan_tp_[2] = ~ scan_fp_[2]; } while (0) #define AND_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] &= scan_fp_[0]; \ scan_tp_[1] &= scan_fp_[1]; \ scan_tp_[2] &= scan_fp_[2]; } while (0) #define AND_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] &= ~ scan_fp_[0]; \ scan_tp_[1] &= ~ scan_fp_[1]; \ scan_tp_[2] &= ~ scan_fp_[2]; } while (0) #define IOR_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] |= scan_fp_[0]; \ scan_tp_[1] |= scan_fp_[1]; \ scan_tp_[2] |= scan_fp_[2]; } while (0) #define IOR_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] |= ~ scan_fp_[0]; \ scan_tp_[1] |= ~ scan_fp_[1]; \ scan_tp_[2] |= ~ scan_fp_[2]; } while (0) @@ -316,42 +328,48 @@ do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ scan_tp_[3] = -1; } while (0) #define COPY_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] = scan_fp_[0]; \ scan_tp_[1] = scan_fp_[1]; \ scan_tp_[2] = scan_fp_[2]; \ scan_tp_[3] = scan_fp_[3]; } while (0) #define COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] = ~ scan_fp_[0]; \ scan_tp_[1] = ~ scan_fp_[1]; \ scan_tp_[2] = ~ scan_fp_[2]; \ scan_tp_[3] = ~ scan_fp_[3]; } while (0) #define AND_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] &= scan_fp_[0]; \ scan_tp_[1] &= scan_fp_[1]; \ scan_tp_[2] &= scan_fp_[2]; \ scan_tp_[3] &= scan_fp_[3]; } while (0) #define AND_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] &= ~ scan_fp_[0]; \ scan_tp_[1] &= ~ scan_fp_[1]; \ scan_tp_[2] &= ~ scan_fp_[2]; \ scan_tp_[3] &= ~ scan_fp_[3]; } while (0) #define IOR_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] |= scan_fp_[0]; \ scan_tp_[1] |= scan_fp_[1]; \ scan_tp_[2] |= scan_fp_[2]; \ scan_tp_[3] |= scan_fp_[3]; } while (0) #define IOR_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ scan_tp_[0] |= ~ scan_fp_[0]; \ scan_tp_[1] |= ~ scan_fp_[1]; \ scan_tp_[2] |= ~ scan_fp_[2]; \ @@ -402,37 +420,43 @@ do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ *scan_tp_++ = -1; } while (0) #define COPY_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ int i; \ for (i = 0; i < HARD_REG_SET_LONGS; i++) \ *scan_tp_++ = *scan_fp_++; } while (0) #define COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ int i; \ for (i = 0; i < HARD_REG_SET_LONGS; i++) \ *scan_tp_++ = ~ *scan_fp_++; } while (0) #define AND_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ int i; \ for (i = 0; i < HARD_REG_SET_LONGS; i++) \ *scan_tp_++ &= *scan_fp_++; } while (0) #define AND_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ int i; \ for (i = 0; i < HARD_REG_SET_LONGS; i++) \ *scan_tp_++ &= ~ *scan_fp_++; } while (0) #define IOR_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ int i; \ for (i = 0; i < HARD_REG_SET_LONGS; i++) \ *scan_tp_++ |= *scan_fp_++; } while (0) #define IOR_COMPL_HARD_REG_SET(TO, FROM) \ -do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); \ +do { HARD_REG_ELT_TYPE *scan_tp_ = (TO); \ + const HARD_REG_ELT_TYPE *scan_fp_ = (FROM); \ int i; \ for (i = 0; i < HARD_REG_SET_LONGS; i++) \ *scan_tp_++ |= ~ *scan_fp_++; } while (0) -- 2.30.2