* arm thumb: do not generate illegal ror instructions

git-svn-id: trunk@24439 -
This commit is contained in:
florian 2013-05-04 22:00:17 +00:00
parent 09e742f243
commit e6489ed7d2

View File

@ -3909,38 +3909,25 @@ unit cgcpu;
end end
end; end;
if is_thumb_imm(a) and not(op in [OP_IMUL,OP_MUL,OP_AND,OP_OR,OP_XOR]) then if is_thumb_imm(a) and (op in [OP_ADD,OP_SUB]) then
case op of begin
OP_NEG: // if cgsetflags or setflags then
list.concat(taicpu.op_reg_const(A_NEG,dst,a)); a_reg_alloc(list,NR_DEFAULTFLAGS);
OP_NOT: list.concat(setoppostfix(
list.concat(taicpu.op_reg_const(A_MVN,dst,a)); taicpu.op_reg_const(op_reg_opcg2asmop[op],dst,a),op_reg_postfix[op]));
OP_ROL:
begin
if not(size in [OS_32,OS_S32]) then
internalerror(2008072801);
list.concat(taicpu.op_reg_const(A_ROR,dst,a));
end;
else
begin
// if cgsetflags or setflags then
a_reg_alloc(list,NR_DEFAULTFLAGS);
list.concat(setoppostfix(
taicpu.op_reg_const(op_reg_opcg2asmop[op],dst,a),op_reg_postfix[op]));
end;
if (cgsetflags {!!! or setflags }) and (size in [OS_8,OS_16,OS_32]) then if (cgsetflags {!!! or setflags }) and (size in [OS_8,OS_16,OS_32]) then
begin begin
//!!! ovloc.loc:=LOC_FLAGS; //!!! ovloc.loc:=LOC_FLAGS;
case op of case op of
OP_ADD: OP_ADD:
//!!! ovloc.resflags:=F_CS; //!!! ovloc.resflags:=F_CS;
; ;
OP_SUB: OP_SUB:
//!!! ovloc.resflags:=F_CC; //!!! ovloc.resflags:=F_CC;
; ;
end;
end; end;
end;
end end
else else
begin begin