View Issue Details

IDProjectCategoryView StatusLast Update
0031012FPCCompilerpublic2017-02-21 04:02
ReporterMarco van de Voort Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status newResolutionopen 
Product Version3.1.1 
Summary0031012: (Delphi) .pushnv .saveenv assembler directives
DescriptionDelphi has (in 64-bit mode) two directives to save non volatile registers.

.pushnv <registername> -> save non volatile register
.savenv <registername> -> save (vector) register to its home location.

there are also some directives that I don't have experience with:
.noframe -> leaf procedure (nostackframe in asm ?)
.params <number> -> This pseudo-instruction maps the function parameters in accordance with the x64 calling convention


This allows the compiler/assembler to build the stack frame in many simple cases for assembler; procedures. (SEH frame generation and stack alignment rules?)

There are also .params and .noframe
Steps To Reproduceexcerpt of a function

procedure asmColourDistance(prgba1,prgba2 : pbyte;pdest8:pbyte;countinner,countouter: integer);assembler;
// src= rcx src2, rdx, pdest8 r8 countinner=r9,countouter=stack
asm
        .pushnv r12
        .savenv xmm6
        .savenv xmm7
        .savenv xmm8
        .savenv xmm9
        .savenv xmm10
        .savenv xmm11
        .savenv xmm12
        .savenv xmm13
        .savenv xmm14
        .savenv xmm15


        mov eax,countouter
        // mov r9,countinner
        shr r9,4
        movdqu xmm11,[rip+and127]
        movdqu xmm12,[rip+splitsh1]
        movdqu xmm13,[rip+splitsh2]
        movdqu xmm14,[rip+splitsh3]
        movdqu xmm15,[rip+splitsh4]

end;
TagsNo tags attached.
Fixed in Revision
FPCOldBugId0
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2016-11-26 16:39 Marco van de Voort New Issue
2016-11-26 16:40 Marco van de Voort Severity minor => feature
2016-11-26 16:40 Marco van de Voort Description Updated View Revisions
2016-11-26 16:47 Marco van de Voort Description Updated View Revisions
2016-12-01 14:51 Marco van de Voort Description Updated View Revisions
2016-12-19 23:17 Marco van de Voort Description Updated View Revisions