mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 06:50:40 +02:00
m68k: if we're loading small (8 bit signed) values into long references, move them through a register (usually with MOVEQ). this is two bytes shorter and also faster on most 68k CPUs
git-svn-id: trunk@32837 -
This commit is contained in:
parent
f69f6336e9
commit
185ee93312
@ -827,7 +827,18 @@ unit cgcpu;
|
||||
list.concat(taicpu.op_reg_ref(A_MOVE,tcgsize2opsize[tosize],hreg,href));
|
||||
end
|
||||
else
|
||||
list.concat(taicpu.op_const_ref(A_MOVE,tcgsize2opsize[tosize],longint(a),href));
|
||||
{ loading via a register is almost always faster if the value is small.
|
||||
(with the 68040 being the only notable exception, so maybe disable
|
||||
this on a '040? but the difference is minor) it also results in shorter
|
||||
code. (KB) }
|
||||
if isvalue8bit(a) and (tcgsize2opsize[tosize] = S_L) then
|
||||
begin
|
||||
hreg:=getintregister(list,OS_INT);
|
||||
a_load_const_reg(list,OS_INT,a,hreg); // this will use moveq et.al.
|
||||
list.concat(taicpu.op_reg_ref(A_MOVE,tcgsize2opsize[tosize],hreg,href));
|
||||
end
|
||||
else
|
||||
list.concat(taicpu.op_const_ref(A_MOVE,tcgsize2opsize[tosize],longint(a),href));
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user