From 2527bdac885f5822bb2b9a805fc9d80b35dd8f8b Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sun, 1 Dec 2013 03:05:13 +0000 Subject: Merging r195788: ------------------------------------------------------------------------ r195788 | mcrosier | 2013-11-26 14:17:37 -0800 (Tue, 26 Nov 2013) | 2 lines [AArch64] Add support for NEON scalar floating-point to integer convert instructions. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195993 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/AArch64/neon-diagnostics.s | 160 +++++++++++++++++++++ test/MC/AArch64/neon-scalar-cvt.s | 118 +++++++++++++++ test/MC/Disassembler/AArch64/neon-instructions.txt | 99 +++++++++++++ 3 files changed, 377 insertions(+) (limited to 'test/MC') diff --git a/test/MC/AArch64/neon-diagnostics.s b/test/MC/AArch64/neon-diagnostics.s index 74719e0..7bc76a0 100644 --- a/test/MC/AArch64/neon-diagnostics.s +++ b/test/MC/AArch64/neon-diagnostics.s @@ -7141,3 +7141,163 @@ // CHECK-ERROR: error: invalid number of vectors // CHECK-ERROR: tbx v0.8b, {v1.16b, v2.16b, v3.16b, v4.16b, v5.16b}, v2.8b // CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Lower Precision Narrow, Rounding To +// Odd +//---------------------------------------------------------------------- + + fcvtxn s0, s1 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtxn s0, s1 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding To Nearest +// With Ties To Away +//---------------------------------------------------------------------- + + fcvtas s0, d0 + fcvtas d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtas s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtas d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding To +// Nearest With Ties To Away +//---------------------------------------------------------------------- + + fcvtau s0, d0 + fcvtau d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtau s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtau d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding Toward +// Minus Infinity +//---------------------------------------------------------------------- + + fcvtms s0, d0 + fcvtms d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtms s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtms d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +// Minus Infinity +//---------------------------------------------------------------------- + + fcvtmu s0, d0 + fcvtmu d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtmu s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtmu d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding To Nearest +// With Ties To Even +//---------------------------------------------------------------------- + + fcvtns s0, d0 + fcvtns d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtns s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtns d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding To +// Nearest With Ties To Even +//---------------------------------------------------------------------- + + fcvtnu s0, d0 + fcvtnu d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtnu s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtnu d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding Toward +// Positive Infinity +//---------------------------------------------------------------------- + + fcvtps s0, d0 + fcvtps d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtps s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtps d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +// Positive Infinity +//---------------------------------------------------------------------- + + fcvtpu s0, d0 + fcvtpu d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtpu s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtpu d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding Toward Zero +//---------------------------------------------------------------------- + + fcvtzs s0, d0 + fcvtzs d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtzs s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtzs d0, s0 +// CHECK-ERROR: ^ + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +// Zero +//---------------------------------------------------------------------- + + fcvtzu s0, d0 + fcvtzu d0, s0 + +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtzu s0, d0 +// CHECK-ERROR: ^ +// CHECK-ERROR: error: invalid operand for instruction +// CHECK-ERROR: fcvtzu d0, s0 +// CHECK-ERROR: ^ diff --git a/test/MC/AArch64/neon-scalar-cvt.s b/test/MC/AArch64/neon-scalar-cvt.s index 5477409..97416da 100644 --- a/test/MC/AArch64/neon-scalar-cvt.s +++ b/test/MC/AArch64/neon-scalar-cvt.s @@ -61,3 +61,121 @@ // CHECK: fcvtzu s21, s12, #1 // encoding: [0x95,0xfd,0x3f,0x7f] // CHECK: fcvtzu d21, d12, #1 // encoding: [0x95,0xfd,0x7f,0x7f] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Lower Precision Narrow, Rounding To +// Odd +//---------------------------------------------------------------------- + + fcvtxn s22, d13 + +// CHECK: fcvtxn s22, d13 // encoding: [0xb6,0x69,0x61,0x7e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding To Nearest +// With Ties To Away +//---------------------------------------------------------------------- + + fcvtas s12, s13 + fcvtas d21, d14 + +// CHECK: fcvtas s12, s13 // encoding: [0xac,0xc9,0x21,0x5e] +// CHECK: fcvtas d21, d14 // encoding: [0xd5,0xc9,0x61,0x5e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding To +// Nearest With Ties To Away +//---------------------------------------------------------------------- + + fcvtau s12, s13 + fcvtau d21, d14 + +// CHECK: fcvtau s12, s13 // encoding: [0xac,0xc9,0x21,0x7e] +// CHECK: fcvtau d21, d14 // encoding: [0xd5,0xc9,0x61,0x7e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding Toward +// Minus Infinity +//---------------------------------------------------------------------- + + fcvtms s22, s13 + fcvtms d21, d14 + +// CHECK: fcvtms s22, s13 // encoding: [0xb6,0xb9,0x21,0x5e] +// CHECK: fcvtms d21, d14 // encoding: [0xd5,0xb9,0x61,0x5e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +// Minus Infinity +//---------------------------------------------------------------------- + + fcvtmu s12, s13 + fcvtmu d21, d14 + +// CHECK: fcvtmu s12, s13 // encoding: [0xac,0xb9,0x21,0x7e] +// CHECK: fcvtmu d21, d14 // encoding: [0xd5,0xb9,0x61,0x7e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding To Nearest +// With Ties To Even +//---------------------------------------------------------------------- + + fcvtns s22, s13 + fcvtns d21, d14 + +// CHECK: fcvtns s22, s13 // encoding: [0xb6,0xa9,0x21,0x5e] +// CHECK: fcvtns d21, d14 // encoding: [0xd5,0xa9,0x61,0x5e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding To +// Nearest With Ties To Even +//---------------------------------------------------------------------- + + fcvtnu s12, s13 + fcvtnu d21, d14 + +// CHECK: fcvtnu s12, s13 // encoding: [0xac,0xa9,0x21,0x7e] +// CHECK: fcvtnu d21, d14 // encoding: [0xd5,0xa9,0x61,0x7e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding Toward +// Positive Infinity +//---------------------------------------------------------------------- + + fcvtps s22, s13 + fcvtps d21, d14 + +// CHECK: fcvtps s22, s13 // encoding: [0xb6,0xa9,0xa1,0x5e] +// CHECK: fcvtps d21, d14 // encoding: [0xd5,0xa9,0xe1,0x5e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +// Positive Infinity +//---------------------------------------------------------------------- + + fcvtpu s12, s13 + fcvtpu d21, d14 + +// CHECK: fcvtpu s12, s13 // encoding: [0xac,0xa9,0xa1,0x7e] +// CHECK: fcvtpu d21, d14 // encoding: [0xd5,0xa9,0xe1,0x7e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Signed Integer, Rounding Toward Zero +//---------------------------------------------------------------------- + + fcvtzs s12, s13 + fcvtzs d21, d14 + +// CHECK: fcvtzs s12, s13 // encoding: [0xac,0xb9,0xa1,0x5e] +// CHECK: fcvtzs d21, d14 // encoding: [0xd5,0xb9,0xe1,0x5e] + +//---------------------------------------------------------------------- +// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +// Zero +//---------------------------------------------------------------------- + + fcvtzu s12, s13 + fcvtzu d21, d14 + +// CHECK: fcvtzu s12, s13 // encoding: [0xac,0xb9,0xa1,0x7e] +// CHECK: fcvtzu d21, d14 // encoding: [0xd5,0xb9,0xe1,0x7e] diff --git a/test/MC/Disassembler/AArch64/neon-instructions.txt b/test/MC/Disassembler/AArch64/neon-instructions.txt index 0397480..3ed228a 100644 --- a/test/MC/Disassembler/AArch64/neon-instructions.txt +++ b/test/MC/Disassembler/AArch64/neon-instructions.txt @@ -2510,3 +2510,102 @@ # CHECK: tbx v0.16b, {v1.16b, v2.16b, v3.16b}, v2.16b # CHECK: tbx v16.16b, {v31.16b, v0.16b, v1.16b, v2.16b}, v2.16b +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Lower Precision Narrow, Rounding To +# Odd +#---------------------------------------------------------------------- +# CHECK: fcvtxn s22, d13 +0xb6,0x69,0x61,0x7e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Signed Integer, Rounding To Nearest +# With Ties To Away +#---------------------------------------------------------------------- +# CHECK: fcvtas s12, s13 +# CHECK: fcvtas d21, d14 + +0xac,0xc9,0x21,0x5e +0xd5,0xc9,0x61,0x5e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Unsigned Integer, Rounding To +# Nearest With Ties To Away +#---------------------------------------------------------------------- +# CHECK: fcvtau s12, s13 +# CHECK: fcvtau d21, d14 +0xac,0xc9,0x21,0x7e +0xd5,0xc9,0x61,0x7e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Signed Integer, Rounding Toward +# Minus Infinity +#---------------------------------------------------------------------- +# CHECK: fcvtms s22, s13 +# CHECK: fcvtms d21, d14 +0xb6,0xb9,0x21,0x5e +0xd5,0xb9,0x61,0x5e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +# Minus Infinity +#---------------------------------------------------------------------- +# CHECK: fcvtmu s12, s13 +# CHECK: fcvtmu d21, d14 +0xac,0xb9,0x21,0x7e +0xd5,0xb9,0x61,0x7e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Signed Integer, Rounding To Nearest +# With Ties To Even +#---------------------------------------------------------------------- + +# CHECK: fcvtns s22, s13 +# CHECK: fcvtns d21, d14 + +0xb6,0xa9,0x21,0x5e +0xd5,0xa9,0x61,0x5e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Unsigned Integer, Rounding To +# Nearest With Ties To Even +#---------------------------------------------------------------------- + +# CHECK: fcvtnu s12, s13 +# CHECK: fcvtnu d21, d14 +0xac,0xa9,0x21,0x7e +0xd5,0xa9,0x61,0x7e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Signed Integer, Rounding Toward +# Positive Infinity +#---------------------------------------------------------------------- +# CHECK: fcvtps s22, s13 +# CHECK: fcvtps d21, d14 +0xb6,0xa9,0xa1,0x5e +0xd5,0xa9,0xe1,0x5e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +# Positive Infinity +#---------------------------------------------------------------------- +# CHECK: fcvtpu s12, s13 +# CHECK: fcvtpu d21, d14 +0xac,0xa9,0xa1,0x7e +0xd5,0xa9,0xe1,0x7e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Signed Integer, Rounding Toward Zero +#---------------------------------------------------------------------- +# CHECK: fcvtzs s12, s13 +# CHECK: fcvtzs d21, d14 +0xac,0xb9,0xa1,0x5e +0xd5,0xb9,0xe1,0x5e + +#---------------------------------------------------------------------- +# Scalar Floating-point Convert To Unsigned Integer, Rounding Toward +# Zero +#---------------------------------------------------------------------- +# CHECK: fcvtzu s12, s13 +# CHECK: fcvtzu d21, d14 +0xac,0xb9,0xa1,0x7e +0xd5,0xb9,0xe1,0x7e -- cgit v1.1