Skip to content

Commit

Permalink
[X86][XSAVE]: Adding full coverage of MC encoding for the XSAVE isa s…
Browse files Browse the repository at this point in the history
…ets.<NFC>

NFC.
 Adding MC regressions tests to cover the XSAVE 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, RKSimon, AndreiGrischenko, craig.topper
Differential Revision: https://reviews.llvm.org/D41282

Change-Id: I325bf8f421f78c80179a04fc39033366759cbe45
llvm-svn: 322537
  • Loading branch information
gadihaber committed Jan 16, 2018
1 parent 83e63d9 commit a6bc5f9
Show file tree
Hide file tree
Showing 11 changed files with 614 additions and 0 deletions.
50 changes: 50 additions & 0 deletions llvm/test/MC/X86/FXSAVE-32.s
@@ -0,0 +1,50 @@
// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s

// CHECK: fxrstor -485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0x8c,0x82,0x10,0xe3,0x0f,0xe3]
fxrstor -485498096(%edx,%eax,4)

// CHECK: fxrstor 485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0x8c,0x82,0xf0,0x1c,0xf0,0x1c]
fxrstor 485498096(%edx,%eax,4)

// CHECK: fxrstor 485498096(%edx)
// CHECK: encoding: [0x0f,0xae,0x8a,0xf0,0x1c,0xf0,0x1c]
fxrstor 485498096(%edx)

// CHECK: fxrstor 485498096
// CHECK: encoding: [0x0f,0xae,0x0d,0xf0,0x1c,0xf0,0x1c]
fxrstor 485498096

// CHECK: fxrstor 64(%edx,%eax)
// CHECK: encoding: [0x0f,0xae,0x4c,0x02,0x40]
fxrstor 64(%edx,%eax)

// CHECK: fxrstor (%edx)
// CHECK: encoding: [0x0f,0xae,0x0a]
fxrstor (%edx)

// CHECK: fxsave -485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0x84,0x82,0x10,0xe3,0x0f,0xe3]
fxsave -485498096(%edx,%eax,4)

// CHECK: fxsave 485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0x84,0x82,0xf0,0x1c,0xf0,0x1c]
fxsave 485498096(%edx,%eax,4)

// CHECK: fxsave 485498096(%edx)
// CHECK: encoding: [0x0f,0xae,0x82,0xf0,0x1c,0xf0,0x1c]
fxsave 485498096(%edx)

// CHECK: fxsave 485498096
// CHECK: encoding: [0x0f,0xae,0x05,0xf0,0x1c,0xf0,0x1c]
fxsave 485498096

// CHECK: fxsave 64(%edx,%eax)
// CHECK: encoding: [0x0f,0xae,0x44,0x02,0x40]
fxsave 64(%edx,%eax)

// CHECK: fxsave (%edx)
// CHECK: encoding: [0x0f,0xae,0x02]
fxsave (%edx)

50 changes: 50 additions & 0 deletions llvm/test/MC/X86/FXSAVE-64.s
@@ -0,0 +1,50 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s

// CHECK: fxrstor 485498096
// CHECK: encoding: [0x0f,0xae,0x0c,0x25,0xf0,0x1c,0xf0,0x1c]
fxrstor 485498096

// CHECK: fxrstor 64(%rdx)
// CHECK: encoding: [0x0f,0xae,0x4a,0x40]
fxrstor 64(%rdx)

// CHECK: fxrstor 64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x4c,0x82,0x40]
fxrstor 64(%rdx,%rax,4)

// CHECK: fxrstor -64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x4c,0x82,0xc0]
fxrstor -64(%rdx,%rax,4)

// CHECK: fxrstor 64(%rdx,%rax)
// CHECK: encoding: [0x0f,0xae,0x4c,0x02,0x40]
fxrstor 64(%rdx,%rax)

// CHECK: fxrstor (%rdx)
// CHECK: encoding: [0x0f,0xae,0x0a]
fxrstor (%rdx)

