# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.5a --disassemble < %s | FileCheck %s
# RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=-v8.5a --disassemble < %s 2>%t | FileCheck %s --check-prefix=CHECK-NOV85
# RUN: FileCheck %s --check-prefix=CHECK-NOV85-ERROR < %t

# Flag manipulation
[0x3f,0x40,0x00,0xd5]
[0x5f,0x40,0x00,0xd5]

# CHECK: xaflag
# CHECK: axflag

# CHECK-NOV85: msr S0_0_C4_C0_1, xzr
# CHECK-NOV85: msr S0_0_C4_C0_2, xzr

# FP-to-int rounding, scalar
[0x20,0x40,0x28,0x1e]
[0x20,0x40,0x68,0x1e]
[0x62,0x40,0x29,0x1e]
[0x62,0x40,0x69,0x1e]
[0xa4,0xc0,0x28,0x1e]
[0xa4,0xc0,0x68,0x1e]
[0xe6,0xc0,0x29,0x1e]
[0xe6,0xc0,0x69,0x1e]

# CHECK: frint32z s0, s1
# CHECK: frint32z d0, d1
# CHECK: frint64z s2, s3
# CHECK: frint64z d2, d3
# CHECK: frint32x s4, s5
# CHECK: frint32x d4, d5
# CHECK: frint64x s6, s7
# CHECK: frint64x d6, d7

# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x20,0x40,0x28,0x1e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x20,0x40,0x68,0x1e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x62,0x40,0x29,0x1e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x62,0x40,0x69,0x1e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xa4,0xc0,0x28,0x1e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xa4,0xc0,0x68,0x1e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xe6,0xc0,0x29,0x1e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xe6,0xc0,0x69,0x1e]

# FP-to-int rounding, vector
[0x20,0xe8,0x21,0x0e]
[0x20,0xe8,0x61,0x4e]
[0x20,0xe8,0x21,0x4e]
[0x62,0xf8,0x21,0x0e]
[0x62,0xf8,0x61,0x4e]
[0x62,0xf8,0x21,0x4e]
[0xa4,0xe8,0x21,0x2e]
[0xa4,0xe8,0x61,0x6e]
[0xa4,0xe8,0x21,0x6e]
[0xe6,0xf8,0x21,0x2e]
[0xe6,0xf8,0x61,0x6e]
[0xe6,0xf8,0x21,0x6e]

#CHECK: frint32z v0.2s, v1.2s
#CHECK: frint32z v0.2d, v1.2d
#CHECK: frint32z v0.4s, v1.4s
#CHECK: frint64z v2.2s, v3.2s
#CHECK: frint64z v2.2d, v3.2d
#CHECK: frint64z v2.4s, v3.4s
#CHECK: frint32x v4.2s, v5.2s
#CHECK: frint32x v4.2d, v5.2d
#CHECK: frint32x v4.4s, v5.4s
#CHECK: frint64x v6.2s, v7.2s
#CHECK: frint64x v6.2d, v7.2d
#CHECK: frint64x v6.4s, v7.4s

# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x20,0xe8,0x21,0x0e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x20,0xe8,0x61,0x4e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x20,0xe8,0x21,0x4e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x62,0xf8,0x21,0x0e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x62,0xf8,0x61,0x4e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0x62,0xf8,0x21,0x4e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xa4,0xe8,0x21,0x2e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xa4,0xe8,0x61,0x6e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xa4,0xe8,0x21,0x6e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xe6,0xf8,0x21,0x2e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xe6,0xf8,0x61,0x6e]
# CHECK-NOV85-ERROR: invalid instruction encoding
# CHECK-NOV85-ERROR-NEXT: [0xe6,0xf8,0x21,0x6e]
