[llvm] r325561 - [X86][CET]: Adding full coverage of MC encoding for the CET instructions.<NFC>

Gadi Haber via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 00:00:32 PST 2018


Author: gadi.haber
Date: Tue Feb 20 00:00:31 2018
New Revision: 325561

URL: http://llvm.org/viewvc/llvm-project?rev=325561&view=rev
Log:
[X86][CET]: Adding full coverage of MC encoding for the CET instructions.<NFC>

NFC.
Adding MC regressions tests to cover the CET instructions.
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, oren_ben_simhon
Differential Revision: https://reviews.llvm.org/D41329

Change-Id: I9c133d4ba07508ce8fd738a1230edd586e2c2f1b

Added:
    llvm/trunk/test/MC/X86/CET-32.s
    llvm/trunk/test/MC/X86/CET-64.s

Added: llvm/trunk/test/MC/X86/CET-32.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/CET-32.s?rev=325561&view=auto
==============================================================================
--- llvm/trunk/test/MC/X86/CET-32.s (added)
+++ llvm/trunk/test/MC/X86/CET-32.s Tue Feb 20 00:00:31 2018
@@ -0,0 +1,122 @@
+// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s
+
+// CHECK: clrssbsy -485498096(%edx,%eax,4) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0xb4,0x82,0x10,0xe3,0x0f,0xe3]         
+clrssbsy -485498096(%edx,%eax,4) 
+
+// CHECK: clrssbsy 485498096(%edx,%eax,4) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0xb4,0x82,0xf0,0x1c,0xf0,0x1c]         
+clrssbsy 485498096(%edx,%eax,4) 
+
+// CHECK: clrssbsy 485498096(%edx) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0xb2,0xf0,0x1c,0xf0,0x1c]         
+clrssbsy 485498096(%edx) 
+
+// CHECK: clrssbsy 485498096 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x35,0xf0,0x1c,0xf0,0x1c]         
+clrssbsy 485498096 
+
+// CHECK: clrssbsy 64(%edx,%eax) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x74,0x02,0x40]         
+clrssbsy 64(%edx,%eax) 
+
+// CHECK: clrssbsy (%edx) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x32]         
+clrssbsy (%edx) 
+
+// CHECK: endbr64
+// CHECK: # encoding: [0xf3,0x0f,0x1e,0xfa]
+endbr64
+
+// CHECK: endbr32
+// CHECK: # encoding: [0xf3,0x0f,0x1e,0xfb]
+endbr32
+
+// CHECK: incsspd %eax
+// CHECK: # encoding: [0xf3,0x0f,0xae,0xe8]
+incsspd %eax
+
+// CHECK: rdsspd %eax 
+// CHECK: encoding: [0xf3,0x0f,0x1e,0xc8]         
+rdsspd %eax 
+
+// CHECK: rstorssp -485498096(%edx,%eax,4) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0xac,0x82,0x10,0xe3,0x0f,0xe3]         
+rstorssp -485498096(%edx,%eax,4) 
+
+// CHECK: rstorssp 485498096(%edx,%eax,4) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0xac,0x82,0xf0,0x1c,0xf0,0x1c]         
+rstorssp 485498096(%edx,%eax,4) 
+
+// CHECK: rstorssp 485498096(%edx) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0xaa,0xf0,0x1c,0xf0,0x1c]         
+rstorssp 485498096(%edx) 
+
+// CHECK: rstorssp 485498096 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x2d,0xf0,0x1c,0xf0,0x1c]         
+rstorssp 485498096 
+
+// CHECK: rstorssp 64(%edx,%eax) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x6c,0x02,0x40]         
+rstorssp 64(%edx,%eax) 
+
+// CHECK: rstorssp (%edx) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x2a]         
+rstorssp (%edx) 
+
+// CHECK: saveprevssp 
+// CHECK: encoding: [0xf3,0x0f,0x01,0xea]          
+saveprevssp 
+
+// CHECK: setssbsy
+// CHECK: # encoding: [0xf3,0x0f,0x01,0xe8]
+setssbsy
+
+// CHECK: wrssd %eax, 3809469200(%edx,%eax,4) 
+// CHECK: encoding: [0x0f,0x38,0xf6,0x84,0x82,0x10,0xe3,0x0f,0xe3]        
+wrssd %eax, 3809469200(%edx,%eax,4) 
+
+// CHECK: wrssd %eax, 485498096(%edx,%eax,4) 
+// CHECK: encoding: [0x0f,0x38,0xf6,0x84,0x82,0xf0,0x1c,0xf0,0x1c]        
+wrssd %eax, 485498096(%edx,%eax,4) 
+
+// CHECK: wrssd %eax, 485498096(%edx) 
+// CHECK: encoding: [0x0f,0x38,0xf6,0x82,0xf0,0x1c,0xf0,0x1c]        
+wrssd %eax, 485498096(%edx) 
+
+// CHECK: wrssd %eax, 485498096 
+// CHECK: encoding: [0x0f,0x38,0xf6,0x05,0xf0,0x1c,0xf0,0x1c]        
+wrssd %eax, 485498096 
+
+// CHECK: wrssd %eax, 64(%edx,%eax) 
+// CHECK: encoding: [0x0f,0x38,0xf6,0x44,0x02,0x40]        
+wrssd %eax, 64(%edx,%eax) 
+
+// CHECK: wrssd %eax, (%edx) 
+// CHECK: encoding: [0x0f,0x38,0xf6,0x02]        
+wrssd %eax, (%edx) 
+
+// CHECK: wrussd %eax, 3809469200(%edx,%eax,4) 
+// CHECK: encoding: [0x66,0x0f,0x38,0xf5,0x84,0x82,0x10,0xe3,0x0f,0xe3]        
+wrussd %eax, 3809469200(%edx,%eax,4) 
+
+// CHECK: wrussd %eax, 485498096(%edx,%eax,4) 
+// CHECK: encoding: [0x66,0x0f,0x38,0xf5,0x84,0x82,0xf0,0x1c,0xf0,0x1c]        
+wrussd %eax, 485498096(%edx,%eax,4) 
+
+// CHECK: wrussd %eax, 485498096(%edx) 
+// CHECK: encoding: [0x66,0x0f,0x38,0xf5,0x82,0xf0,0x1c,0xf0,0x1c]        
+wrussd %eax, 485498096(%edx) 
+
+// CHECK: wrussd %eax, 485498096 
+// CHECK: encoding: [0x66,0x0f,0x38,0xf5,0x05,0xf0,0x1c,0xf0,0x1c]        
+wrussd %eax, 485498096 
+
+// CHECK: wrussd %eax, 64(%edx,%eax) 
+// CHECK: encoding: [0x66,0x0f,0x38,0xf5,0x44,0x02,0x40]        
+wrussd %eax, 64(%edx,%eax) 
+
+// CHECK: wrussd %eax, (%edx) 
+// CHECK: encoding: [0x66,0x0f,0x38,0xf5,0x02]        
+wrussd %eax, (%edx) 
+

