This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 69400: Invalid 128-bit modulus result
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, nd at arm dot com, richard dot sandiford at arm dot com
- Date: Fri, 22 Jan 2016 11:09:59 +0100
- Subject: Re: PR 69400: Invalid 128-bit modulus result
- Authentication-results: sourceware.org; auth=none
- References: <8760ymj6ef dot fsf at e105548-lin dot cambridge dot arm dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jan 22, 2016 at 09:43:52AM +0000, Richard Sandiford wrote:
> gcc/
> PR tree-optimization/69400
> * wide-int.cc (wi_pack): Take the precision as argument and
> perform canonicalization here rather than in the callers.
> Use the main loop to handle all full-width HWIs. Add a
> zero HWI if in_len isn't a full result.
> (wi::divmod_internal): Update accordingly.
> (wi::mul_internal): Likewise. Simplify.
>
> gcc/testsuite/
> PR tree-optimization/69400
> * gcc.dg/plugin/wide-int_plugin.c (test_wide_int_mod_trunc): New
> function.
> (plugin_init): Call it.
I'd prefer to see also the testcase from the PR in the testsuite in addition
to the unit test. Just make it /* { dg-do run { target int128 } } */
and put into gcc.dg/torture/
> --- a/gcc/wide-int.cc
> +++ b/gcc/wide-int.cc
> @@ -1215,29 +1215,31 @@ wi_unpack (unsigned HOST_HALF_WIDE_INT *result, const HOST_WIDE_INT *input,
> }
>
> /* The inverse of wi_unpack. IN_LEN is the the number of input
I know you haven't touched this line and it is preexisting, but when
touching this, please also fix the "the the".
Ok with those changes.
Jakub