From 8e60465eb45a6eb6c3e00d0594e68799a882b6e5 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Thu, 3 Oct 2013 11:59:25 +0000 Subject: [PATCH] Fix the last failing tcnvint test (plus another one) by using comparisons that are not necessarily 32-bit. m68k/n68kadd.pas, tn68kadd.second_cmpordinal: * use the size of the largest operand to select a fiting operand * ToDo: check whether a sign/zero extend of the value is necessary git-svn-id: trunk@25628 - --- compiler/m68k/n68kadd.pas | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/compiler/m68k/n68kadd.pas b/compiler/m68k/n68kadd.pas index 95090091cb..217e262298 100644 --- a/compiler/m68k/n68kadd.pas +++ b/compiler/m68k/n68kadd.pas @@ -546,12 +546,16 @@ implementation unsigned : boolean; useconst : boolean; tmpreg : tregister; - op : tasmop; + opsize : topsize; + cmpsize : tcgsize; begin pass_left_right; { set result location } location_reset(location,LOC_JUMP,OS_NO); + { ToDo : set "allowconstants" to True, but this seems to upset Coldfire + a bit for the CMP instruction => check manual and implement + exception accordingly below } { load values into registers (except constants) } force_reg_left_right(true, false); @@ -598,20 +602,30 @@ implementation useconst := false; location.loc := LOC_FLAGS; location.resflags := getresflags(unsigned); - op := A_CMP; + if tcgsize2size[right.location.size]=tcgsize2size[left.location.size] then + cmpsize:=left.location.size + else + { ToDo : zero/sign extend??? } + if tcgsize2size[right.location.size]