Преглед изворни кода

* fix 3 operand instructions with third operand being a constant

git-svn-id: trunk@3502 -
florian пре 19 година
родитељ
комит
ac4bde88ac
3 измењених фајлова са 14 додато и 1 уклоњено
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/x86/aasmcpu.pas
  3. 11 0
      tests/webtbs/tw5036.pp

+ 1 - 0
.gitattributes

@@ -6807,6 +6807,7 @@ tests/webtbs/tw4999.pp svneol=native#text/plain
 tests/webtbs/tw5001.pp svneol=native#text/plain
 tests/webtbs/tw5015.pp svneol=native#text/plain
 tests/webtbs/tw5023.pp svneol=native#text/plain
+tests/webtbs/tw5036.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 2 - 1
compiler/x86/aasmcpu.pas

@@ -1066,7 +1066,8 @@ implementation
                 end;
               top_const :
                 begin
-                  if opsize=S_NO then
+                  { allow 3rd operand being a constant and expect no size for shuf* etc. }
+                  if (opsize=S_NO) and (i<>2) then
                     message(asmr_e_invalid_opcode_and_operand);
                   if (opsize<>S_W) and (longint(val)>=-128) and (val<=127) then
                     ot:=OT_IMM8 or OT_SIGNED

+ 11 - 0
tests/webtbs/tw5036.pp

@@ -0,0 +1,11 @@
+{ Source provided for Free Pascal Bug Report 5036 }
+{ Submitted by "" on  2006-04-21 }
+{ e-mail: [email protected] }
+procedure SSE_NormalizeRadVectorXMM0; assembler;
+{$ASMMODE Intel}
+asm
+ shufps xmm1,xmm1,11010010b // xmm1[zz,xx,yy,dd] <- Error
+end;
+
+begin
+end.