浏览代码

+ add 'jmp rm16' and 'call rm16' before the rm32 versions on i8086, so the
16-bit version is picked up by default for opsize=S_NO. Previously the 386
version was picked on i8086, but the generated code was correct, because we
don't yet generate a 0x66 prefix for "\325", which leads to many 32-bit
instructions not being assembled correctly with the internal asm obj writer on
the i8086

git-svn-id: trunk@32887 -

nickysn 9 年之前
父节点
当前提交
e877bae4fc
共有 3 个文件被更改,包括 21 次插入1 次删除
  1. 1 1
      compiler/i8086/i8086nop.inc
  2. 14 0
      compiler/i8086/i8086tab.inc
  3. 6 0
      compiler/x86/x86ins.dat

+ 1 - 1
compiler/i8086/i8086nop.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-1973;
+1975;

+ 14 - 0
compiler/i8086/i8086tab.inc

@@ -378,6 +378,13 @@
     code    : #208#2#15#186#133#21;
     flags   : if_386 or if_sb
   ),
+  (
+    opcode  : A_CALL;
+    ops     : 1;
+    optypes : (ot_rm_gpr or ot_bits16,ot_none,ot_none,ot_none);
+    code    : #212#1#255#130;
+    flags   : if_8086 or if_16bitonly
+  ),
   (
     opcode  : A_CALL;
     ops     : 1;
@@ -2541,6 +2548,13 @@
     code    : #208#1#233#52;
     flags   : if_8086 or if_pass2
   ),
+  (
+    opcode  : A_JMP;
+    ops     : 1;
+    optypes : (ot_rm_gpr or ot_bits16,ot_none,ot_none,ot_none);
+    code    : #212#1#255#132;
+    flags   : if_8086 or if_16bitonly
+  ),
   (
     opcode  : A_JMP;
     ops     : 1;

+ 6 - 0
compiler/x86/x86ins.dat

@@ -128,6 +128,9 @@ rm16|32|64,imm        \320\2\x0F\xBA\205\25           386,SB
 ; Compiler emits CALL/JMP with opsize=S_NO which matches any size,
 ; and will match the first entry in sequence.
 ; Therefore rm16 must be placed after rm32/rm64
+; However, on i8086, rm16 must be first, so it's repeated in the beginning
+; with a 16BITONLY flag
+rm16                  \324\1\xFF\202                  8086,16BITONLY
 rm32                  \325\1\xFF\202                  386,NOX86_64
 rm64                  \335\1\xFF\202                  X86_64
 rm16                  \324\1\xFF\202                  8086
@@ -887,8 +890,11 @@ imm                   \1\xE3\50                       X86_64
 [JMP,jmpX]
 (Ch_ROp1, Ch_None, Ch_None)
 ; rm16 should be after rm32/rm64, see comments for CALL.
+; However, on i8086, rm16 must be first, so it's repeated in the beginning
+; with a 16BITONLY flag
 imm8                  \1\xEB\50                       8086,PASS2
 imm16|32              \320\1\xE9\64                   8086,PASS2
+rm16                  \324\1\xFF\204                  8086,16BITONLY
 rm32                  \325\1\xFF\204                  386,NOX86_64
 rm64                  \335\1\xFF\204                  X86_64
 rm16                  \324\1\xFF\204                  8086