Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] Fix for bugzilla 31576 - add support for "data32" instruction p…
…refix This patch fixes bugzilla 31576 (https://llvm.org/bugs/show_bug.cgi?id=31576). "data32" instruction prefix was not defined in the llvm. An exception had to be added to the X86 tablegen and AsmPrinter because both "data16" and "data32" are encoded to 0x66 (but in different modes). Differential Revision: https://reviews.llvm.org/D28468 llvm-svn: 292352
- Loading branch information
Marina Yatsina
committed
Jan 18, 2017
1 parent
1301915
commit 197db00
Showing
11 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: not llvm-mc -triple x86_64-unknown-unknown --show-encoding %s 2> %t.err | FileCheck --check-prefix=64 %s | ||
// RUN: FileCheck --check-prefix=ERR64 < %t.err %s | ||
// RUN: not llvm-mc -triple i386-unknown-unknown --show-encoding %s 2> %t.err | FileCheck --check-prefix=32 %s | ||
// RUN: FileCheck --check-prefix=ERR32 < %t.err %s | ||
// RUN: not llvm-mc -triple i386-unknown-unknown-code16 --show-encoding %s 2> %t.err | FileCheck --check-prefix=16 %s | ||
// RUN: FileCheck --check-prefix=ERR16 < %t.err %s | ||
|
||
// ERR64: error: instruction requires: 16-bit mode | ||
// ERR32: error: instruction requires: 16-bit mode | ||
// 16: data32 | ||
// 16: encoding: [0x66] | ||
// 16: lgdtw 0 | ||
// 16: encoding: [0x0f,0x01,0x16,0x00,0x00] | ||
data32 lgdt 0 | ||
|
||
// 64: data16 | ||
// 64: encoding: [0x66] | ||
// 64: lgdtq 0 | ||
// 64: encoding: [0x0f,0x01,0x14,0x25,0x00,0x00,0x00,0x00] | ||
// 32: data16 | ||
// 32: encoding: [0x66] | ||
// 32: lgdtl 0 | ||
// 32: encoding: [0x0f,0x01,0x15,0x00,0x00,0x00,0x00] | ||
// ERR16: error: instruction requires: Not 16-bit mode | ||
data16 lgdt 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# RUN: llvm-mc -triple i386-unknown-unknown-code16 -filetype=obj %s -o - | llvm-objdump -triple i386-unknown-unknown-code16 -d - | FileCheck %s | ||
|
||
# CHECK: 66 0f 01 16 00 00 | ||
# CHECK: lgdtl 0 | ||
data32 lgdt 0 | ||
|
||
# CHECK: 66 | ||
# CHECK: data32 | ||
data32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# RUN: llvm-mc -triple=i386-unknown-unknown -filetype=obj %s -o - | llvm-objdump -triple=i386-unknown-unknown -d - | FileCheck %s | ||
|
||
# CHECK: 66 0f 01 15 00 00 00 00 | ||
# CHECK: lgdtw 0 | ||
data16 lgdt 0 | ||
|
||
# CHECK: 66 | ||
# CHECK: data16 | ||
data16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# RUN: llvm-mc -triple=x86_64-unknown-unknown -filetype=obj %s -o - | llvm-objdump -triple=x86_64-unknown-unknown -d - | FileCheck %s | ||
|
||
# CHECK: 66 0f 01 14 25 00 00 00 00 | ||
# CHECK: lgdtq 0 | ||
data16 lgdt 0 | ||
|
||
# CHECK: 66 | ||
# CHECK: data16 | ||
data16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters