From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 982493858C74 for ; Thu, 8 Sep 2022 18:35:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 982493858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x629.google.com with SMTP id fy31so40105271ejc.6 for ; Thu, 08 Sep 2022 11:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=bKM6MUsJyDQoc5n7wnRabiXEvagjp3feFnk0cCeMNFw=; b=ZjdRIBUpMQPTcwcd4mtWcVRhZNWAZkMpmjWn5K2oxopQue4bLlvqlUckUi2vmERJH3 VZagmA6IwsqpgYPKCbrxUMLGbm/zOTawdZbmJpYlRKaqqx3Dz4x2OgGEs0Wok2Ym22xy +mNxJD/T9SSHfPN6rUARVvo+ZGCsHkVi609n1CKIcKa6BlIbYkzADHuGxTbkmL4lHqpq /N/uZH1eLi1d5oozGo54ca/9YIWK33AtZTK/uwajLzZLroibbk9O9qU8OAG+YcyF96Sj u5wt1O/tzsAN0Wq9A4gjoDAnafQ3lVBzLUCUzlUewE3KnQuQXSj6JJCMIPUUZogKu/8Q mruA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=bKM6MUsJyDQoc5n7wnRabiXEvagjp3feFnk0cCeMNFw=; b=327EESE9TxrNy2Oe1iAQ423+2saUCRJWMaBGLmS6p2bUYZ59j7uiyOUtNuCyK9RVCr 0QIS01TM33Qi+tg26nfyreIJ52y32cNmRWN4jR5P82wpn7KSAg3f3uKxDRljagAp8Hca 1qCTWC+xGuxcInfzO4TBrSB1pJldDs4gTKZ4ROsdXhWsrsKKVwsQ3A5ZXCQni+IvM7i8 8xO6i0vmtrSGrnk9m7S5iD4CKsRoNajOSKu2RXsEm0Nyztt9/pIMHjaAdoInKTcW2OB9 cSfyCCiU8gtj2Ubg0rnvXWKA+i455v/dFDfYOZfruUyAJk6rCBntPr+uzKJ4K5XU+FXZ JRGw== X-Gm-Message-State: ACgBeo3ZICQHqZ+CWywIKLEuxcEuuc9pN9IgTKEyv1VAEsj0OaoN0tl5 mjUtYeZWpPQEpxGwKDfxtbbWcSlz8GKHpIN3JIzFfXHm X-Google-Smtp-Source: AA6agR7Req7DJvPeYdMwL4Gt03O2OPXsjK0JIMWoC/pr0TBuc8l/u592FNQgoFsB45zWsZLHyO1KxqoMKoUQG6R4YvU= X-Received: by 2002:a17:907:7b94:b0:731:1b11:c241 with SMTP id ne20-20020a1709077b9400b007311b11c241mr7132993ejc.676.1662662109054; Thu, 08 Sep 2022 11:35:09 -0700 (PDT) MIME-Version: 1.0 References: <20220908182530.118842-1-ghostmansd@gmail.com> In-Reply-To: <20220908182530.118842-1-ghostmansd@gmail.com> From: Dmitry Selyutin Date: Thu, 8 Sep 2022 21:34:32 +0300 Message-ID: Subject: Re: [PATCH] ppc/svp64: support svshape2 instruction To: binutils@sourceware.org Cc: Alan Modra , Luke Kenneth Casson Leighton Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Sep 8, 2022 at 9:26 PM Dmitry Selyutin wrote: > + * 0b1000 and 0b1001 values are reserved for svshape2. > + { 0xf, 7, insert_SVrm, extract_SVrm, 0 }, > const unsigned int num_powerpc_operands = (sizeof (powerpc_operands) > @@ -4759,6 +4824,13 @@ const unsigned int num_powerpc_operands = (sizeof (powerpc_operands) > | (((uint64_t)(xop)) & 0x3f)) > #define SVM_MASK SVM (0x3f, 0x3f) > > +/* An SVM2 form instruction. */ > +#define SVM2(op, xop) \ > + (OP (op) \ > + | (((((uint64_t)(xop)) >> 6) & 0x7) << 8) \ > + | (((uint64_t)(xop)) & 0x3f)) > +#define SVM2_MASK SVM2 (0x3f, 0x1ff) > > +{"svshape2", SVM2(22,281), SVM2_MASK, SVP64, PPCVLE, {SVo, yx10, rmm, SVd, sk, mm}}, > {"svshape", SVM(22,25), SVM_MASK, SVP64, PPCVLE, {SVxd, SVyd, SVzd, SVrm, vf}}, This is a tricky part. svshape2 shares some of its bits with svshape; we reserve 0b1000 and 0b1001 values from svshape for svshape2. I didn't find a clear way to express it other than custom callback and powerpc_opcodes insertion order. The order is significant; if svshape2 ends up after svshape, things break, due to the fact that svshape opcode starts performing a loose match. Any ideas on how to refactor or improve it are more than desired. -- Best regards, Dmitry Selyutin