[fpc-devel] -i and -Cp

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Wed Oct 17 22:51:01 CEST 2012


Mark Morgan Lloyd wrote:

>> Regarding Marks attempt - if I understand it correctly (based on
>> information in Wikipedia ;-) ), Sparc v7 supports no HW multiplication /
>> division. So a simple check may be to write a one liner containing
>> multiplication, compiling it with any ppcsparc (or ppccrosssparc) while
>> using the -s parameter and then checking the generated assembly for 
>> use of
>> the mul/div asm instructions...

Using this test input:

program test789;

const	a= 3;

var	b, c: integer;

begin
   b := 5;
   c := b * a
end.

Output (test789.s) files are identical containing

# [9] c := b * a
	sethi	%hi(U_P$TEST7_B),%o0
	ldsh	[%lo(U_P$TEST7_B)+%o0],%o0
	smul	%o0,3,%o0

I agree that smul is new to v8, but I don't know to what extent OSes on 
older chips would emulate it (the v8 manual suggests this as a possibility).

In any event, the -Cp parameter doesn't appear to be being carried 
through to the ELF info generated by ld, in all cases it reports

ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), 
statically linked, stripped

which is probably inappropriate in the case of v7. Hmm. On a Solaris 8 
system I notice

/usr/local/bin/gld:     ELF 32-bit MSB executable SPARC Version 1, 
dynamically linked, stripped

while FPC compiled on the same machine is described as

/usr/local/bin/fpc:     ELF 32-bit MSB executable SPARC32PLUS Version 1, 
V8+ Required, dynamically linked, not stripped

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-devel mailing list