[fpc-devel] Re: systemh.inc InterLockedIncrement64 (var Target: int64)

Andrew Brunner andrew.t.brunner at gmail.com
Wed Oct 27 23:50:08 CEST 2010


My current largest issue is that due to source from from x86_64.inc

function InterLockedIncrement64 (var Target: int64) : int64; assembler;
asm
{$ifdef win64}
        movq    %rcx,%rax
{$else win64}
        movq    %rdi,%rax
{$endif win64}
        movq    $1,%rdx
        xchgq   %rdx,%rax
        lock
        xaddq   %rax, (%rdx)
        incq    %rax
end;

This code should not be excluded from me under i386 mode.  How many 32
bit versions of FPC / Lazarus are out there with access to x64 cpu
instructions.  Coder: caveat emptor here.  I drop my argument for the
merging of Interlocked*64 to just Interlocked but I really think it
would be good to have access to this code.  Which presently any
working with i386 build of FPC are not even if in my project options
(Lazarus) i set -dcpu64.

So here I am with x64 cpu but with i386 build of Windows/FPC/Laz I
cannot execute Interlocked*64(..) on my machine...

On Wed, Oct 27, 2010 at 4:42 PM, Andrew Brunner
<andrew.t.brunner at gmail.com> wrote:
> On Wed, Oct 27, 2010 at 4:37 PM, Vinzent Höfler
> <JeLlyFish.software at gmx.net> wrote:
>> On Wed, 27 Oct 2010 23:26:00 +0200, Andrew Brunner
>> <andrew.t.brunner at gmail.com> wrote:
>>
>> I didn't say "restart", I said "lock out the reader for a moment".
>> Maybe it's easier to grasp if I put it in some pseudo-code:
>>
>> -- 8< --
>> Lock_Readers;
>
> I'm not wanting to place locks all over the place when we have cpu locks.
>



More information about the fpc-devel mailing list