forked from llvm-mirror/llvm
-
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.
Make it possible to switch off stackptr MPX optimization
- Loading branch information
David Brazdil
committed
Oct 4, 2017
1 parent
fc0667c
commit 58b93a2
Showing
2 changed files
with
75 additions
and
26 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,111 @@ | ||
// RUN: llvm-mc -hadean-mpx=true -assemble -triple=x86_64-hadean-linux -filetype obj < %s | llvm-objdump -d - | FileCheck %s | ||
// RUN: llvm-mc -hadean-mpx=true -hadean-mpx-stackptropt=false -assemble -triple=x86_64-hadean-linux -filetype obj < %s | llvm-objdump -d - | FileCheck -check-prefix=CHECK %s | ||
// RUN: llvm-mc -hadean-mpx=true -hadean-mpx-stackptropt=true -assemble -triple=x86_64-hadean-linux -filetype obj < %s | llvm-objdump -d - | FileCheck -check-prefix=CHECK-OPT %s | ||
|
||
.text | ||
|
||
// ====== PUSH 16-BIT REGISTER ====== | ||
|
||
pushw %dx | ||
|
||
// CHECK: bndcl -2(%rsp), %bnd3 | ||
// CHECK-NEXT: pushw %dx | ||
// CHECK: bndcl -2(%rsp), %bnd3 | ||
// CHECK-NEXT: bndcu -1(%rsp), %bnd3 | ||
// CHECK-NEXT: pushw %dx | ||
|
||
// CHECK-OPT: bndcl -2(%rsp), %bnd3 | ||
// CHECK-OPT-NEXT: pushw %dx | ||
|
||
// ====== PUSH 64-BIT REGISTER ====== | ||
|
||
pushq %rdx | ||
|
||
// CHECK: bndcl -8(%rsp), %bnd3 | ||
// CHECK-NEXT: pushq %rdx | ||
// CHECK: bndcl -8(%rsp), %bnd3 | ||
// CHECK-NEXT: bndcu -1(%rsp), %bnd3 | ||
// CHECK-NEXT: pushq %rdx | ||
|
||
// CHECK-OPT: bndcl -8(%rsp), %bnd3 | ||
// CHECK-OPT-NEXT: pushq %rdx | ||
|
||
// ====== POP 16-BIT REGISTER ====== | ||
|
||
popw %dx | ||
|
||
// CHECK: bndcu 1(%rsp), %bnd3 | ||
// CHECK-NEXT: popw %dx | ||
// CHECK: bndcl (%rsp), %bnd3 | ||
// CHECK-NEXT: bndcu 1(%rsp), %bnd3 | ||
// CHECK-NEXT: popw %dx | ||
|
||
// CHECK-OPT: bndcu 1(%rsp), %bnd3 | ||
// CHECK-OPT-NEXT: popw %dx | ||
|
||
// ====== POP 64-BIT REGISTER ====== | ||
|
||
popq %rdx | ||
|
||
// CHECK: bndcu 7(%rsp), %bnd3 | ||
// CHECK-NEXT: popq %rdx | ||
// CHECK: bndcl (%rsp), %bnd3 | ||
// CHECK-NEXT: bndcu 7(%rsp), %bnd3 | ||
// CHECK-NEXT: popq %rdx | ||
|
||
// CHECK-OPT: bndcu 7(%rsp), %bnd3 | ||
// CHECK-OPT-NEXT: popq %rdx | ||
|
||
// ====== SET SPL REGISTER ====== | ||
|
||
andb $42, %spl | ||
|
||
// CHECK: andb $42, %spl | ||
// CHECK-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-NEXT: bndcu -1(%rsp), %bnd3 | ||
// CHECK: andb $42, %spl | ||
// CHECK-NOT: bndcl | ||
// CHECK-NOT: bndcu | ||
|
||
// CHECK-OPT: andb $42, %spl | ||
// CHECK-OPT-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-OPT-NEXT: bndcu -1(%rsp), %bnd3 | ||
|
||
// ====== SET SP REGISTER ====== | ||
|
||
andw $1234, %sp | ||
|
||
// CHECK: andw $1234, %sp | ||
// CHECK-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-NEXT: bndcu -1(%rsp), %bnd3 | ||
// CHECK: andw $1234, %sp | ||
// CHECK-NOT: bndcl | ||
// CHECK-NOT: bndcu | ||
|
||
// CHECK-OPT: andw $1234, %sp | ||
// CHECK-OPT-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-OPT-NEXT: bndcu -1(%rsp), %bnd3 | ||
|
||
// ====== SET ESP REGISTER ====== | ||
|
||
andl $65000, %esp | ||
|
||
// CHECK: andl $65000, %esp | ||
// CHECK-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-NEXT: bndcu -1(%rsp), %bnd3 | ||
// CHECK: andl $65000, %esp | ||
// CHECK-NOT: bndcl | ||
// CHECK-NOT: bndcu | ||
|
||
// CHECK-OPT: andl $65000, %esp | ||
// CHECK-OPT-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-OPT-NEXT: bndcu -1(%rsp), %bnd3 | ||
|
||
// ====== SET RSP REGISTER ====== | ||
|
||
andq $65535, %rsp | ||
|
||
// CHECK: andq $65535, %rsp | ||
// CHECK-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-NEXT: bndcu -1(%rsp), %bnd3 | ||
// CHECK: andq $65535, %rsp | ||
// CHECK-NOT: bndcl | ||
// CHECK-NOT: bndcu | ||
|
||
// CHECK-OPT: andq $65535, %rsp | ||
// CHECK-OPT-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-OPT-NEXT: bndcu -1(%rsp), %bnd3 | ||
|
||
// ====== POP INTO RSP REGISTER ====== | ||
|
||
popq %rsp | ||
|
||
// CHECK: bndcu 7(%rsp), %bnd3 | ||
// CHECK-NEXT: popq %rsp | ||
// CHECK-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-NEXT: bndcu -1(%rsp), %bnd3 | ||
// CHECK: bndcl (%rsp), %bnd3 | ||
// CHECK-NEXT: bndcu 7(%rsp), %bnd3 | ||
// CHECK: popq %rsp | ||
// CHECK-NOT: bndcl | ||
// CHECK-NOT: bndcu | ||
|
||
// CHECK-OPT: bndcu 7(%rsp), %bnd3 | ||
// CHECK-OPT-NEXT: popq %rsp | ||
// CHECK-OPT-NEXT: bndcl %rsp, %bnd3 | ||
// CHECK-OPT-NEXT: bndcu -1(%rsp), %bnd3 |