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.
aarch64: support target-specific .req assembler directive
Based on the support for .req on ARM. The aarch64 variant has to keep track if the alias register was a vector register (v0-31) or a general purpose or VFP/Advanced SIMD ([bhsdq]0-31) register. Patch by Janne Grunau! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212161 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
4 changed files
with
188 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: llvm-mc -triple=arm64-eabi < %s | FileCheck %s | ||
_foo: | ||
OBJECT .req x2 | ||
mov x4, OBJECT | ||
mov x4, oBjEcT | ||
.unreq oBJECT | ||
|
||
_foo2: | ||
OBJECT .req w5 | ||
mov w4, OBJECT | ||
.unreq OBJECT | ||
|
||
// CHECK-LABEL: _foo: | ||
// CHECK: mov x4, x2 | ||
// CHECK: mov x4, x2 | ||
|
||
// CHECK-LABEL: _foo2: | ||
// CHECK: mov w4, w5 |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// RUN: not llvm-mc -triple aarch64-none-linux-gnu < %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-ERROR %s | ||
|
||
bar: | ||
fred .req x5 | ||
fred .req x6 | ||
// CHECK-ERROR: warning: ignoring redefinition of register alias 'fred' | ||
// CHECK-ERROR: fred .req x6 | ||
// CHECK-ERROR: ^ | ||
|
||
ada .req v2.8b | ||
// CHECK-ERROR: error: vector register without type specifier expected | ||
// CHECK-ERROR: ada .req v2.8b | ||
// CHECK-ERROR: ^ | ||
|
||
bob .req lisa | ||
// CHECK-ERROR: error: register name or alias expected | ||
// CHECK-ERROR: bob .req lisa | ||
// CHECK-ERROR: ^ | ||
|
||
lisa .req x1, 23 | ||
// CHECK-ERROR: error: unexpected input in .req directive | ||
// CHECK-ERROR: lisa .req x1, 23 | ||
// CHECK-ERROR: ^ | ||
|
||
mov bob, fred | ||
// CHECK-ERROR: error: invalid operand for instruction | ||
// CHECK-ERROR: mov bob, fred | ||
// CHECK-ERROR: ^ | ||
|
||
.unreq 1 | ||
// CHECK-ERROR: error: unexpected input in .unreq directive. | ||
// CHECK-ERROR: .unreq 1 | ||
// CHECK-ERROR: ^ | ||
|
||
mov x1, fred | ||
// CHECK: mov x1, x5 | ||
// CHECK-NOT: mov x1, x6 |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// RUN: llvm-mc -triple=aarch64-none-linux-gnu -show-encoding < %s | FileCheck %s | ||
|
||
bar: | ||
fred .req x5 | ||
mov fred, x11 | ||
.unreq fred | ||
fred .req w6 | ||
mov w1, fred | ||
|
||
bob .req fred | ||
ada .req w1 | ||
mov ada, bob | ||
.unreq bob | ||
.unreq fred | ||
.unreq ada | ||
// CHECK: mov x5, x11 // encoding: [0xe5,0x03,0x0b,0xaa] | ||
// CHECK: mov w1, w6 // encoding: [0xe1,0x03,0x06,0x2a] | ||
// CHECK: mov w1, w6 // encoding: [0xe1,0x03,0x06,0x2a] | ||
|
||
bob .req b6 | ||
hanah .req h5 | ||
sam .req s4 | ||
dora .req d3 | ||
quentin .req q2 | ||
vesna .req v1 | ||
addv bob, v0.8b | ||
mov hanah, v4.h[3] | ||
fadd s0, sam, sam | ||
fmov d2, dora | ||
ldr quentin, [sp] | ||
mov v0.8b, vesna.8b | ||
// CHECK: addv b6, v0.8b // encoding: [0x06,0xb8,0x31,0x0e] | ||
// CHECK: mov h5, v4.h[3] // encoding: [0x85,0x04,0x0e,0x5e] | ||
// CHECK: fadd s0, s4, s4 // encoding: [0x80,0x28,0x24,0x1e] | ||
// CHECK: fmov d2, d3 // encoding: [0x62,0x40,0x60,0x1e] | ||
// CHECK: ldr q2, [sp] // encoding: [0xe2,0x03,0xc0,0x3d] | ||
// CHECK: mov v0.8b, v1.8b // encoding: [0x20,0x1c,0xa1,0x0e] |