Re: Optimize mul_var() for var1ndigits >= 8 - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Optimize mul_var() for var1ndigits >= 8
Date
Msg-id CAEZATCUZy3Qk9hQNXVF2UacV==UFjbjUyJgeKrV70M52QgocpQ@mail.gmail.com
Whole thread Raw
In response to Re: Optimize mul_var() for var1ndigits >= 8  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: Optimize mul_var() for var1ndigits >= 8
List pgsql-hackers
On Mon, 29 Jul 2024 at 21:39, Joel Jacobson <joel@compiler.org> wrote:
>
> I like these simplifications, how `var2ndigits` is used instead of `res_ndigits`:
> -                       for (int i = res_ndigits - 3; i >= 1; i--)
> +                       for (int i = var2ndigits - 1; i >= 1; i--)
>
> But I wonder why does `case 1:`  not follow the same pattern?
>                         for (int i = res_ndigits - 2; i >= 0; i--)
>

Ah yes, that should be made the same. (I think I did do that at one
point, but then accidentally reverted it during a code refactoring.)

> * v3-0002
>
> I think it's non-obvious if the separate code paths for 32-bit and 64-bit,
> using `#if SIZEOF_DATUM < 8`, to get *fast* 32-bit support, outweighs
> the benefits of simpler code.
>
> You brought up the question if 32-bit systems should be regarded
> as legacy previously in this thread.
>
> Unfortunately, we didn't get any feedback, so I'm starting a separate
> thread, with subject "Is fast 32-bit code still important?", hoping to get
> more input to help us make judgement calls.
>

Looking at that other thread that you found [1], I think it's entirely
possible that there are people who care about 32-bit systems, which
means that we might well get complaints, if we make it slower for
them. Unfortunately, I don't have any way to test that (I doubt that
running a 32-bit executable on my x86-64 system is a realistic test).

Regards,
Dean

[1] https://postgr.es/m/0a71b43129fb447988f152941e1dbcb3@nidsa.net



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Remove last traces of HPPA support
Next
From: Tom Lane
Date:
Subject: Speeding up ruleutils' name de-duplication code, redux