// CHECK: fxsave 485498096
// CHECK: encoding: [0x0f,0xae,0x04,0x25,0xf0,0x1c,0xf0,0x1c]
fxsave 485498096

// CHECK: fxsave 64(%rdx)
// CHECK: encoding: [0x0f,0xae,0x42,0x40]
fxsave 64(%rdx)

// CHECK: fxsave 64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x44,0x82,0x40]
fxsave 64(%rdx,%rax,4)

// CHECK: fxsave -64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x44,0x82,0xc0]
fxsave -64(%rdx,%rax,4)

// CHECK: fxsave 64(%rdx,%rax)
// CHECK: encoding: [0x0f,0xae,0x44,0x02,0x40]
fxsave 64(%rdx,%rax)

// CHECK: fxsave (%rdx)
// CHECK: encoding: [0x0f,0xae,0x02]
fxsave (%rdx)

50 changes: 50 additions & 0 deletions llvm/test/MC/X86/FXSAVE64-64.s
@@ -0,0 +1,50 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s

// CHECK: fxrstor64 485498096
// CHECK: encoding: [0x48,0x0f,0xae,0x0c,0x25,0xf0,0x1c,0xf0,0x1c]
fxrstor64 485498096

// CHECK: fxrstor64 64(%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x4a,0x40]
fxrstor64 64(%rdx)

// CHECK: fxrstor64 64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x4c,0x82,0x40]
fxrstor64 64(%rdx,%rax,4)

// CHECK: fxrstor64 -64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x4c,0x82,0xc0]
fxrstor64 -64(%rdx,%rax,4)

// CHECK: fxrstor64 64(%rdx,%rax)
// CHECK: encoding: [0x48,0x0f,0xae,0x4c,0x02,0x40]
fxrstor64 64(%rdx,%rax)

// CHECK: fxrstor64 (%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x0a]
fxrstor64 (%rdx)

// CHECK: fxsave64 485498096
// CHECK: encoding: [0x48,0x0f,0xae,0x04,0x25,0xf0,0x1c,0xf0,0x1c]
fxsave64 485498096

// CHECK: fxsave64 64(%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x42,0x40]
fxsave64 64(%rdx)

// CHECK: fxsave64 64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x44,0x82,0x40]
fxsave64 64(%rdx,%rax,4)

// CHECK: fxsave64 -64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x44,0x82,0xc0]
fxsave64 -64(%rdx,%rax,4)

// CHECK: fxsave64 64(%rdx,%rax)
// CHECK: encoding: [0x48,0x0f,0xae,0x44,0x02,0x40]
fxsave64 64(%rdx,%rax)

// CHECK: fxsave64 (%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x02]
fxsave64 (%rdx)

58 changes: 58 additions & 0 deletions llvm/test/MC/X86/XSAVE-32.s
@@ -0,0 +1,58 @@
// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s

// CHECK: xgetbv
// CHECK: encoding: [0x0f,0x01,0xd0]
xgetbv

// CHECK: xrstor -485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0xac,0x82,0x10,0xe3,0x0f,0xe3]
xrstor -485498096(%edx,%eax,4)

// CHECK: xrstor 485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0xac,0x82,0xf0,0x1c,0xf0,0x1c]
xrstor 485498096(%edx,%eax,4)

// CHECK: xrstor 485498096(%edx)
// CHECK: encoding: [0x0f,0xae,0xaa,0xf0,0x1c,0xf0,0x1c]
xrstor 485498096(%edx)

// CHECK: xrstor 485498096
// CHECK: encoding: [0x0f,0xae,0x2d,0xf0,0x1c,0xf0,0x1c]
xrstor 485498096

// CHECK: xrstor 64(%edx,%eax)
// CHECK: encoding: [0x0f,0xae,0x6c,0x02,0x40]
xrstor 64(%edx,%eax)

// CHECK: xrstor (%edx)
// CHECK: encoding: [0x0f,0xae,0x2a]
xrstor (%edx)

// CHECK: xsave -485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0xa4,0x82,0x10,0xe3,0x0f,0xe3]
xsave -485498096(%edx,%eax,4)

