+ make use of the armv6+ sign/zero extension instructions if appropriate

git-svn-id: trunk@22013 -
This commit is contained in:
florian 2012-08-05 14:04:11 +00:00
parent eb1efdff8a
commit e81ba0f82e
2 changed files with 53 additions and 28 deletions

View File

@ -668,7 +668,9 @@ implementation
A_FMDHR,A_FMRDH,A_FMDLR,A_FMRDL,
A_FNEGS,A_FNEGD,
A_FSITOS,A_FSITOD,A_FTOSIS,A_FTOSID,
A_FTOUIS,A_FTOUID,A_FUITOS,A_FUITOD:
A_FTOUIS,A_FTOUID,A_FUITOS,A_FUITOD,
A_SXTB16,A_UXTB16,
A_UXTB,A_UXTH,A_SXTB,A_SXTH:
if opnr=0 then
result:=operand_write
else

View File

@ -1194,33 +1194,56 @@ unit cgcpu;
conv_done:=true;
if tcgsize2size[tosize]<=tcgsize2size[fromsize] then
fromsize:=tosize;
case fromsize of
OS_8:
list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
OS_S8:
begin
do_shift(SM_LSL,24,reg1);
if tosize=OS_16 then
begin
do_shift(SM_ASR,8,reg2);
do_shift(SM_LSR,16,reg2);
end
else
do_shift(SM_ASR,24,reg2);
end;
OS_16:
begin
do_shift(SM_LSL,16,reg1);
do_shift(SM_LSR,16,reg2);
end;
OS_S16:
begin
do_shift(SM_LSL,16,reg1);
do_shift(SM_ASR,16,reg2)
end;
else
conv_done:=false;
end;
if current_settings.cputype<cpu_armv6 then
case fromsize of
OS_8:
list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
OS_S8:
begin
do_shift(SM_LSL,24,reg1);
if tosize=OS_16 then
begin
do_shift(SM_ASR,8,reg2);
do_shift(SM_LSR,16,reg2);
end
else
do_shift(SM_ASR,24,reg2);
end;
OS_16:
begin
do_shift(SM_LSL,16,reg1);
do_shift(SM_LSR,16,reg2);
end;
OS_S16:
begin
do_shift(SM_LSL,16,reg1);
do_shift(SM_ASR,16,reg2)
end;
else
conv_done:=false;
end
else
case fromsize of
OS_8:
list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
OS_S8:
begin
if tosize=OS_16 then
begin
list.concat(taicpu.op_reg_reg_const(A_AND,reg2,reg1,$ff));
list.concat(taicpu.op_reg_reg(A_SXTB16,reg2,reg2));
end
else
list.concat(taicpu.op_reg_reg(A_SXTB,reg2,reg1));
end;
OS_16:
list.concat(taicpu.op_reg_reg(A_UXTH,reg2,reg1));
OS_S16:
list.concat(taicpu.op_reg_reg(A_SXTH,reg2,reg1));
else
conv_done:=false;
end
end;
if not conv_done and (reg1<>reg2) then
begin