Parameter evaluation order is ub so you cannot rely on that, regardless of
inlining.
And even though the intrinsic could behave differently it still looks like a
regular function call and also might clash with existing similarly named
existing function.
> On 27/08/2025 16:40 CEST Hairy Pixels v
No because the feature is related to the state of the ZBS switch at the source
code location, not to the string instance.
> On 07/04/2025 19:40 CEST Bart via fpc-devel
> wrote:
>
>
> On Mon, Apr 7, 2025 at 1:12 PM Marco van de Voort via fpc-devel
> wrote:
>
> > IMHO it is a feature better
For your second feature request it just needs a method added to THashSet
that retrieves the stored item based on the passed key.
> On 27/03/2025 12:28 CET Martin Frb via fpc-devel
> wrote:
>
>
> There are 2 features, I am missing.
>
> And I can't see a way to add them via subclassing, as th
It does not violate the contract imho.
In a TDictionary it would return a pointer to V which is valid because it
either retrieved an existing entry or added a new one with default(v).
I implemented this a while ago in Spring4D roughly following the API that was
introduced in .NET some time ago.
Be my guest making https://github.com/spring4d/benchmark compatible for all
platforms you need it for.
> On 10/10/2023 11:13 CEST J. Gareth Moreton via fpc-devel
> wrote:
>
>
> Thanks Tomas,
>
> Nothing is broken, but the timing measurement isn't precise enough.
>
> Normally I have a much
> FWIW in 3.2.2 I don't see the -1 check and the idiv causes an int overflow
> exception. But silently returning 0 for min_int div -1 feels very wrong IMO.
Pardon, debugger fooled me - I was meant to say "silently returning min_int".
> > On 15/05/2023 18:43 CEST Kirinn via fpc-devel
> > wrote:
FWIW in 3.2.2 I don't see the -1 check and the idiv causes an int overflow
exception. But silently returning 0 for min_int div -1 feels very wrong imo.
> On 15/05/2023 18:43 CEST Kirinn via fpc-devel
> wrote:
>
>
> I didn't see a mention of it in this discussion thread, but dividing the
> la
Looks like a rather disadvantageous way to avoid the idiv instruction because x
div -1 = -x and x mod -1 = 0.
I ran a quick benchmark doing a lot of integer divisions where sometimes
(randomly) the divisor was -1. When the occurence was rare enough (~5%) the
performance was not impacted, the hi
> I think Delphi basically has the same constraints as C#
Not quite (well maybe back then when they implemented them but C# improved
since)- also they are subtly implemented differently.
In C# the constraint *class* means "a reference type" - in Delphi it actually
means it has to be a class.
C
More like a variation of that: TimSort - but that's rather a beast to
implement properly and efficient.
Am 29.11.2022 um 14:41 schrieb J. Gareth Moreton via fpc-devel:
Quicksort is not inherently stable because of what happens if a value
is equal to the pivot - more specifically, which of the
That is not a very good IntroSort to be honest. It is missing using
InsertionSort for small numbers and it does not do the median-of-3 pivot
selection.
Am 29.11.2022 um 09:22 schrieb Nikolay Nikolov via fpc-devel:
On 11/24/22 20:51, J. Gareth Moreton via fpc-devel wrote:
Hi everyone,
I just
Where exactly can that stable quicksort be found? rtl/inc/sortbase.pp
looks pretty much like standard quicksort to me.
Am 29.11.2022 um 11:08 schrieb Sven Barth via fpc-devel:
J. Gareth Moreton via fpc-devel
schrieb am Di., 29. Nov. 2022, 10:09:
Surely that's a bug in the comparison func
Nevermind - I guess there is:
https://www.freepascal.org/docs-html/rtl/system/gettypekind.html
Am 28.11.2022 um 12:35 schrieb Stefan Glienke via fpc-devel:
In Delphi that would be the
https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.GetTypeKind
intrinsic - I could not find
In Delphi that would be the
https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.GetTypeKind
intrinsic - I could not find that one in the 3.2.0 feature list.
Am 28.11.2022 um 11:17 schrieb J. Gareth Moreton via fpc-devel:
Well that spoils that idea! Is there any way to determine if
ere's a way that that can be
implemented in a cross-platform way, or if there's a wa to identify if
a generic type is a pointer/managed type.
Kit
On 25/11/2022 16:00, Stefan Glienke via fpc-devel wrote:
>From experience I can tell that IntroSort is fast enough.
The main perfo
From experience I can tell that IntroSort is fast enough.
The main performance improvement usually comes from treating anything that is a
managed type such as strings as Pointers - instead of three string assignments
that cause a bunch of unnecessary atomic operations you then just have 3
point
Interestingly this is what clang also does:
https://godbolt.org/z/Y4v14f9s3
> On 17/08/2022 02:21 CEST J. Gareth Moreton via fpc-devel
> wrote:
>
>
> Hi everyone,
>
> Recently I've made some optimisations centred around the SHR instruction
> on x86, and there was one pair of instructions
Both clang and gcc seem to do this
> On 30/06/2022 17:28 CEST J. Gareth Moreton via fpc-devel
> wrote:
>
>
> This was what I was working on:
>
> https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/252
>
> The same question applies regarding the TEST instruction, but it's a
> litt
Am 09.06.2022 um 16:07 schrieb Bart via fpc-devel:
On Thu, Jun 9, 2022 at 1:53 PM Stefan Glienke via fpc-devel
wrote:
I usually don't take 20 year old compilers as reference
That's all that I have.
I do Lazarus/Fpc as a hobby and am unwilling to spend lost of money on Delphi.
Also
Am 08.06.2022 um 19:24 schrieb Bart via fpc-devel:
On Wed, Jun 8, 2022 at 3:55 PM Stefan Glienke via fpc-devel
wrote:
Actually the behavior in Delphi depends on the $R switch.
D7:
{$R+}
ConvTypeToDescription(-1)=[$]
{$R-}
ConvTypeToDescription(-1)=[$]
Bart
I usually don
> On 08/06/2022 14:58 Bart via fpc-devel wrote:
>
> code like this will not raise an exception Delphi, while it does
> in Fpc:
>
> var
> L: Integer;
> begin
> L:=-1;
> writeln('ConvTypeToDescription(L)=',ConvTypeToDescription(L)); //
> prints [$] in D7, EAccessViolation in fpc
> e
vel
> wrote:
>
>
> Interesting - I wasn't aware of this intrinsic! I'll make a note of
> that one.
>
> It might be useful to transform FillChar calls to the Default intrinsic
> at the node level.
>
> Gareth aka. Kit
>
> On 19/04/2022 12:43, Stefan Gl
rth via fpc-devel
> wrote:
>
>
> Stefan Glienke via fpc-devel schrieb am Di.,
> 19. Apr. 2022, 12:38:
> > If you want to zero small records more efficiently it might be better using
> > Default(t) for that and looking at optimizing the code the compiler
> &g
If you want to zero small records more efficiently it might be better using
Default(t) for that and looking at optimizing the code the compiler generates
for that as it seems it produces an empty temp variable which it assigns
instead of simply zeroing the record variable where default() is bein
JEP 420 is hardly a misnomer because it is so much more than just type checking
in a switch statement - hence pattern matching.
You can see in the various examples that you can combine all kinds of boolean
expressions - C# has had this for quite a while and they are constantly
improving it.
That
won't code it,
> although in the case of the "fast mod" algorithm, it appears very
> frequently, so should probably be coded directly, especially as the
> multiplication can take 3 cycles, depending on the processor, and is the
> limiting factor.
>
> Gareth aka. K
According to compiler explorer clang, gcc and msvc compile this to the
same code with -O3 as FPC does. So I would assume that is fine.
Am 17.10.2021 um 13:25 schrieb J. Gareth Moreton via fpc-devel:
Hi everyone,
While reading up on some algorithms, I came across a recommendation of
using a sh
Keep in mind that usually test/cmp and jcc instructions are macrofused
but only if they are directly adjacent.
Am 01.10.2021 um 18:10 schrieb J. Gareth Moreton via fpc-devel:
Hi everyone,
I've started playing around with an optimisation on x86 platforms that
looks for common instructions that
28 matches
Mail list logo