public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* wide-int, avr
@ 2013-11-23 19:23 Mike Stump
  2013-12-03 13:53 ` Denis Chertykov
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Stump @ 2013-11-23 19:23 UTC (permalink / raw)
  To: gcc-patches@gcc.gnu.org Patches; +Cc: Denis Chertykov, Kenneth Zadeck

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the avr port.

Ok?


[-- Attachment #2: wide-int-avr.diffs.txt --]
[-- Type: text/plain, Size: 2062 bytes --]

	* config/avr/avr.c
	(avr_out_round): Use wide-int interfaces.
	(avr_fold_builtin): Likewise.


diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 8d98c81..e94e0d7 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -7550,6 +7550,8 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen)
   // The smallest fractional bit not cleared by the rounding is 2^(-RP).
   int fbit = (int) GET_MODE_FBIT (mode);
   double_int i_add = double_int_zero.set_bit (fbit-1 - INTVAL (xop[2]));
+  wide_int wi_add = wi::set_bit_in_zero (fbit-1 - INTVAL (xop[2]),
+					 GET_MODE_PRECISION (imode));
   // Lengths of PLUS and AND parts.
   int len_add = 0, *plen_add = plen ? &len_add : NULL;
   int len_and = 0, *plen_and = plen ? &len_and : NULL;
@@ -7579,7 +7581,7 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen)
   // Rounding point                           ^^^^^^^
   // Added above                                      ^^^^^^^^^
   rtx xreg = simplify_gen_subreg (imode, xop[0], mode, 0);
-  rtx xmask = immed_double_int_const (-i_add - i_add, imode);
+  rtx xmask = immed_wide_int_const (-wi_add - wi_add, imode);
 
   xpattern = gen_rtx_SET (VOIDmode, xreg, gen_rtx_AND (imode, xreg, xmask));
 
@@ -12230,7 +12232,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
             break;
           }
 
-        tmap = double_int_to_tree (map_type, tree_to_double_int (arg[0]));
+        tmap = wide_int_to_tree (map_type, arg[0]);
         map = TREE_INT_CST_LOW (tmap);
 
         if (TREE_CODE (tval) != INTEGER_CST
@@ -12335,8 +12337,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
 
         /* Use map o G^-1 instead of original map to undo the effect of G.  */
 
-        tmap = double_int_to_tree (map_type,
-				   double_int::from_uhwi (best_g.map));
+        tmap = wide_int_to_tree (map_type, best_g.map);
 
         return build_call_expr (fndecl, 3, tmap, tbits, tval);
       } /* AVR_BUILTIN_INSERT_BITS */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wide-int, avr
  2013-11-23 19:23 wide-int, avr Mike Stump
@ 2013-12-03 13:53 ` Denis Chertykov
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Chertykov @ 2013-12-03 13:53 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches@gcc.gnu.org Patches, Kenneth Zadeck

2013/11/23 Mike Stump <mikestump@comcast.net>:
> Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the avr port.
>
> Ok?
>

Ok.
Excuse my long delay. I was on vacation.

Please, apply.

Denis.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wide-int, avr
  2014-01-02  1:55 ` Mike Stump
@ 2014-01-02  1:59   ` Mike Stump
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Stump @ 2014-01-02  1:59 UTC (permalink / raw)
  To: Mike Stump
  Cc: gcc-patches@gcc.gnu.org Patches, Denis Chertykov, Kenneth Zadeck

On Jan 1, 2014, at 5:55 PM, Mike Stump <mikestump@comcast.net> wrote:
> On Nov 23, 2013, at 11:19 AM, Mike Stump <mikestump@comcast.net> wrote:
>> Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the avr port.
> 
>> Ok?
> 
> Ping?

Ignore this one.  For some reason my Mail reader didn't collapse the reply into the right thread…  ouch.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wide-int, avr
  2013-11-23 19:22 Mike Stump
@ 2014-01-02  1:55 ` Mike Stump
  2014-01-02  1:59   ` Mike Stump
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Stump @ 2014-01-02  1:55 UTC (permalink / raw)
  To: Mike Stump
  Cc: gcc-patches@gcc.gnu.org Patches, Denis Chertykov, Kenneth Zadeck

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

On Nov 23, 2013, at 11:19 AM, Mike Stump <mikestump@comcast.net> wrote:
> Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the avr port.

> Ok?

Ping?


[-- Attachment #2: wide-int-avr.diffs.txt --]
[-- Type: text/plain, Size: 2062 bytes --]

	* config/avr/avr.c
	(avr_out_round): Use wide-int interfaces.
	(avr_fold_builtin): Likewise.


diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 8d98c81..e94e0d7 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -7550,6 +7550,8 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen)
   // The smallest fractional bit not cleared by the rounding is 2^(-RP).
   int fbit = (int) GET_MODE_FBIT (mode);
   double_int i_add = double_int_zero.set_bit (fbit-1 - INTVAL (xop[2]));
