Browse Source

* cpubase.cgsize2subreg should handle all valid sizes, resolves #38557

git-svn-id: trunk@49087 -
florian 4 years ago
parent
commit
47557e0ad2
3 changed files with 40 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 2 0
      compiler/x86/cpubase.pas
  3. 37 0
      tests/webtbs/tw38557.pp

+ 1 - 0
.gitattributes

@@ -18761,6 +18761,7 @@ tests/webtbs/tw38549a.pp svneol=native#text/plain
 tests/webtbs/tw38549b.pp svneol=native#text/plain
 tests/webtbs/tw38549c.pp svneol=native#text/plain
 tests/webtbs/tw38549d.pp svneol=native#text/plain
+tests/webtbs/tw38557.pp svneol=native#text/pascal
 tests/webtbs/tw3863.pp svneol=native#text/plain
 tests/webtbs/tw38636.pp svneol=native#text/plain
 tests/webtbs/tw3864.pp svneol=native#text/plain

+ 2 - 0
compiler/x86/cpubase.pas

@@ -473,6 +473,8 @@ implementation
             cgsize2subreg:=R_SUBMMY;
           OS_M512:
             cgsize2subreg:=R_SUBMMZ;
+          OS_S128,
+          OS_128,
           OS_NO:
             { error message should have been thrown already before, so avoid only
               an internal error }

+ 37 - 0
tests/webtbs/tw38557.pp

@@ -0,0 +1,37 @@
+{ %cpu=x86_64 }
+{ %fail }
+{$asmmode intel}
+type
+     gfxImage = record
+          data: pointer;
+          width, height: dWord;
+     end;
+
+function putPixel(where:gfxImage;x,y,col:dword):dword; assembler; nostackframe;
+//begin
+asm
+     xor eax,eax
+     mov eax,x
+     mov eax,y
+     mov eax,col
+     mov rax,rdi
+     mov rax,rsi
+     rol rax,32
+
+     mov rax, where
+     //mov rax, where.data
+     //mov rax, where
+end;
+//end;
+
+var a : gfxImage;
+    z : dword;
+begin
+     a.data:= pointer(5);
+     a.width := 8;
+     a.height := 7;
+     z:= putPixel (a, 1, 2, 3);
+     writeln;
+     writeln(' ',z,' ');
+     writeln;
+end.