t...@gmplib.org (Torbjörn Granlund) writes:
A crude test generator:
A slightly better variant. It expects an argument, either "add" or
"sub", allowing it to test both add_ss and sub_ddmmss.
This version should work fine on 32-bit systems without modification.
This code is not
Dear Torbjörn,
> A crude test generator: [...]
great! On gcc115 it fails with the longlong.h shipped with GMP 6.2.0:
zimmerma@gcc115:/tmp/gmp-6.2.0$ /opt/cfarm/gcc-latest/bin/gcc test.c
zimmerma@gcc115:/tmp/gmp-6.2.0$ ./a.out > test1.c
zimmerma@gcc115:/tmp/gmp-6.2.0$
Vincent Lefevre writes:
Note: in the tests, it is important to test the macro on constants
in order to test the "if" case.
A crude test generator:
#include
#include
#include "gmp-impl.h"
void
one (size_t ind, mp_limb_t m0, mp_limb_t s0)
{
printf ("void f%zu(mp_limb_t* r1p, mp_limb_t*
Paul Zimmermann writes:
>Dear Niels,
>
>> The excluded case,
>>
>> sub_ddmmss(ah, al, bh, /*compile time constant*/0)
>>
>> could clearly be optimized, in a different way, but I'd guess it's rare
>> enough in real code to not be worth the effort?
Sorry for being unclear, sub_ddmmss
Dear Niels,
> The excluded case,
>
> sub_ddmmss(ah, al, bh, /*compile time constant*/0)
>
> could clearly be optimized, in a different way, but I'd guess it's rare
> enough in real code to not be worth the effort?
in MPFR we have 15 places where we call sub_ddmmss, among which 8 have
ni...@lysator.liu.se (Niels Möller) writes:
And, which I guess is more relevant in the sub_ddmmss context, it also
means that there's little need for separate instructions for adding and
subtracting constants.
The error we struck here for ARM and (one of the errors) for PPC was
that we
t...@gmplib.org (Torbjörn Granlund) writes:
> > {cout, r} = a + ~b + cin
>
> This is a - b - borrow, where the borrow is the complement of the
> carry bit.
>
> Niels' definition is important as it captures the similarity with
> addition. It is indeed how the instructions are described in
Vincent Lefevre writes:
On 2020-06-17 11:04:26 +0200, Niels Möller wrote:
> t...@gmplib.org (Torbjörn Granlund) writes:
>
> > The two - signs ought to be ~, I think. Let me think a buit more about
that.
>
> If I remember ARM conventions correctly, subtract with carry is defined
On 2020-06-17 11:04:26 +0200, Niels Möller wrote:
> t...@gmplib.org (Torbjörn Granlund) writes:
>
> > The two - signs ought to be ~, I think. Let me think a buit more about
> > that.
>
> If I remember ARM conventions correctly, subtract with carry is defined
> as
>
> {cout, r} = a + ~b +
ni...@lysator.liu.se (Niels Möller) writes:
t...@gmplib.org (Torbjörn Granlund) writes:
> The two - signs ought to be ~, I think. Let me think a buit more about
that.
If I remember ARM conventions correctly, subtract with carry is defined
as
{cout, r} = a + ~b + cin
Here we
t...@gmplib.org (Torbjörn Granlund) writes:
> The two - signs ought to be ~, I think. Let me think a buit more about that.
If I remember ARM conventions correctly, subtract with carry is defined
as
{cout, r} = a + ~b + cin
Regards,
/Niels
--
Niels Möller. PGP-encrypted email is preferred.
11 matches
Mail list logo