// CHECK: xsave 485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xae,0xa4,0x82,0xf0,0x1c,0xf0,0x1c]
xsave 485498096(%edx,%eax,4)

// CHECK: xsave 485498096(%edx)
// CHECK: encoding: [0x0f,0xae,0xa2,0xf0,0x1c,0xf0,0x1c]
xsave 485498096(%edx)

// CHECK: xsave 485498096
// CHECK: encoding: [0x0f,0xae,0x25,0xf0,0x1c,0xf0,0x1c]
xsave 485498096

// CHECK: xsave 64(%edx,%eax)
// CHECK: encoding: [0x0f,0xae,0x64,0x02,0x40]
xsave 64(%edx,%eax)

// CHECK: xsave (%edx)
// CHECK: encoding: [0x0f,0xae,0x22]
xsave (%edx)

// CHECK: xsetbv
// CHECK: encoding: [0x0f,0x01,0xd1]
xsetbv

106 changes: 106 additions & 0 deletions llvm/test/MC/X86/XSAVE-64.s
@@ -0,0 +1,106 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s

// CHECK: xgetbv
// CHECK: encoding: [0x0f,0x01,0xd0]
xgetbv

// CHECK: xrstor 485498096
// CHECK: encoding: [0x0f,0xae,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]
xrstor 485498096

// CHECK: xrstor64 485498096
// CHECK: encoding: [0x48,0x0f,0xae,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]
xrstor64 485498096

// CHECK: xrstor64 64(%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x6a,0x40]
xrstor64 64(%rdx)

// CHECK: xrstor64 64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x6c,0x82,0x40]
xrstor64 64(%rdx,%rax,4)

// CHECK: xrstor64 -64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x6c,0x82,0xc0]
xrstor64 -64(%rdx,%rax,4)

// CHECK: xrstor64 64(%rdx,%rax)
// CHECK: encoding: [0x48,0x0f,0xae,0x6c,0x02,0x40]
xrstor64 64(%rdx,%rax)

// CHECK: xrstor 64(%rdx)
// CHECK: encoding: [0x0f,0xae,0x6a,0x40]
xrstor 64(%rdx)

// CHECK: xrstor64 (%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x2a]
xrstor64 (%rdx)

// CHECK: xrstor 64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x6c,0x82,0x40]
xrstor 64(%rdx,%rax,4)

// CHECK: xrstor -64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x6c,0x82,0xc0]
xrstor -64(%rdx,%rax,4)

// CHECK: xrstor 64(%rdx,%rax)
// CHECK: encoding: [0x0f,0xae,0x6c,0x02,0x40]
xrstor 64(%rdx,%rax)

// CHECK: xrstor (%rdx)
// CHECK: encoding: [0x0f,0xae,0x2a]
xrstor (%rdx)

// CHECK: xsave 485498096
// CHECK: encoding: [0x0f,0xae,0x24,0x25,0xf0,0x1c,0xf0,0x1c]
xsave 485498096

// CHECK: xsave64 485498096
// CHECK: encoding: [0x48,0x0f,0xae,0x24,0x25,0xf0,0x1c,0xf0,0x1c]
xsave64 485498096

// CHECK: xsave64 64(%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x62,0x40]
xsave64 64(%rdx)

// CHECK: xsave64 64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x64,0x82,0x40]
xsave64 64(%rdx,%rax,4)

// CHECK: xsave64 -64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xae,0x64,0x82,0xc0]
xsave64 -64(%rdx,%rax,4)

// CHECK: xsave64 64(%rdx,%rax)
// CHECK: encoding: [0x48,0x0f,0xae,0x64,0x02,0x40]
xsave64 64(%rdx,%rax)

// CHECK: xsave 64(%rdx)
// CHECK: encoding: [0x0f,0xae,0x62,0x40]
xsave 64(%rdx)

// CHECK: xsave64 (%rdx)
// CHECK: encoding: [0x48,0x0f,0xae,0x22]
xsave64 (%rdx)

// CHECK: xsave 64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x64,0x82,0x40]
xsave 64(%rdx,%rax,4)

