summaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorGadi Haber <gadi.haber@intel.com>2017-12-28 15:00:41 +0000
committerGadi Haber <gadi.haber@intel.com>2017-12-28 15:00:41 +0000
commit5f5f0081ae471668d50eb01afb13ccbf6bb1a6c1 (patch)
tree7b4634da7b8a4a5edc41d9fc1eb28ba64127f94e /test/MC
parentb8b7cba43e86187ed8f4e2866fa186e90db76153 (diff)
[X86][PREFETCH]: Adding full coverage of MC encoding for the PREFETCH isa sets.<NFC>
NFC. Adding MC regressions tests to cover the PREFETCH isa sets for both 32 and 64 bit. 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, AndreiGrischenko Differential Revision: https://reviews.llvm.org/D41161 Change-Id: Icdc8c5fb68c414de7d2cfdb50da1cc6763d9932a git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/X86/PREFETCH-32.s169
-rw-r--r--test/MC/X86/PREFETCH-64.s170
2 files changed, 339 insertions, 0 deletions
diff --git a/test/MC/X86/PREFETCH-32.s b/test/MC/X86/PREFETCH-32.s
new file mode 100644
index 00000000000..caec44ea386
--- /dev/null
+++ b/test/MC/X86/PREFETCH-32.s
@@ -0,0 +1,169 @@
+// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s
+
+// CHECK: prefetch -485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x0d,0x84,0x82,0x10,0xe3,0x0f,0xe3]
+prefetch -485498096(%edx,%eax,4)
+
+// CHECK: prefetch 485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x0d,0x84,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetch 485498096(%edx,%eax,4)
+
+// CHECK: prefetch 485498096(%edx)
+// CHECK: encoding: [0x0f,0x0d,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetch 485498096(%edx)
+
+// CHECK: prefetch 485498096
+// CHECK: encoding: [0x0f,0x0d,0x05,0xf0,0x1c,0xf0,0x1c]
+prefetch 485498096
+
+// CHECK: prefetch 64(%edx,%eax)
+// CHECK: encoding: [0x0f,0x0d,0x44,0x02,0x40]
+prefetch 64(%edx,%eax)
+
+// CHECK: prefetch (%edx)
+// CHECK: encoding: [0x0f,0x0d,0x02]
+prefetch (%edx)
+
+// CHECK: prefetchnta -485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x84,0x82,0x10,0xe3,0x0f,0xe3]
+prefetchnta -485498096(%edx,%eax,4)
+
+// CHECK: prefetchnta 485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x84,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetchnta 485498096(%edx,%eax,4)
+
+// CHECK: prefetchnta 485498096(%edx)
+// CHECK: encoding: [0x0f,0x18,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetchnta 485498096(%edx)
+
+// CHECK: prefetchnta 485498096
+// CHECK: encoding: [0x0f,0x18,0x05,0xf0,0x1c,0xf0,0x1c]
+prefetchnta 485498096
+
+// CHECK: prefetchnta 64(%edx,%eax)
+// CHECK: encoding: [0x0f,0x18,0x44,0x02,0x40]
+prefetchnta 64(%edx,%eax)
+
+// CHECK: prefetchnta (%edx)
+// CHECK: encoding: [0x0f,0x18,0x02]
+prefetchnta (%edx)
+
+// CHECK: prefetcht0 -485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x8c,0x82,0x10,0xe3,0x0f,0xe3]
+prefetcht0 -485498096(%edx,%eax,4)
+
+// CHECK: prefetcht0 485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x8c,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetcht0 485498096(%edx,%eax,4)
+
+// CHECK: prefetcht0 485498096(%edx)
+// CHECK: encoding: [0x0f,0x18,0x8a,0xf0,0x1c,0xf0,0x1c]
+prefetcht0 485498096(%edx)
+
+// CHECK: prefetcht0 485498096
+// CHECK: encoding: [0x0f,0x18,0x0d,0xf0,0x1c,0xf0,0x1c]
+prefetcht0 485498096
+
+// CHECK: prefetcht0 64(%edx,%eax)
+// CHECK: encoding: [0x0f,0x18,0x4c,0x02,0x40]
+prefetcht0 64(%edx,%eax)
+
+// CHECK: prefetcht0 (%edx)
+// CHECK: encoding: [0x0f,0x18,0x0a]
+prefetcht0 (%edx)
+
+// CHECK: prefetcht1 -485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x94,0x82,0x10,0xe3,0x0f,0xe3]
+prefetcht1 -485498096(%edx,%eax,4)
+
+// CHECK: prefetcht1 485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x94,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetcht1 485498096(%edx,%eax,4)
+
+// CHECK: prefetcht1 485498096(%edx)
+// CHECK: encoding: [0x0f,0x18,0x92,0xf0,0x1c,0xf0,0x1c]
+prefetcht1 485498096(%edx)
+
+// CHECK: prefetcht1 485498096
+// CHECK: encoding: [0x0f,0x18,0x15,0xf0,0x1c,0xf0,0x1c]
+prefetcht1 485498096
+
+// CHECK: prefetcht1 64(%edx,%eax)
+// CHECK: encoding: [0x0f,0x18,0x54,0x02,0x40]
+prefetcht1 64(%edx,%eax)
+
+// CHECK: prefetcht1 (%edx)
+// CHECK: encoding: [0x0f,0x18,0x12]
+prefetcht1 (%edx)
+
+// CHECK: prefetcht2 -485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x9c,0x82,0x10,0xe3,0x0f,0xe3]
+prefetcht2 -485498096(%edx,%eax,4)
+
+// CHECK: prefetcht2 485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x18,0x9c,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetcht2 485498096(%edx,%eax,4)
+
+// CHECK: prefetcht2 485498096(%edx)
+// CHECK: encoding: [0x0f,0x18,0x9a,0xf0,0x1c,0xf0,0x1c]
+prefetcht2 485498096(%edx)
+
+// CHECK: prefetcht2 485498096
+// CHECK: encoding: [0x0f,0x18,0x1d,0xf0,0x1c,0xf0,0x1c]
+prefetcht2 485498096
+
+// CHECK: prefetcht2 64(%edx,%eax)
+// CHECK: encoding: [0x0f,0x18,0x5c,0x02,0x40]
+prefetcht2 64(%edx,%eax)
+
+// CHECK: prefetcht2 (%edx)
+// CHECK: encoding: [0x0f,0x18,0x1a]
+prefetcht2 (%edx)
+
+// CHECK: prefetchw -485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x0d,0x8c,0x82,0x10,0xe3,0x0f,0xe3]
+prefetchw -485498096(%edx,%eax,4)
+
+// CHECK: prefetchw 485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x0d,0x8c,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetchw 485498096(%edx,%eax,4)
+
+// CHECK: prefetchw 485498096(%edx)
+// CHECK: encoding: [0x0f,0x0d,0x8a,0xf0,0x1c,0xf0,0x1c]
+prefetchw 485498096(%edx)
+
+// CHECK: prefetchw 485498096
+// CHECK: encoding: [0x0f,0x0d,0x0d,0xf0,0x1c,0xf0,0x1c]
+prefetchw 485498096
+
+// CHECK: prefetchw 64(%edx,%eax)
+// CHECK: encoding: [0x0f,0x0d,0x4c,0x02,0x40]
+prefetchw 64(%edx,%eax)
+
+// CHECK: prefetchw (%edx)
+// CHECK: encoding: [0x0f,0x0d,0x0a]
+prefetchw (%edx)
+
+// CHECK: prefetchwt1 -485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x0d,0x94,0x82,0x10,0xe3,0x0f,0xe3]
+prefetchwt1 -485498096(%edx,%eax,4)
+
+// CHECK: prefetchwt1 485498096(%edx,%eax,4)
+// CHECK: encoding: [0x0f,0x0d,0x94,0x82,0xf0,0x1c,0xf0,0x1c]
+prefetchwt1 485498096(%edx,%eax,4)
+
+// CHECK: prefetchwt1 485498096(%edx)
+// CHECK: encoding: [0x0f,0x0d,0x92,0xf0,0x1c,0xf0,0x1c]
+prefetchwt1 485498096(%edx)
+
+// CHECK: prefetchwt1 485498096
+// CHECK: encoding: [0x0f,0x0d,0x15,0xf0,0x1c,0xf0,0x1c]
+prefetchwt1 485498096
+
+// CHECK: prefetchwt1 64(%edx,%eax)
+// CHECK: encoding: [0x0f,0x0d,0x54,0x02,0x40
+prefetchwt1 64(%edx,%eax)
+
+// CHECK: prefetchwt1 (%edx)
+// CHECK: encoding: [0x0f,0x0d,0x12]
+prefetchwt1 (%edx)
diff --git a/test/MC/X86/PREFETCH-64.s b/test/MC/X86/PREFETCH-64.s
new file mode 100644
index 00000000000..0c4a126a2a2
--- /dev/null
+++ b/test/MC/X86/PREFETCH-64.s
@@ -0,0 +1,170 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s
+
+// CHECK: prefetch 485498096
+// CHECK: encoding: [0x0f,0x0d,0x04,0x25,0xf0,0x1c,0xf0,0x1c]
+prefetch 485498096
+
+// CHECK: prefetch 64(%rdx)
+// CHECK: encoding: [0x0f,0x0d,0x42,0x40]
+prefetch 64(%rdx)
+
+// CHECK: prefetch 64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x0d,0x44,0x82,0x40]
+prefetch 64(%rdx,%rax,4)
+
+// CHECK: prefetch -64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x0d,0x44,0x82,0xc0]
+prefetch -64(%rdx,%rax,4)
+
+// CHECK: prefetch 64(%rdx,%rax)
+// CHECK: encoding: [0x0f,0x0d,0x44,0x02,0x40]
+prefetch 64(%rdx,%rax)
+
+// CHECK: prefetchnta 485498096
+// CHECK: encoding: [0x0f,0x18,0x04,0x25,0xf0,0x1c,0xf0,0x1c]
+prefetchnta 485498096
+
+// CHECK: prefetchnta 64(%rdx)
+// CHECK: encoding: [0x0f,0x18,0x42,0x40]
+prefetchnta 64(%rdx)
+
+// CHECK: prefetchnta 64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x44,0x82,0x40]
+prefetchnta 64(%rdx,%rax,4)
+
+// CHECK: prefetchnta -64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x44,0x82,0xc0]
+prefetchnta -64(%rdx,%rax,4)
+
+// CHECK: prefetchnta 64(%rdx,%rax)
+// CHECK: encoding: [0x0f,0x18,0x44,0x02,0x40]
+prefetchnta 64(%rdx,%rax)
+
+// CHECK: prefetchnta (%rdx)
+// CHECK: encoding: [0x0f,0x18,0x02]
+prefetchnta (%rdx)
+
+// CHECK: prefetch (%rdx)
+// CHECK: encoding: [0x0f,0x0d,0x02]
+prefetch (%rdx)
+
+// CHECK: prefetcht0 485498096
+// CHECK: encoding: [0x0f,0x18,0x0c,0x25,0xf0,0x1c,0xf0,0x1c]
+prefetcht0 485498096
+
+// CHECK: prefetcht0 64(%rdx)
+// CHECK: encoding: [0x0f,0x18,0x4a,0x40]
+prefetcht0 64(%rdx)
+
+// CHECK: prefetcht0 64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x4c,0x82,0x40]
+prefetcht0 64(%rdx,%rax,4)
+
+// CHECK: prefetcht0 -64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x4c,0x82,0xc0]
+prefetcht0 -64(%rdx,%rax,4)
+
+// CHECK: prefetcht0 64(%rdx,%rax)
+// CHECK: encoding: [0x0f,0x18,0x4c,0x02,0x40]
+prefetcht0 64(%rdx,%rax)
+
+// CHECK: prefetcht0 (%rdx)
+// CHECK: encoding: [0x0f,0x18,0x0a]
+prefetcht0 (%rdx)
+
+// CHECK: prefetcht1 485498096
+// CHECK: encoding: [0x0f,0x18,0x14,0x25,0xf0,0x1c,0xf0,0x1c]
+prefetcht1 485498096
+
+// CHECK: prefetcht1 64(%rdx)
+// CHECK: encoding: [0x0f,0x18,0x52,0x40]
+prefetcht1 64(%rdx)
+
+// CHECK: prefetcht1 64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x54,0x82,0x40]
+prefetcht1 64(%rdx,%rax,4)
+
+// CHECK: prefetcht1 -64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x54,0x82,0xc0]
+prefetcht1 -64(%rdx,%rax,4)
+
+// CHECK: prefetcht1 64(%rdx,%rax)
+// CHECK: encoding: [0x0f,0x18,0x54,0x02,0x40]
+prefetcht1 64(%rdx,%rax)
+
+// CHECK: prefetcht1 (%rdx)
+// CHECK: encoding: [0x0f,0x18,0x12]
+prefetcht1 (%rdx)
+
+// CHECK: prefetcht2 485498096
+// CHECK: encoding: [0x0f,0x18,0x1c,0x25,0xf0,0x1c,0xf0,0x1c]
+prefetcht2 485498096
+
+// CHECK: prefetcht2 64(%rdx)
+// CHECK: encoding: [0x0f,0x18,0x5a,0x40]
+prefetcht2 64(%rdx)
+
+// CHECK: prefetcht2 64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x5c,0x82,0x40]
+prefetcht2 64(%rdx,%rax,4)
+
+// CHECK: prefetcht2 -64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x18,0x5c,0x82,0xc0]
+prefetcht2 -64(%rdx,%rax,4)
+
+// CHECK: prefetcht2 64(%rdx,%rax)
+// CHECK: encoding: [0x0f,0x18,0x5c,0x02,0x40]
+prefetcht2 64(%rdx,%rax)
+
+// CHECK: prefetcht2 (%rdx)
+// CHECK: encoding: [0x0f,0x18,0x1a]
+prefetcht2 (%rdx)
+
+// CHECK: prefetchw 485498096
+// CHECK: encoding: [0x0f,0x0d,0x0c,0x25,0xf0,0x1c,0xf0,0x1c]
+prefetchw 485498096
+
+// CHECK: prefetchw 64(%rdx)
+// CHECK: encoding: [0x0f,0x0d,0x4a,0x40]
+prefetchw 64(%rdx)
+
+// CHECK: prefetchw 64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x0d,0x4c,0x82,0x40]
+prefetchw 64(%rdx,%rax,4)
+
+// CHECK: prefetchw -64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x0d,0x4c,0x82,0xc0]
+prefetchw -64(%rdx,%rax,4)
+
+// CHECK: prefetchw 64(%rdx,%rax)
+// CHECK: encoding: [0x0f,0x0d,0x4c,0x02,0x40]
+prefetchw 64(%rdx,%rax)
+
+// CHECK: prefetchw (%rdx)
+// CHECK: encoding: [0x0f,0x0d,0x0a]
+prefetchw (%rdx)
+
+// CHECK: prefetchwt1 485498096
+// CHECK: encoding: [0x0f,0x0d,0x14,0x25,0xf0,0x1c,0xf0,0x1c]
+prefetchwt1 485498096
+
+// CHECK: prefetchwt1 64(%rdx)
+// CHECK: encoding: [0x0f,0x0d,0x52,0x40]
+prefetchwt1 64(%rdx)
+
+// CHECK: prefetchwt1 64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x0d,0x54,0x82,0x40]
+prefetchwt1 64(%rdx,%rax,4)
+
+// CHECK: prefetchwt1 -64(%rdx,%rax,4)
+// CHECK: encoding: [0x0f,0x0d,0x54,0x82,0xc0]
+prefetchwt1 -64(%rdx,%rax,4)
+
+// CHECK: prefetchwt1 64(%rdx,%rax)
+// CHECK: encoding: [0x0f,0x0d,0x54,0x02,0x40]
+prefetchwt1 64(%rdx,%rax)
+
+// CHECK: prefetchwt1 (%rdx)
+// CHECK: encoding: [0x0f,0x0d,0x12]
+prefetchwt1 (%rdx)
+