Added: llvm/trunk/test/MC/X86/CET-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/CET-64.s?rev=325561&view=auto
==============================================================================
--- llvm/trunk/test/MC/X86/CET-64.s (added)
+++ llvm/trunk/test/MC/X86/CET-64.s Tue Feb 20 00:00:31 2018
@@ -0,0 +1,178 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s
+
+// CHECK: clrssbsy 485498096 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x34,0x25,0xf0,0x1c,0xf0,0x1c]         
+clrssbsy 485498096 
+
+// CHECK: clrssbsy 64(%rdx) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x72,0x40]         
+clrssbsy 64(%rdx) 
+
+// CHECK: clrssbsy 64(%rdx,%rax,4) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x74,0x82,0x40]         
+clrssbsy 64(%rdx,%rax,4) 
+
+// CHECK: clrssbsy -64(%rdx,%rax,4) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x74,0x82,0xc0]         
+clrssbsy -64(%rdx,%rax,4) 
+
+// CHECK: clrssbsy 64(%rdx,%rax) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x74,0x02,0x40]         
+clrssbsy 64(%rdx,%rax) 
+
+// CHECK: clrssbsy (%rdx) 
+// CHECK: encoding: [0xf3,0x0f,0xae,0x32]         
+clrssbsy (%rdx) 
+
+// CHECK: endbr64
+// CHECK: # encoding: [0xf3,0x0f,0x1e,0xfa]
+endbr64
+
+// CHECK: endbr32
+// CHECK: # encoding: [0xf3,0x0f,0x1e,0xfb]
+endbr32
+
+// CHECK: incsspd %r13d
+// CHECK: # encoding: [0xf3,0x41,0x0f,0xae,0xed]
+incsspd %r13d
+
+// CHECK: incsspq %r15
+// CHECK: # encoding: [0xf3,0x49,0x0f,0xae,0xef]
+incsspq %r15
+
+// CHECK: rdsspd %r13d 
+// CHECK: encoding: [0xf3,0x41,0x0f,0x1e,0xcd]         
+rdsspd %r13d 
+
+// CHECK: rdsspq %r15 
+// CHECK: encoding: [0xf3,0x49,0x0f,0x1e,0xcf]         
+rdsspq %r15 
+
+// CHECK: rstorssp 485498096 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]         
+rstorssp 485498096 
+
+// CHECK: rstorssp 64(%rdx) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x6a,0x40]         
+rstorssp 64(%rdx) 
+
+// CHECK: rstorssp 64(%rdx,%rax,4) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x6c,0x82,0x40]         
+rstorssp 64(%rdx,%rax,4) 
+
+// CHECK: rstorssp -64(%rdx,%rax,4) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x6c,0x82,0xc0]         
+rstorssp -64(%rdx,%rax,4) 
+
+// CHECK: rstorssp 64(%rdx,%rax) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x6c,0x02,0x40]         
+rstorssp 64(%rdx,%rax) 
+
+// CHECK: rstorssp (%rdx) 
+// CHECK: encoding: [0xf3,0x0f,0x01,0x2a]         
+rstorssp (%rdx) 
+
+// CHECK: saveprevssp 
+// CHECK: encoding: [0xf3,0x0f,0x01,0xea]          
+saveprevssp 
+
+// CHECK: setssbsy
+// CHECK: # encoding: [0xf3,0x0f,0x01,0xe8]
+setssbsy
+
+// CHECK: wrssd %r13d, 485498096 
+// CHECK: encoding: [0x44,0x0f,0x38,0xf6,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]        
+wrssd %r13d, 485498096 
+
+// CHECK: wrssd %r13d, 64(%rdx) 
+// CHECK: encoding: [0x44,0x0f,0x38,0xf6,0x6a,0x40]        
+wrssd %r13d, 64(%rdx) 
+
+// CHECK: wrssd %r13d, 64(%rdx,%rax,4) 
+// CHECK: encoding: [0x44,0x0f,0x38,0xf6,0x6c,0x82,0x40]        
+wrssd %r13d, 64(%rdx,%rax,4) 
+
+// CHECK: wrssd %r13d, -64(%rdx,%rax,4) 
+// CHECK: encoding: [0x44,0x0f,0x38,0xf6,0x6c,0x82,0xc0]        
+wrssd %r13d, -64(%rdx,%rax,4) 
+
+// CHECK: wrssd %r13d, 64(%rdx,%rax) 
+// CHECK: encoding: [0x44,0x0f,0x38,0xf6,0x6c,0x02,0x40]        
+wrssd %r13d, 64(%rdx,%rax) 
+
+// CHECK: wrssd %r13d, (%rdx) 
+// CHECK: encoding: [0x44,0x0f,0x38,0xf6,0x2a]        
+wrssd %r13d, (%rdx) 
+
+// CHECK: wrssq %r15, 485498096 
+// CHECK: encoding: [0x4c,0x0f,0x38,0xf6,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]        
+wrssq %r15, 485498096 
+
+// CHECK: wrssq %r15, 64(%rdx) 
+// CHECK: encoding: [0x4c,0x0f,0x38,0xf6,0x7a,0x40]        
+wrssq %r15, 64(%rdx) 
+
+// CHECK: wrssq %r15, 64(%rdx,%rax,4) 
+// CHECK: encoding: [0x4c,0x0f,0x38,0xf6,0x7c,0x82,0x40]        
+wrssq %r15, 64(%rdx,%rax,4) 
+
+// CHECK: wrssq %r15, -64(%rdx,%rax,4) 
+// CHECK: encoding: [0x4c,0x0f,0x38,0xf6,0x7c,0x82,0xc0]        
+wrssq %r15, -64(%rdx,%rax,4) 
+
+// CHECK: wrssq %r15, 64(%rdx,%rax) 
+// CHECK: encoding: [0x4c,0x0f,0x38,0xf6,0x7c,0x02,0x40]        
+wrssq %r15, 64(%rdx,%rax) 
+
+// CHECK: wrssq %r15, (%rdx) 
+// CHECK: encoding: [0x4c,0x0f,0x38,0xf6,0x3a]        
+wrssq %r15, (%rdx) 
+
+// CHECK: wrussd %r13d, 485498096 
+// CHECK: encoding: [0x66,0x44,0x0f,0x38,0xf5,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]        
+wrussd %r13d, 485498096 
+
+// CHECK: wrussd %r13d, 64(%rdx) 
+// CHECK: encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6a,0x40]        
+wrussd %r13d, 64(%rdx) 
+
+// CHECK: wrussd %r13d, 64(%rdx,%rax,4) 
+// CHECK: encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6c,0x82,0x40]        
+wrussd %r13d, 64(%rdx,%rax,4) 
+
+// CHECK: wrussd %r13d, -64(%rdx,%rax,4) 
+// CHECK: encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6c,0x82,0xc0]        
+wrussd %r13d, -64(%rdx,%rax,4) 
+
+// CHECK: wrussd %r13d, 64(%rdx,%rax) 
+// CHECK: encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6c,0x02,0x40]        
+wrussd %r13d, 64(%rdx,%rax) 
+
+// CHECK: wrussd %r13d, (%rdx) 
+// CHECK: encoding: [0x66,0x44,0x0f,0x38,0xf5,0x2a]        
+wrussd %r13d, (%rdx) 
+
+// CHECK: wrussq %r15, 485498096 
+// CHECK: encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]        
+wrussq %r15, 485498096 
+
+// CHECK: wrussq %r15, 64(%rdx) 
+// CHECK: encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7a,0x40]        
+wrussq %r15, 64(%rdx) 
+
+// CHECK: wrussq %r15, 64(%rdx,%rax,4) 
+// CHECK: encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7c,0x82,0x40]        
+wrussq %r15, 64(%rdx,%rax,4) 
+
+// CHECK: wrussq %r15, -64(%rdx,%rax,4) 
+// CHECK: encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7c,0x82,0xc0]        
+wrussq %r15, -64(%rdx,%rax,4) 
+
+// CHECK: wrussq %r15, 64(%rdx,%rax) 
+// CHECK: encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7c,0x02,0x40]        
+wrussq %r15, 64(%rdx,%rax) 
+
+// CHECK: wrussq %r15, (%rdx) 
+// CHECK: encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x3a]        
+wrussq %r15, (%rdx) 
+




More information about the llvm-commits mailing list