2020-01-09 16:41:48 +08:00
|
|
|
/// Test that -malign-branch* and -mbranches-within-32B-boundaries are handled for assembly files.
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64 -malign-branch-boundary=16 %s -c -### 2>&1 | FileCheck %s --check-prefix=BOUNDARY
|
|
|
|
// BOUNDARY: "-mllvm" "-x86-align-branch-boundary=16"
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64 -malign-branch=fused,jcc,jmp %s -c -### %s 2>&1 | FileCheck %s --check-prefix=TYPE
|
|
|
|
// TYPE: "-mllvm" "-x86-align-branch=fused+jcc+jmp"
|
|
|
|
|
[Driver][X86] Add -mpad-max-prefix-size
Summary:
The option `-mpad-max-prefix-size` performs some checking and delegate to MC option `-x86-pad-max-prefix-size`. This option is designed for eliminate NOPs when we need to align something by adding redundant prefixes to instructions, e.g. it can be used along with `-malign-branch`, `-malign-branch-boundary` to prefix padding branch.
It has similar (but slightly different) effect as GAS's option `-malign-branch-prefix-size`, e.g. `-mpad-max-prefix-size` can also elminate NOPs emitted by align directive, so we use a different name here. I remove the option `-malign-branch-prefix-size` since is unimplemented and not needed. If we need to be compatible with GAS, we can make `-malign-branch-prefix-size` an alias for this option later.
Reviewers: jyknight, reames, MaskRay, craig.topper, LuoYuanke
Reviewed By: MaskRay, LuoYuanke
Subscribers: annita.zhang, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77628
2020-04-07 12:25:03 +08:00
|
|
|
// RUN: %clang -target x86_64 -mpad-max-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX
|
|
|
|
// PREFIX: "-mllvm" "-x86-pad-max-prefix-size=5"
|
2020-01-09 16:41:48 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck %s --check-prefix=32B
|
|
|
|
// 32B: "-mllvm" "-x86-branches-within-32B-boundaries"
|