forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86][MC] Support instructions of MSR_IMM (llvm#113524)
- Loading branch information
1 parent
99b2fea
commit d3f70db
Showing
8 changed files
with
107 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT | ||
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL | ||
|
||
# ATT: rdmsr $123, %r9 | ||
# INTEL: rdmsr r9, 123 | ||
0x62,0xd7,0x7f,0x08,0xf6,0xc1,0x7b,0x00,0x00,0x00 | ||
|
||
# ATT: rdmsr $123, %r19 | ||
# INTEL: rdmsr r19, 123 | ||
0x62,0xff,0x7f,0x08,0xf6,0xc3,0x7b,0x00,0x00,0x00 | ||
|
||
# ATT: wrmsrns %r9, $123 | ||
# INTEL: wrmsrns 123, r9 | ||
0x62,0xd7,0x7e,0x08,0xf6,0xc1,0x7b,0x00,0x00,0x00 | ||
|
||
# ATT: wrmsrns %r19, $123 | ||
# INTEL: wrmsrns 123, r19 | ||
0x62,0xff,0x7e,0x08,0xf6,0xc3,0x7b,0x00,0x00,0x00 |
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,10 @@ | ||
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT | ||
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL | ||
|
||
# ATT: rdmsr $123, %r9 | ||
# INTEL: rdmsr r9, 123 | ||
0xc4,0xc7,0x7b,0xf6,0xc1,0x7b,0x00,0x00,0x00 | ||
|
||
# ATT: wrmsrns %r9, $123 | ||
# INTEL: wrmsrns 123, r9 | ||
0xc4,0xc7,0x7a,0xf6,0xc1,0x7b,0x00,0x00,0x00 |
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: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s | ||
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR | ||
|
||
# ERROR-COUNT-4: error: | ||
# ERROR-NOT: error: | ||
|
||
## rdmsr | ||
|
||
// CHECK: {evex} rdmsr $123, %r9 | ||
// CHECK: encoding: [0x62,0xd7,0x7f,0x08,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
{evex} rdmsr $123, %r9 | ||
|
||
// CHECK: rdmsr $123, %r19 | ||
// CHECK: encoding: [0x62,0xff,0x7f,0x08,0xf6,0xc3,0x7b,0x00,0x00,0x00] | ||
rdmsr $123, %r19 | ||
|
||
## wrmsrns | ||
|
||
# CHECK: {evex} wrmsrns %r9, $123 | ||
# CHECK: encoding: [0x62,0xd7,0x7e,0x08,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
{evex} wrmsrns %r9, $123 | ||
|
||
# CHECK: wrmsrns %r19, $123 | ||
# CHECK: encoding: [0x62,0xff,0x7e,0x08,0xf6,0xc3,0x7b,0x00,0x00,0x00] | ||
wrmsrns %r19, $123 |
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,21 @@ | ||
# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s | ||
|
||
## urdmsr | ||
|
||
# CHECK: {evex} rdmsr r9, 123 | ||
# CHECK: encoding: [0x62,0xd7,0x7f,0x08,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
{evex} rdmsr r9, 123 | ||
|
||
# CHECK: rdmsr r19, 123 | ||
# CHECK: encoding: [0x62,0xff,0x7f,0x08,0xf6,0xc3,0x7b,0x00,0x00,0x00] | ||
rdmsr r19, 123 | ||
|
||
## uwrmsr | ||
|
||
# CHECK: {evex} wrmsrns 123, r9 | ||
# CHECK: encoding: [0x62,0xd7,0x7e,0x08,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
{evex} wrmsrns 123, r9 | ||
|
||
# CHECK: wrmsrns 123, r19 | ||
# CHECK: encoding: [0x62,0xff,0x7e,0x08,0xf6,0xc3,0x7b,0x00,0x00,0x00] | ||
wrmsrns 123, r19 |
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,14 @@ | ||
// RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s | ||
// RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR | ||
|
||
// ERROR-COUNT-2: error: | ||
// ERROR-NOT: error: | ||
|
||
// CHECK: rdmsr $123, %r9 | ||
// CHECK: encoding: [0xc4,0xc7,0x7b,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
rdmsr $123, %r9 | ||
|
||
// CHECK: wrmsrns %r9, $123 | ||
// CHECK: encoding: [0xc4,0xc7,0x7a,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
wrmsrns %r9, $123 | ||
|
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,10 @@ | ||
// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s | ||
|
||
// CHECK: rdmsr r9, 123 | ||
// CHECK: encoding: [0xc4,0xc7,0x7b,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
rdmsr r9, 123 | ||
|
||
// CHECK: wrmsrns 123, r9 | ||
// CHECK: encoding: [0xc4,0xc7,0x7a,0xf6,0xc1,0x7b,0x00,0x00,0x00] | ||
wrmsrns 123, r9 | ||
|