Преглед на файлове

* fixed more missing subsetreg/subsetref support

git-svn-id: trunk@4595 -
Jonas Maebe преди 19 години
родител
ревизия
e2872c9aea
променени са 4 файла, в които са добавени 22 реда и са изтрити 1 реда
  1. 1 0
      .gitattributes
  2. 7 0
      compiler/x86/nx86cnv.pas
  3. 5 1
      compiler/x86/nx86mat.pas
  4. 9 0
      tests/webtbs/tw7379.pp

+ 1 - 0
.gitattributes

@@ -7287,6 +7287,7 @@ tests/webtbs/tw7195.pp svneol=native#text/plain
 tests/webtbs/tw7227.pp svneol=native#text/plain
 tests/webtbs/tw7227.pp svneol=native#text/plain
 tests/webtbs/tw7276.pp svneol=native#text/plain
 tests/webtbs/tw7276.pp svneol=native#text/plain
 tests/webtbs/tw7372.pp svneol=native#text/plain
 tests/webtbs/tw7372.pp svneol=native#text/plain
+tests/webtbs/tw7379.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 7 - 0
compiler/x86/nx86cnv.pas

@@ -121,6 +121,10 @@ implementation
 
 
          { Load left node into flag F_NE/F_E }
          { Load left node into flag F_NE/F_E }
          resflags:=F_NE;
          resflags:=F_NE;
+
+         if (left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF]) then
+           location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
+
          case left.location.loc of
          case left.location.loc of
             LOC_CREFERENCE,
             LOC_CREFERENCE,
             LOC_REFERENCE :
             LOC_REFERENCE :
@@ -222,6 +226,9 @@ implementation
             location_reset(location,LOC_MMREGISTER,def_cgsize(resulttype.def));
             location_reset(location,LOC_MMREGISTER,def_cgsize(resulttype.def));
             location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resulttype.def));
             location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resulttype.def));
 
 
+            if (left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF]) then
+              location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
+
             case torddef(left.resulttype.def).typ of
             case torddef(left.resulttype.def).typ of
               u64bit:
               u64bit:
                 begin
                 begin

+ 5 - 1
compiler/x86/nx86mat.pas

@@ -263,7 +263,11 @@ interface
              LOC_REGISTER,
              LOC_REGISTER,
              LOC_CREGISTER,
              LOC_CREGISTER,
              LOC_REFERENCE,
              LOC_REFERENCE,
-             LOC_CREFERENCE :
+             LOC_CREFERENCE,
+             LOC_SUBSETREG,
+             LOC_CSUBSETREG,
+             LOC_SUBSETREF,
+             LOC_CSUBSETREF :
                begin
                begin
                  location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
                  location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
                  emit_reg_reg(A_TEST,TCGSize2Opsize[opsize],left.location.register,left.location.register);
                  emit_reg_reg(A_TEST,TCGSize2Opsize[opsize],left.location.register,left.location.register);

+ 9 - 0
tests/webtbs/tw7379.pp

@@ -0,0 +1,9 @@
+{$mode macpas}
+
+program test;
+var x: packed array [1..8] of boolean;
+begin x[1]:= false; x[1]:= not x[1];
+if (not x[1]) then
+  halt(1);
+end.
+