+  wide_int wi_add = wi::set_bit_in_zero (fbit-1 - INTVAL (xop[2]),
+					 GET_MODE_PRECISION (imode));
   // Lengths of PLUS and AND parts.
   int len_add = 0, *plen_add = plen ? &len_add : NULL;
   int len_and = 0, *plen_and = plen ? &len_and : NULL;
@@ -7579,7 +7581,7 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen)
   // Rounding point                           ^^^^^^^
   // Added above                                      ^^^^^^^^^
   rtx xreg = simplify_gen_subreg (imode, xop[0], mode, 0);
-  rtx xmask = immed_double_int_const (-i_add - i_add, imode);
+  rtx xmask = immed_wide_int_const (-wi_add - wi_add, imode);
 
   xpattern = gen_rtx_SET (VOIDmode, xreg, gen_rtx_AND (imode, xreg, xmask));
 
@@ -12230,7 +12232,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
             break;
           }
 
-        tmap = double_int_to_tree (map_type, tree_to_double_int (arg[0]));
+        tmap = wide_int_to_tree (map_type, arg[0]);
         map = TREE_INT_CST_LOW (tmap);
 
         if (TREE_CODE (tval) != INTEGER_CST
@@ -12335,8 +12337,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
 
         /* Use map o G^-1 instead of original map to undo the effect of G.  */
 
-        tmap = double_int_to_tree (map_type,
-				   double_int::from_uhwi (best_g.map));
+        tmap = wide_int_to_tree (map_type, best_g.map);
 
         return build_call_expr (fndecl, 3, tmap, tbits, tval);
       } /* AVR_BUILTIN_INSERT_BITS */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* wide-int, avr
@ 2013-11-23 19:22 Mike Stump
  2014-01-02  1:55 ` Mike Stump
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Stump @ 2013-11-23 19:22 UTC (permalink / raw)
  To: gcc-patches@gcc.gnu.org Patches; +Cc: Denis Chertykov, Kenneth Zadeck

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the avr port.

Ok?


[-- Attachment #2: wide-int-avr.diffs.txt --]
[-- Type: text/plain, Size: 2062 bytes --]

	* config/avr/avr.c
	(avr_out_round): Use wide-int interfaces.
	(avr_fold_builtin): Likewise.


diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 8d98c81..e94e0d7 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -7550,6 +7550,8 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen)
   // The smallest fractional bit not cleared by the rounding is 2^(-RP).
   int fbit = (int) GET_MODE_FBIT (mode);
   double_int i_add = double_int_zero.set_bit (fbit-1 - INTVAL (xop[2]));
+  wide_int wi_add = wi::set_bit_in_zero (fbit-1 - INTVAL (xop[2]),
+					 GET_MODE_PRECISION (imode));
   // Lengths of PLUS and AND parts.
   int len_add = 0, *plen_add = plen ? &len_add : NULL;
   int len_and = 0, *plen_and = plen ? &len_and : NULL;
@@ -7579,7 +7581,7 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen)
   // Rounding point                           ^^^^^^^
   // Added above                                      ^^^^^^^^^
   rtx xreg = simplify_gen_subreg (imode, xop[0], mode, 0);
-  rtx xmask = immed_double_int_const (-i_add - i_add, imode);
+  rtx xmask = immed_wide_int_const (-wi_add - wi_add, imode);
 
   xpattern = gen_rtx_SET (VOIDmode, xreg, gen_rtx_AND (imode, xreg, xmask));
 
@@ -12230,7 +12232,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
             break;
           }
 
-        tmap = double_int_to_tree (map_type, tree_to_double_int (arg[0]));
+        tmap = wide_int_to_tree (map_type, arg[0]);
         map = TREE_INT_CST_LOW (tmap);
 
         if (TREE_CODE (tval) != INTEGER_CST
@@ -12335,8 +12337,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
 
         /* Use map o G^-1 instead of original map to undo the effect of G.  */
 
-        tmap = double_int_to_tree (map_type,
-				   double_int::from_uhwi (best_g.map));
+        tmap = wide_int_to_tree (map_type, best_g.map);
 
         return build_call_expr (fndecl, 3, tmap, tbits, tval);
       } /* AVR_BUILTIN_INSERT_BITS */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-02  1:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-23 19:23 wide-int, avr Mike Stump
2013-12-03 13:53 ` Denis Chertykov
  -- strict thread matches above, loose matches on Subject: below --
2013-11-23 19:22 Mike Stump
2014-01-02  1:55 ` Mike Stump
2014-01-02  1:59   ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).