#1 2020-02-19 01:53:02

Vitaly
Member
From: UAE
Registered: 2017-01-31
Posts: 168
Website

Inline assembler syntax error

I'm getting now a compilation error

[dcc64 Error] SynCommons.pas(21145): E2105 Inline assembler syntax error
{$ifdef CPUX64}
function GetBitsCountSSE42(value: PtrInt): PtrInt;
{$ifdef FPC} assembler; nostackframe;
asm
        popcnt  rax, value
{$else}
asm     .noframe
        db      $f3,$48,$0f,$B8,{$ifdef win64}$c1{$else}$c7{$endif}                   <---------------------------- here
{$endif FPC}
end;

As far as I understood, the change appeared in the commit cfa40bb "new optimized asm versions of most-used sorting/comparison functions".
Delphi 10.3.3, Win64 target platform

Offline

#2 2020-02-19 11:24:55

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Inline assembler syntax error

Offline

#3 2020-02-19 12:13:23

Vitaly
Member
From: UAE
Registered: 2017-01-31
Posts: 168
Website

Re: Inline assembler syntax error

Yes, it is fixed, now. Thanks! smile

Although in one of my projects I began getting such a new (for me) exception:

20200219 11555249  +    SynDBZeos.TSQLDBZEOSStatement(0470a560).ExecutePrepared
20200219 11555249 SQL           SynDBZeos.TSQLDBZEOSStatement(0470a560) select ID,Name,PeriodType,PeriodSettings,OnOff,ActiveStart,ActiveEnd,Status,LastRun from UPKEEP_SCHEDULE where OnOff=1 and Status=0
20200219 11555249  -    00.002.479
20200219 11555748 EXC   ESynException {"Message":"TRawUTF8ListHashed.Rehash collisions=1"} [] at 604cc6

I guess, it might be some my mistake, which just didn't show up earlier without the latest changes. Maybe you could give a hint on which direction I should dig to find it out?
It is a multi-threaded windows service, threads are actively using one TSQLRestServerDB instance (Zeos-Firebird), no http-server.

Offline

#4 2020-02-19 15:13:34

trx
Member
Registered: 2015-08-30
Posts: 30

Re: Inline assembler syntax error

I have the same error. I haven't had time to investigate so I've just made a quick fix in SynCommons.pas at line ~60429:

procedure TRawUTF8ListHashed.RehashOnChanged;
...
  collisions := fHash.Rehash({forced=}false); // I've set this to false.
...

I can provide a stack trace if needed.

Last edited by trx (2020-02-19 15:14:28)

Offline

#5 2020-02-21 16:24:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Inline assembler syntax error

It was in fact that during the refactoring, TRawUTF8ListHashed doesn't support duplicated values, I guess here duplicated SQL in its statement cache entries - which shouldn't occur.

In fact, this class was a bit misdesigned.
The "changed" trigger, and how overriden methods work were a mess for sure, and really confusing (even for me).

I tried to make it better with a deep refactoring including some fixes in this particular regard.
It should fix your particular problem.
Please check https://synopse.info/fossil/info/28a787660206aac4

Offline

#6 2020-02-21 16:46:36

trx
Member
Registered: 2015-08-30
Posts: 30

Re: Inline assembler syntax error

Thank you!

Offline

#7 2020-02-21 20:19:52

Vitaly
Member
From: UAE
Registered: 2017-01-31
Posts: 168
Website

Re: Inline assembler syntax error

The problem is gone, many thanks! smile

Offline

#8 2020-02-21 21:53:17

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Inline assembler syntax error

Thanks for the feedback!

And sorry for the little delay: it needed more than a small fix, but a full rewrite of the class(es) to have something more stable and maintainable.
big_smile

Offline

Board footer

Powered by FluxBB