1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
llvm-mirror/test/MC/AArch64/armv8.1a-rdma.s
Nirav Dave 66019b69d5 Defer asm errors to post-statement failure
Recommitting after fixing AsmParser initialization and X86 inline asm
error cleanup.

Allow errors to be deferred and emitted as part of clean up to simplify
and shorten Assembly parser code. This will allow error messages to be
emitted in helper functions and be modified by the caller which has
better context.

As part of this many minor cleanups to the Parser:

* Unify parser cleanup on error
* Add Workaround for incorrect return values in ParseDirective instances
* Tighten checks on error-signifying return values for parser functions
  and fix in-tree TargetParsers to be more consistent with the changes.
* Fix AArch64 test cases checking for spurious error messages that are
  now fixed.

These changes should be backwards compatible with current Target Parsers
so long as the error status are correctly returned in appropriate
functions.

Reviewers: rnk, majnemer

Subscribers: aemerson, jyknight, llvm-commits

Differential Revision: https://reviews.llvm.org/D24047

llvm-svn: 281762
2016-09-16 18:30:20 +00:00

111 lines
4.9 KiB
ArmAsm

// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.1a -show-encoding < %s 2> %t | FileCheck %s
// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
.text
//AdvSIMD RDMA vector
sqrdmlah v0.4h, v1.4h, v2.4h
sqrdmlsh v0.4h, v1.4h, v2.4h
sqrdmlah v0.2s, v1.2s, v2.2s
sqrdmlsh v0.2s, v1.2s, v2.2s
sqrdmlah v0.4s, v1.4s, v2.4s
sqrdmlsh v0.4s, v1.4s, v2.4s
sqrdmlah v0.8h, v1.8h, v2.8h
sqrdmlsh v0.8h, v1.8h, v2.8h
// CHECK: sqrdmlah v0.4h, v1.4h, v2.4h // encoding: [0x20,0x84,0x42,0x2e]
// CHECK: sqrdmlsh v0.4h, v1.4h, v2.4h // encoding: [0x20,0x8c,0x42,0x2e]
// CHECK: sqrdmlah v0.2s, v1.2s, v2.2s // encoding: [0x20,0x84,0x82,0x2e]
// CHECK: sqrdmlsh v0.2s, v1.2s, v2.2s // encoding: [0x20,0x8c,0x82,0x2e]
// CHECK: sqrdmlah v0.4s, v1.4s, v2.4s // encoding: [0x20,0x84,0x82,0x6e]
// CHECK: sqrdmlsh v0.4s, v1.4s, v2.4s // encoding: [0x20,0x8c,0x82,0x6e]
// CHECK: sqrdmlah v0.8h, v1.8h, v2.8h // encoding: [0x20,0x84,0x42,0x6e]
// CHECK: sqrdmlsh v0.8h, v1.8h, v2.8h // encoding: [0x20,0x8c,0x42,0x6e]
sqrdmlah v0.2h, v1.2h, v2.2h
// CHECK-ERROR: [[@LINE-1]]:12: error: invalid operand for instruction
sqrdmlsh v0.2h, v1.2h, v2.2h
// CHECK-ERROR: [[@LINE-1]]:12: error: invalid operand for instruction
sqrdmlah v0.8s, v1.8s, v2.8s
// CHECK-ERROR: [[@LINE-1]]:12: error: invalid vector kind qualifier
// CHECK-ERROR: [[@LINE-2]]:19: error: invalid vector kind qualifier
// CHECK-ERROR: [[@LINE-3]]:26: error: invalid vector kind qualifier
sqrdmlsh v0.8s, v1.8s, v2.8s
// CHECK-ERROR: [[@LINE-1]]:12: error: invalid vector kind qualifier
// CHECK-ERROR: [[@LINE-2]]:19: error: invalid vector kind qualifier
// CHECK-ERROR: [[@LINE-3]]:26: error: invalid vector kind qualifier
sqrdmlah v0.2s, v1.4h, v2.8h
// CHECK-ERROR: [[@LINE-1]]:19: error: invalid operand for instruction
sqrdmlsh v0.4s, v1.8h, v2.2s
// CHECK-ERROR: [[@LINE-1]]:19: error: invalid operand for instruction
//AdvSIMD RDMA scalar
sqrdmlah h0, h1, h2
sqrdmlsh h0, h1, h2
sqrdmlah s0, s1, s2
sqrdmlsh s0, s1, s2
// CHECK: sqrdmlah h0, h1, h2 // encoding: [0x20,0x84,0x42,0x7e]
// CHECK: sqrdmlsh h0, h1, h2 // encoding: [0x20,0x8c,0x42,0x7e]
// CHECK: sqrdmlah s0, s1, s2 // encoding: [0x20,0x84,0x82,0x7e]
// CHECK: sqrdmlsh s0, s1, s2 // encoding: [0x20,0x8c,0x82,0x7e]
//AdvSIMD RDMA vector by-element
sqrdmlah v0.4h, v1.4h, v2.h[3]
sqrdmlsh v0.4h, v1.4h, v2.h[3]
sqrdmlah v0.2s, v1.2s, v2.s[1]
sqrdmlsh v0.2s, v1.2s, v2.s[1]
sqrdmlah v0.8h, v1.8h, v2.h[3]
sqrdmlsh v0.8h, v1.8h, v2.h[3]
sqrdmlah v0.4s, v1.4s, v2.s[3]
sqrdmlsh v0.4s, v1.4s, v2.s[3]
// CHECK: sqrdmlah v0.4h, v1.4h, v2.h[3] // encoding: [0x20,0xd0,0x72,0x2f]
// CHECK: sqrdmlsh v0.4h, v1.4h, v2.h[3] // encoding: [0x20,0xf0,0x72,0x2f]
// CHECK: sqrdmlah v0.2s, v1.2s, v2.s[1] // encoding: [0x20,0xd0,0xa2,0x2f]
// CHECK: sqrdmlsh v0.2s, v1.2s, v2.s[1] // encoding: [0x20,0xf0,0xa2,0x2f]
// CHECK: sqrdmlah v0.8h, v1.8h, v2.h[3] // encoding: [0x20,0xd0,0x72,0x6f]
// CHECK: sqrdmlsh v0.8h, v1.8h, v2.h[3] // encoding: [0x20,0xf0,0x72,0x6f]
// CHECK: sqrdmlah v0.4s, v1.4s, v2.s[3] // encoding: [0x20,0xd8,0xa2,0x6f]
// CHECK: sqrdmlsh v0.4s, v1.4s, v2.s[3] // encoding: [0x20,0xf8,0xa2,0x6f]
sqrdmlah v0.4s, v1.2s, v2.s[1]
sqrdmlsh v0.2s, v1.2d, v2.s[1]
sqrdmlah v0.8h, v1.8h, v2.s[3]
sqrdmlsh v0.8h, v1.8h, v2.h[8]
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: sqrdmlah v0.4s, v1.2s, v2.s[1]
// CHECK-ERROR: ^
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: sqrdmlsh v0.2s, v1.2d, v2.s[1]
// CHECK-ERROR: ^
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: sqrdmlah v0.8h, v1.8h, v2.s[3]
// CHECK-ERROR: ^
// CHECK-ERROR: error: vector lane must be an integer in range [0, 7].
// CHECK-ERROR: sqrdmlsh v0.8h, v1.8h, v2.h[8]
// CHECK-ERROR: ^
//AdvSIMD RDMA scalar by-element
sqrdmlah h0, h1, v2.h[3]
sqrdmlsh h0, h1, v2.h[3]
sqrdmlah s0, s1, v2.s[3]
sqrdmlsh s0, s1, v2.s[3]
// CHECK: sqrdmlah h0, h1, v2.h[3] // encoding: [0x20,0xd0,0x72,0x7f]
// CHECK: sqrdmlsh h0, h1, v2.h[3] // encoding: [0x20,0xf0,0x72,0x7f]
// CHECK: sqrdmlah s0, s1, v2.s[3] // encoding: [0x20,0xd8,0xa2,0x7f]
// CHECK: sqrdmlsh s0, s1, v2.s[3] // encoding: [0x20,0xf8,0xa2,0x7f]
sqrdmlah b0, h1, v2.h[3]
sqrdmlah s0, d1, v2.s[3]
sqrdmlsh h0, h1, v2.s[3]
sqrdmlsh s0, s1, v2.s[4]
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: sqrdmlah b0, h1, v2.h[3]
// CHECK-ERROR: ^
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: sqrdmlah s0, d1, v2.s[3]
// CHECK-ERROR: ^
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: sqrdmlsh h0, h1, v2.s[3]
// CHECK-ERROR: ^
// CHECK-ERROR: error: vector lane must be an integer in range [0, 3].
// CHECK-ERROR: sqrdmlsh s0, s1, v2.s[4]
// CHECK-ERROR: ^