From 309b06cb5c6fd779c819a1e4c28b323b46f5e76b Mon Sep 17 00:00:00 2001 From: Gadi Haber Date: Wed, 27 Dec 2017 08:35:57 +0000 Subject: [PATCH] [X86][RD]: Adding full coverage of MC encoding for RD isa sets. NFC. Adding MC regressions tests to cover RDPMC, RDRAND, RDRAND, RDSEED, RDTSCP, DWRFSGS isa sets. This patch is part of a larger task to cover MC encoding of all X86 isa sets started in revision: https://reviews.llvm.org/D39952 Reviewers: zvi, craig.topper, RKSimon, AndreiGrischenk Differential Revision: https://reviews.llvm.org/D41328 Change-Id: Ie97b397546e6b1ed180c6abd7b41fccb136d2b82 llvm-svn: 321476 --- llvm/test/MC/X86/RDPMC-32.s | 6 ++++++ llvm/test/MC/X86/RDPMC-64.s | 6 ++++++ llvm/test/MC/X86/RDRAND-32.s | 6 ++++++ llvm/test/MC/X86/RDRAND-64.s | 14 ++++++++++++++ llvm/test/MC/X86/RDSEED-32.s | 6 ++++++ llvm/test/MC/X86/RDSEED-64.s | 14 ++++++++++++++ llvm/test/MC/X86/RDTSCP-32.s | 6 ++++++ llvm/test/MC/X86/RDTSCP-64.s | 6 ++++++ llvm/test/MC/X86/RDWRFSGS-64.s | 34 ++++++++++++++++++++++++++++++++++ 9 files changed, 98 insertions(+) create mode 100644 llvm/test/MC/X86/RDPMC-32.s create mode 100644 llvm/test/MC/X86/RDPMC-64.s create mode 100644 llvm/test/MC/X86/RDRAND-32.s create mode 100644 llvm/test/MC/X86/RDRAND-64.s create mode 100644 llvm/test/MC/X86/RDSEED-32.s create mode 100644 llvm/test/MC/X86/RDSEED-64.s create mode 100644 llvm/test/MC/X86/RDTSCP-32.s create mode 100644 llvm/test/MC/X86/RDTSCP-64.s create mode 100644 llvm/test/MC/X86/RDWRFSGS-64.s diff --git a/llvm/test/MC/X86/RDPMC-32.s b/llvm/test/MC/X86/RDPMC-32.s new file mode 100644 index 000000000000..5168af3a62c1 --- /dev/null +++ b/llvm/test/MC/X86/RDPMC-32.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdpmc +// CHECK: encoding: [0x0f,0x33] +rdpmc + diff --git a/llvm/test/MC/X86/RDPMC-64.s b/llvm/test/MC/X86/RDPMC-64.s new file mode 100644 index 000000000000..56fa3d9fa828 --- /dev/null +++ b/llvm/test/MC/X86/RDPMC-64.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdpmc +// CHECK: encoding: [0x0f,0x33] +rdpmc + diff --git a/llvm/test/MC/X86/RDRAND-32.s b/llvm/test/MC/X86/RDRAND-32.s new file mode 100644 index 000000000000..5461ca74eabb --- /dev/null +++ b/llvm/test/MC/X86/RDRAND-32.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdrandl %eax +// CHECK: encoding: [0x0f,0xc7,0xf0] +rdrandl %eax + diff --git a/llvm/test/MC/X86/RDRAND-64.s b/llvm/test/MC/X86/RDRAND-64.s new file mode 100644 index 000000000000..3482c0ecd5c3 --- /dev/null +++ b/llvm/test/MC/X86/RDRAND-64.s @@ -0,0 +1,14 @@ +// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdrandl %r13d +// CHECK: encoding: [0x41,0x0f,0xc7,0xf5] +rdrandl %r13d + +// CHECK: rdrandq %r13 +// CHECK: encoding: [0x49,0x0f,0xc7,0xf5] +rdrandq %r13 + +// CHECK: rdrandw %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xc7,0xf5] +rdrandw %r13w + diff --git a/llvm/test/MC/X86/RDSEED-32.s b/llvm/test/MC/X86/RDSEED-32.s new file mode 100644 index 000000000000..87be0d502a66 --- /dev/null +++ b/llvm/test/MC/X86/RDSEED-32.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdseedl %eax +// CHECK: encoding: [0x0f,0xc7,0xf8] +rdseedl %eax + diff --git a/llvm/test/MC/X86/RDSEED-64.s b/llvm/test/MC/X86/RDSEED-64.s new file mode 100644 index 000000000000..0d710ceaa5bb --- /dev/null +++ b/llvm/test/MC/X86/RDSEED-64.s @@ -0,0 +1,14 @@ +// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdseedl %r13d +// CHECK: encoding: [0x41,0x0f,0xc7,0xfd] +rdseedl %r13d + +// CHECK: rdseedq %r13 +// CHECK: encoding: [0x49,0x0f,0xc7,0xfd] +rdseedq %r13 + +// CHECK: rdseedw %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xc7,0xfd] +rdseedw %r13w + diff --git a/llvm/test/MC/X86/RDTSCP-32.s b/llvm/test/MC/X86/RDTSCP-32.s new file mode 100644 index 000000000000..48232edf7d52 --- /dev/null +++ b/llvm/test/MC/X86/RDTSCP-32.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdtscp +// CHECK: encoding: [0x0f,0x01,0xf9] +rdtscp + diff --git a/llvm/test/MC/X86/RDTSCP-64.s b/llvm/test/MC/X86/RDTSCP-64.s new file mode 100644 index 000000000000..045fd49a2738 --- /dev/null +++ b/llvm/test/MC/X86/RDTSCP-64.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdtscp +// CHECK: encoding: [0x0f,0x01,0xf9] +rdtscp + diff --git a/llvm/test/MC/X86/RDWRFSGS-64.s b/llvm/test/MC/X86/RDWRFSGS-64.s new file mode 100644 index 000000000000..47314caf867d --- /dev/null +++ b/llvm/test/MC/X86/RDWRFSGS-64.s @@ -0,0 +1,34 @@ +// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s + +// CHECK: rdfsbasel %r13d +// CHECK: encoding: [0xf3,0x41,0x0f,0xae,0xc5] +rdfsbasel %r13d + +// CHECK: rdfsbaseq %r13 +// CHECK: encoding: [0xf3,0x49,0x0f,0xae,0xc5] +rdfsbaseq %r13 + +// CHECK: rdgsbasel %r13d +// CHECK: encoding: [0xf3,0x41,0x0f,0xae,0xcd] +rdgsbasel %r13d + +// CHECK: rdgsbaseq %r13 +// CHECK: encoding: [0xf3,0x49,0x0f,0xae,0xcd] +rdgsbaseq %r13 + +// CHECK: wrfsbasel %r13d +// CHECK: encoding: [0xf3,0x41,0x0f,0xae,0xd5] +wrfsbasel %r13d + +// CHECK: wrfsbaseq %r13 +// CHECK: encoding: [0xf3,0x49,0x0f,0xae,0xd5] +wrfsbaseq %r13 + +// CHECK: wrgsbasel %r13d +// CHECK: encoding: [0xf3,0x41,0x0f,0xae,0xdd] +wrgsbasel %r13d + +// CHECK: wrgsbaseq %r13 +// CHECK: encoding: [0xf3,0x49,0x0f,0xae,0xdd] +wrgsbaseq %r13 +