|
@@ -1143,7 +1143,33 @@ implementation
|
|
{$ifdef cpuflags}
|
|
{$ifdef cpuflags}
|
|
LOC_FLAGS :
|
|
LOC_FLAGS :
|
|
begin
|
|
begin
|
|
- if is_pasbool(left.resultdef) then
|
|
|
|
|
|
+ { check for cbool here as booleans converted to other types shall be handled as pas booleans,
|
|
|
|
+ see also tests/webtbs/tw40908.pp }
|
|
|
|
+ if is_cbool(left.resultdef) then
|
|
|
|
+ begin
|
|
|
|
+{$if not defined(cpu64bitalu) and not defined(cpuhighleveltarget)}
|
|
|
|
+ if left.location.size in [OS_S64,OS_64] then
|
|
|
|
+ begin
|
|
|
|
+ r64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
|
|
|
+ r64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
|
|
|
+ cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,r64.reglo);
|
|
|
|
+ cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
|
|
|
+ cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,r64.reghi);
|
|
|
|
+ cg64.a_op64_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_S64,
|
|
|
|
+ r64,r64);
|
|
|
|
+ cg64.a_load64_reg_loc(current_asmdata.CurrAsmList,r64,left.location);
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+{$endif not cpu64bitalu and not cpuhighleveltarget}
|
|
|
|
+ begin
|
|
|
|
+ r:=cg.getintregister(current_asmdata.CurrAsmList,left.location.size);
|
|
|
|
+ cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,r);
|
|
|
|
+ cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
|
|
|
+ cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,left.location.size,r,r);
|
|
|
|
+ hlcg.a_load_reg_loc(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,r,left.location);
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ else
|
|
begin
|
|
begin
|
|
case left.location.loc of
|
|
case left.location.loc of
|
|
LOC_REGISTER,LOC_CREGISTER:
|
|
LOC_REGISTER,LOC_CREGISTER:
|
|
@@ -1189,30 +1215,6 @@ implementation
|
|
else
|
|
else
|
|
internalerror(200203273);
|
|
internalerror(200203273);
|
|
end;
|
|
end;
|
|
- end
|
|
|
|
- else
|
|
|
|
- begin
|
|
|
|
-{$if not defined(cpu64bitalu) and not defined(cpuhighleveltarget)}
|
|
|
|
- if left.location.size in [OS_S64,OS_64] then
|
|
|
|
- begin
|
|
|
|
- r64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
|
|
|
- r64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
|
|
|
- cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,r64.reglo);
|
|
|
|
- cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
|
|
|
- cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,r64.reghi);
|
|
|
|
- cg64.a_op64_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_S64,
|
|
|
|
- r64,r64);
|
|
|
|
- cg64.a_load64_reg_loc(current_asmdata.CurrAsmList,r64,left.location);
|
|
|
|
- end
|
|
|
|
- else
|
|
|
|
-{$endif not cpu64bitalu and not cpuhighleveltarget}
|
|
|
|
- begin
|
|
|
|
- r:=cg.getintregister(current_asmdata.CurrAsmList,left.location.size);
|
|
|
|
- cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,r);
|
|
|
|
- cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
|
|
|
- cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,left.location.size,r,r);
|
|
|
|
- hlcg.a_load_reg_loc(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,r,left.location);
|
|
|
|
- end
|
|
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
{$endif cpuflags}
|
|
{$endif cpuflags}
|