浏览代码

* Put under {$ifndef x86_64} more cases of instructions that do not exist in 64-bit mode.

git-svn-id: trunk@27933 -
sergei 11 年之前
父节点
当前提交
e7cd5319f0
共有 4 个文件被更改,包括 16 次插入4 次删除
  1. 5 1
      compiler/x86/aasmcpu.pas
  2. 5 2
      compiler/x86/agx86int.pas
  3. 4 1
      compiler/x86/rax86int.pas
  4. 2 0
      compiler/x86/rgx86.pas

+ 5 - 1
compiler/x86/aasmcpu.pas

@@ -1218,7 +1218,11 @@ implementation
                   begin
                   begin
                     { allow 2nd, 3rd or 4th operand being a constant and expect no size for shuf* etc. }
                     { allow 2nd, 3rd or 4th operand being a constant and expect no size for shuf* etc. }
                     { further, allow AAD and AAM with imm. operand }
                     { further, allow AAD and AAM with imm. operand }
-                    if (opsize=S_NO) and not((i in [1,2,3]) or ((i=0) and (opcode in [A_AAD,A_AAM]))) then
+                    if (opsize=S_NO) and not((i in [1,2,3]) 
+{$ifndef x86_64}
+                      or ((i=0) and (opcode in [A_AAD,A_AAM]))
+{$endif x86_64}
+                      ) then
                       message(asmr_e_invalid_opcode_and_operand);
                       message(asmr_e_invalid_opcode_and_operand);
                     if (opsize<>S_W) and (aint(val)>=-128) and (val<=127) then
                     if (opsize<>S_W) and (aint(val)>=-128) and (val<=127) then
                       ot:=OT_IMM8 or OT_SIGNED
                       ot:=OT_IMM8 or OT_SIGNED

+ 5 - 2
compiler/x86/agx86int.pas

@@ -311,8 +311,11 @@ implementation
               if o.ref^.refaddr in [addr_no,addr_pic,addr_pic_no_got] then
               if o.ref^.refaddr in [addr_no,addr_pic,addr_pic_no_got] then
                 begin
                 begin
                   if ((opcode <> A_LGS) and (opcode <> A_LSS) and
                   if ((opcode <> A_LGS) and (opcode <> A_LSS) and
-                      (opcode <> A_LFS) and (opcode <> A_LDS) and
-                      (opcode <> A_LES)) then
+                      (opcode <> A_LFS)
+{$ifndef x86_64}
+                      and (opcode <> A_LDS) and (opcode <> A_LES)
+{$endif x86_64}
+                      ) then
                    Begin
                    Begin
                      case s of
                      case s of
                       S_B : AsmWrite('byte ptr ');
                       S_B : AsmWrite('byte ptr ');

+ 4 - 1
compiler/x86/rax86int.pas

@@ -2044,10 +2044,13 @@ Unit Rax86int;
           instr.opcode:=A_POPFW
           instr.opcode:=A_POPFW
         else if (instr.opcode=A_PUSHF) then
         else if (instr.opcode=A_PUSHF) then
           instr.opcode:=A_PUSHFW
           instr.opcode:=A_PUSHFW
+{$ifndef x86_64}
         else if (instr.opcode=A_PUSHA) then
         else if (instr.opcode=A_PUSHA) then
           instr.opcode:=A_PUSHAW
           instr.opcode:=A_PUSHAW
         else if (instr.opcode=A_POPA) then
         else if (instr.opcode=A_POPA) then
-          instr.opcode:=A_POPAW;
+          instr.opcode:=A_POPAW
+{$endif x86_64}
+        ;
         { We are reading operands, so opcode will be an AS_ID }
         { We are reading operands, so opcode will be an AS_ID }
         operandnum:=1;
         operandnum:=1;
         is_far_const:=false;
         is_far_const:=false;

+ 2 - 0
compiler/x86/rgx86.pas

@@ -244,7 +244,9 @@ implementation
                               A_CMOVcc,
                               A_CMOVcc,
                               A_MOVZX,
                               A_MOVZX,
                               A_MOVSX,
                               A_MOVSX,
+{$ifdef x86_64}
                               A_MOVSXD,
                               A_MOVSXD,
+{$endif x86_64}
                               A_MULSS,
                               A_MULSS,
                               A_MULSD,
                               A_MULSD,
                               A_SUBSS,
                               A_SUBSS,