[PATCH] D37292: 'into' instruction should not be decoded as valid in 64-bit mode

Andrew V. Tischenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 03:17:26 PDT 2017


avt77 updated this revision to Diff 115816.
avt77 added a comment.

I re-implemented the fix accordingly to Craig suggest.


https://reviews.llvm.org/D37292

Files:
  lib/Target/X86/X86InstrSystem.td
  test/MC/Disassembler/X86/x86-64-err.txt


Index: test/MC/Disassembler/X86/x86-64-err.txt
===================================================================
--- test/MC/Disassembler/X86/x86-64-err.txt
+++ test/MC/Disassembler/X86/x86-64-err.txt
@@ -0,0 +1,6 @@
+# RUN: llvm-mc --disassemble %s -triple=x86_64 2>&1 | FileCheck --check-prefix=64 %s
+# RUN: llvm-mc --disassemble %s -triple=i386 | FileCheck --check-prefix=32 %s
+
+# 64: warning: invalid instruction encoding
+# 32: into
+0xce
Index: lib/Target/X86/X86InstrSystem.td
===================================================================
--- lib/Target/X86/X86InstrSystem.td
+++ lib/Target/X86/X86InstrSystem.td
@@ -33,7 +33,7 @@
 
 // Interrupt and SysCall Instructions.
 let Uses = [EFLAGS] in
-  def INTO : I<0xce, RawFrm, (outs), (ins), "into", []>;
+  def INTO : I<0xce, RawFrm, (outs), (ins), "into", []>, Requires<[Not64BitMode]>;
 def INT3 : I<0xcc, RawFrm, (outs), (ins), "int3",
               [(int_x86_int (i8 3))], IIC_INT3>;
 } // SchedRW


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37292.115816.patch
Type: text/x-patch
Size: 972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170919/1e7496d4/attachment.bin>


More information about the llvm-commits mailing list