浏览代码

* allow second operand being am imm in intel assembler, fixed #7719

git-svn-id: trunk@5823 -
florian 18 年之前
父节点
当前提交
c759b114bf
共有 3 个文件被更改,包括 16 次插入2 次删除
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/x86/aasmcpu.pas
  3. 13 0
      tests/webtbs/tw7719.pp

+ 1 - 0
.gitattributes

@@ -7935,6 +7935,7 @@ tests/webtbs/tw7568.pp svneol=native#text/plain
 tests/webtbs/tw7637.pp svneol=native#text/plain
 tests/webtbs/tw7643.pp svneol=native#text/plain
 tests/webtbs/tw7679.pp svneol=native#text/plain
+tests/webtbs/tw7719.pp svneol=native#text/plain
 tests/webtbs/tw7756.pp svneol=native#text/plain
 tests/webtbs/tw7817a.pp svneol=native#text/plain
 tests/webtbs/tw7817b.pp svneol=native#text/plain

+ 2 - 2
compiler/x86/aasmcpu.pas

@@ -985,8 +985,8 @@ implementation
                 end;
               top_const :
                 begin
-                  { allow 3rd operand being a constant and expect no size for shuf* etc. }
-                  if (opsize=S_NO) and (i<>2) then
+                  { allow 2nd or 3rd operand being a constant and expect no size for shuf* etc. }
+                  if (opsize=S_NO) and not(i in [1,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

+ 13 - 0
tests/webtbs/tw7719.pp

@@ -0,0 +1,13 @@
+{ %cpu=i386,x86_64 }
+{$asmmode intel}
+program test;
+
+{$APPTYPE CONSOLE}
+
+begin
+
+asm
+psrldq xmm2,4
+end;
+
+end.