From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79802 invoked by alias); 1 May 2019 17:17:42 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 79794 invoked by uid 89); 1 May 2019 17:17:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LOTSOFHASH,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 May 2019 17:17:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A9E8C80D for ; Wed, 1 May 2019 10:17:39 -0700 (PDT) Received: from [10.2.207.62] (e107157-lin.cambridge.arm.com [10.2.207.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 542663F719 for ; Wed, 1 May 2019 10:17:39 -0700 (PDT) Subject: [PATCH 26/57][Arm][GAS] Add support for MVE instructions: vpnot and vpsel To: binutils@sourceware.org References: <19569550-4d2e-0bb3-592a-d91050d490f6@arm.com> From: "Andre Vieira (lists)" Message-ID: Date: Wed, 01 May 2019 17:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <19569550-4d2e-0bb3-592a-d91050d490f6@arm.com> Content-Type: multipart/mixed; boundary="------------A25EB2738DAB077E48ACC6AA" X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00055.txt.bz2 This is a multi-part message in MIME format. --------------A25EB2738DAB077E48ACC6AA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 566 Hi, This patch adds support for MVE instructions VPNOT and VPSEL. gas/ChangeLog: 2019-05-01 Andre Vieira * config/tc-arm.c (do_mve_vpsel): New encoding function. (do_mve_vpnot): Likewise. (insns): Add entries for MVE mnemonics. * testsuite/gas/arm/mve-vpnot-bad.d: New test. * testsuite/gas/arm/mve-vpnot-bad.l: New test. * testsuite/gas/arm/mve-vpnot-bad.s: New test. * testsuite/gas/arm/mve-vpsel-bad.d: New test. * testsuite/gas/arm/mve-vpsel-bad.l: New test. * testsuite/gas/arm/mve-vpsel-bad.s: New test. --------------A25EB2738DAB077E48ACC6AA Content-Type: text/x-patch; name="26.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="26.patch" Content-length: 5329 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 4615f10246ca227257d76962a0e86557d9d9186f..b5c263688134bcd733c5ba8f93fe003268859abd 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -15734,6 +15734,34 @@ do_mve_vmlas (void) inst.is_neon = 1; } +static void +do_mve_vpsel (void) +{ + neon_select_shape (NS_QQQ, NS_NULL); + + if (inst.cond > COND_ALWAYS) + inst.pred_insn_type = INSIDE_VPT_INSN; + else + inst.pred_insn_type = MVE_OUTSIDE_PRED_INSN; + + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.is_neon = 1; +} + +static void +do_mve_vpnot (void) +{ + if (inst.cond > COND_ALWAYS) + inst.pred_insn_type = INSIDE_VPT_INSN; + else + inst.pred_insn_type = MVE_OUTSIDE_PRED_INSN; +} + static void do_mve_vmaxnma_vminnma (void) { @@ -24715,6 +24743,8 @@ static const struct asm_opcode insns[] = mToC("vmlas", ee011e40, 3, (RMQ, RMQ, RR), mve_vmlas), mToC("vmulh", ee010e01, 3, (RMQ, RMQ, RMQ), mve_vmulh), mToC("vrmulh", ee011e01, 3, (RMQ, RMQ, RMQ), mve_vmulh), + mToC("vpnot", fe310f4d, 0, (), mve_vpnot), + mToC("vpsel", fe310f01, 3, (RMQ, RMQ, RMQ), mve_vpsel), #undef THUMB_VARIANT #define THUMB_VARIANT & mve_fp_ext diff --git a/gas/testsuite/gas/arm/mve-vpnot-bad.d b/gas/testsuite/gas/arm/mve-vpnot-bad.d new file mode 100644 index 0000000000000000000000000000000000000000..6aab2c47c1ddf3102ed172efad8d70c2fe98a4f8 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpnot-bad.d @@ -0,0 +1,5 @@ +#name: bad MVE VPNOT instructions +#as: -march=armv8.1-m.main+mve.fp +#error_output: mve-vpnot-bad.l + +.*: +file format .*arm.* diff --git a/gas/testsuite/gas/arm/mve-vpnot-bad.l b/gas/testsuite/gas/arm/mve-vpnot-bad.l new file mode 100644 index 0000000000000000000000000000000000000000..2ba96c6ddda767f039586f6117243dce78fc2bad --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpnot-bad.l @@ -0,0 +1,12 @@ +[^:]*: Assembler messages: +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:12: Error: syntax error -- `vpnoteq' +[^:]*:13: Error: syntax error -- `vpnoteq' +[^:]*:15: Error: syntax error -- `vpnoteq' +[^:]*:16: Error: vector predicated instruction should be in VPT/VPST block -- `vpnott' +[^:]*:18: Error: instruction missing MVE vector predication code -- `vpnot' diff --git a/gas/testsuite/gas/arm/mve-vpnot-bad.s b/gas/testsuite/gas/arm/mve-vpnot-bad.s new file mode 100644 index 0000000000000000000000000000000000000000..3588f60bda8db2327ce55220072cd8a6836423bd --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpnot-bad.s @@ -0,0 +1,18 @@ +.macro cond +.irp cond, eq, ne, gt, ge, lt, le +it \cond +vpnot +.endr +.endm + +.syntax unified +.thumb +cond +it eq +vpnoteq +vpnoteq +vpst +vpnoteq +vpnott +vpst +vpnot diff --git a/gas/testsuite/gas/arm/mve-vpsel-bad.d b/gas/testsuite/gas/arm/mve-vpsel-bad.d new file mode 100644 index 0000000000000000000000000000000000000000..b8a602a6b1d03bf87765d09d382ccc20288d7c84 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpsel-bad.d @@ -0,0 +1,5 @@ +#name: bad MVE VPSEL instructions +#as: -march=armv8.1-m.main+mve.fp +#error_output: mve-vpsel-bad.l + +.*: +file format .*arm.* diff --git a/gas/testsuite/gas/arm/mve-vpsel-bad.l b/gas/testsuite/gas/arm/mve-vpsel-bad.l new file mode 100644 index 0000000000000000000000000000000000000000..d2b2890d287669ace51675d20797f27cf7708eac --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpsel-bad.l @@ -0,0 +1,12 @@ +[^:]*: Assembler messages: +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:12: Error: syntax error -- `vpseleq.i16 q0,q1,q2' +[^:]*:13: Error: syntax error -- `vpseleq.i16 q0,q1,q2' +[^:]*:15: Error: syntax error -- `vpseleq.i16 q0,q1,q2' +[^:]*:16: Error: vector predicated instruction should be in VPT/VPST block -- `vpselt.i16 q0,q1,q2' +[^:]*:18: Error: instruction missing MVE vector predication code -- `vpsel.i16 q0,q1,q2' diff --git a/gas/testsuite/gas/arm/mve-vpsel-bad.s b/gas/testsuite/gas/arm/mve-vpsel-bad.s new file mode 100644 index 0000000000000000000000000000000000000000..fc14fdc3d316c2869c3fe8b0295a05dbbc22f664 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpsel-bad.s @@ -0,0 +1,19 @@ +.macro cond +.irp cond, eq, ne, gt, ge, lt, le +it \cond +vpsel.i16 q0, q1, q2 +.endr +.endm + +.syntax unified +.thumb +cond +it eq +vpseleq.i16 q0, q1, q2 +vpseleq.i16 q0, q1, q2 +vpst +vpseleq.i16 q0, q1, q2 +vpselt.i16 q0, q1, q2 +vpst +vpsel.i16 q0, q1, q2 + --------------A25EB2738DAB077E48ACC6AA--