View Issue Details

IDProjectCategoryView StatusLast Update
0035867FPCDocumentationpublic2019-07-22 09:38
ReporterKai BurghardtAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSGNU/LinuxOS Version4.2.0
Product Version3.0.4Product Build 
Target VersionFixed in Version3.3.1 
Summary0035867: programmer’s guide: document 128b results
Descriptionhttps://www.freepascal.org/docs-html/prog/progsu138.html#x168-1700006.1.8

Please document, that rdx:rax may (for integral result types) hold a `OS_128` result.
Steps To ReproduceThis works fine:

{$ifDef CPUx86_64}
type
    dQWord = packed record
            lo: qWord;
            hi: qWord;
        end;
    {$if sizeOf(dQWord) <> 16}{$fatal dQWord size}{$endIf}

function product(const scale, factor: qWord): dQWord;
register; assembler; {$ifNDef debug} nostackframe; inline; {$endIf}
{$asmmode intel}
asm
    mov rax, scale
    mul factor
end;
{$endIf}
TagsNo tags attached.
Fixed in Revision1634
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Jonas Maebe

2019-07-21 14:00

manager   ~0117336

Last edited: 2019-07-21 14:01

View 2 revisions

That documentation page is outdated; self has not been passed in "esi" since a very long time (also note that the page only documents some i386 registers, not x86-64). I'm also not sure what it means by "scratch regs" (volatile registers? If so, those are incorrect as well)

Apart from i386, which by default uses Borland's register calling convention, all platforms follow the official ABI for calling conventions. For x86-64, this is either the x64 calling convention ( https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019) on Win64, or the official x86-64 ABI (https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI) on all other platforms. It does not make sense to reproduce the ABIs of every supported platform in our own documentation.

I would propose to delete that page altogether, as the 68k information is probably also wrong by now.

Issue History

Date Modified Username Field Change
2019-07-21 13:36 Kai Burghardt New Issue
2019-07-21 13:36 Kai Burghardt Status new => assigned
2019-07-21 13:36 Kai Burghardt Assigned To => Michael Van Canneyt
2019-07-21 14:00 Jonas Maebe Note Added: 0117336
2019-07-21 14:01 Jonas Maebe Note Edited: 0117336 View Revisions
2019-07-22 09:38 Michael Van Canneyt Status assigned => resolved
2019-07-22 09:38 Michael Van Canneyt Resolution open => fixed
2019-07-22 09:38 Michael Van Canneyt Fixed in Version => 3.3.1
2019-07-22 09:38 Michael Van Canneyt Fixed in Revision => 1634
2019-07-22 09:38 Michael Van Canneyt FPCTarget => 3.2.0