// CHECK: xsave -64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xae,0x64,0x82,0xc0]
xsave -64(%rdx,%rax,4)

// CHECK: xsave 64(%rdx,%rax)
// CHECK: encoding: [0x0f,0xae,0x64,0x02,0x40]
xsave 64(%rdx,%rax)

// CHECK: xsave (%rdx)
// CHECK: encoding: [0x0f,0xae,0x22]
xsave (%rdx)

// CHECK: xsetbv
// CHECK: encoding: [0x0f,0x01,0xd1]
xsetbv

26 changes: 26 additions & 0 deletions llvm/test/MC/X86/XSAVEC-32.s
@@ -0,0 +1,26 @@
// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s

// CHECK: xsavec -485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xc7,0xa4,0x82,0x10,0xe3,0x0f,0xe3]
xsavec -485498096(%edx,%eax,4)

// CHECK: xsavec 485498096(%edx,%eax,4)
// CHECK: encoding: [0x0f,0xc7,0xa4,0x82,0xf0,0x1c,0xf0,0x1c]
xsavec 485498096(%edx,%eax,4)

// CHECK: xsavec 485498096(%edx)
// CHECK: encoding: [0x0f,0xc7,0xa2,0xf0,0x1c,0xf0,0x1c]
xsavec 485498096(%edx)

// CHECK: xsavec 485498096
// CHECK: encoding: [0x0f,0xc7,0x25,0xf0,0x1c,0xf0,0x1c]
xsavec 485498096

// CHECK: xsavec 64(%edx,%eax)
// CHECK: encoding: [0x0f,0xc7,0x64,0x02,0x40]
xsavec 64(%edx,%eax)

// CHECK: xsavec (%edx)
// CHECK: encoding: [0x0f,0xc7,0x22]
xsavec (%edx)

50 changes: 50 additions & 0 deletions llvm/test/MC/X86/XSAVEC-64.s
@@ -0,0 +1,50 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s

// CHECK: xsavec 485498096
// CHECK: encoding: [0x0f,0xc7,0x24,0x25,0xf0,0x1c,0xf0,0x1c]
xsavec 485498096

// CHECK: xsavec64 485498096
// CHECK: encoding: [0x48,0x0f,0xc7,0x24,0x25,0xf0,0x1c,0xf0,0x1c]
xsavec64 485498096

// CHECK: xsavec64 64(%rdx)
// CHECK: encoding: [0x48,0x0f,0xc7,0x62,0x40]
xsavec64 64(%rdx)

// CHECK: xsavec64 64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xc7,0x64,0x82,0x40]
xsavec64 64(%rdx,%rax,4)

// CHECK: xsavec64 -64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0x0f,0xc7,0x64,0x82,0xc0]
xsavec64 -64(%rdx,%rax,4)

// CHECK: xsavec64 64(%rdx,%rax)
// CHECK: encoding: [0x48,0x0f,0xc7,0x64,0x02,0x40]
xsavec64 64(%rdx,%rax)

// CHECK: xsavec 64(%rdx)
// CHECK: encoding: [0x0f,0xc7,0x62,0x40]
xsavec 64(%rdx)

// CHECK: xsavec64 (%rdx)
// CHECK: encoding: [0x48,0x0f,0xc7,0x22]
xsavec64 (%rdx)

// CHECK: xsavec 64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xc7,0x64,0x82,0x40]
xsavec 64(%rdx,%rax,4)

// CHECK: xsavec -64(%rdx,%rax,4)
// CHECK: encoding: [0x0f,0xc7,0x64,0x82,0xc0]
xsavec -64(%rdx,%rax,4)

// CHECK: xsavec 64(%rdx,%rax)
// CHECK: encoding: [0x0f,0xc7,0x64,0x02,0x40]
xsavec 64(%rdx,%rax)

// CHECK: xsavec (%rdx)
// CHECK: encoding: [0x0f,0xc7,0x22]
xsavec (%rdx)

0 comments on commit a6bc5f9

Please sign in to comment.