소스 검색

* fixed size of movzx/movsx with 64bit operand in x86-64 Intel asm reader

git-svn-id: trunk@23131 -
Jonas Maebe 12 년 전
부모
커밋
d180d6f241
3개의 변경된 파일38개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      .gitattributes
  2. 8 0
      compiler/x86/rax86.pas
  3. 29 0
      tests/tbs/tb0587.pp

+ 1 - 0
.gitattributes

@@ -9730,6 +9730,7 @@ tests/tbs/tb0583a.pp svneol=native#text/plain
 tests/tbs/tb0584.pp svneol=native#text/pascal
 tests/tbs/tb0585.pp svneol=native#text/pascal
 tests/tbs/tb0586.pp svneol=native#text/pascal
+tests/tbs/tb0587.pp svneol=native#text/plain
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain

+ 8 - 0
compiler/x86/rax86.pas

@@ -789,6 +789,10 @@ begin
                   case tx86operand(operands[2]).opsize of
                     S_L :
                       opsize:=S_WL;
+{$ifdef x86_64}
+                    S_Q :
+                      opsize:=S_WQ;
+{$endif}
                   end;
                 S_B :
                   begin
@@ -797,6 +801,10 @@ begin
                         opsize:=S_BW;
                       S_L :
                         opsize:=S_BL;
+{$ifdef x86_64}
+                      S_Q :
+                        opsize:=S_BQ;
+{$endif}
                     end;
                   end;
               end;

+ 29 - 0
tests/tbs/tb0587.pp

@@ -0,0 +1,29 @@
+{ %cpu=x86_64 }
+{ %opt=-Aas }
+
+{$asmmode intel}
+
+procedure test;
+var
+  i1,i2: int64;
+  b: shortint;
+begin
+  b:=-128;
+  asm
+    movsx rax, b
+    mov  i1,rax
+    movzx rax, b
+    mov  i2,rax
+  end ['rax'];
+  if i1<>-128 then
+    halt(1);
+  if i2<>byte(-128) then
+    halt(2);
+end;
+
+begin
+  test
+end.
+    
+  
+