From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by server2.sourceware.org (Postfix) with ESMTPS id 777003940CDD for ; Mon, 9 Mar 2020 09:19:07 +0000 (GMT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 46C31ADDD; Mon, 9 Mar 2020 09:19:06 +0000 (UTC) Subject: Re: [PATCH 1/6] x86: allow opcode templates to be templated To: "H.J. Lu" Cc: "binutils@sourceware.org" References: <17ee93b3-33ea-5c10-23b2-408c7fb5b5a2@suse.com> From: Jan Beulich Message-ID: Date: Mon, 9 Mar 2020 10:19:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2020 09:19:08 -0000 On 06.03.2020 15:42, H.J. Lu wrote: > On Fri, Mar 6, 2020 at 12:11 AM Jan Beulich wrote: >> >> In order to reduce redundancy as well as the chance of things going out >> of sync (see a later patch for an example), make the opcode table >> generator capable of recognizing and expanding templated templates. Use >> the new capability for compacting the general purpose conditional insns. >> >> opcodes/ >> 2020-03-XX Jan Beulich >> >> * i386-gen.c (struct template_arg, struct template_instance, >> struct template_param, struct template, templates, >> parse_template, expand_templates): New. >> (process_i386_opcodes): Various local variables moved to >> expand_templates. Call parse_template and expand_templates. >> * i386-opc.tbl (cc): New. Use it for Jcc, SETcc, and CMOVcc. >> * i386-tbl.h: Re-generate. > > OK. Thanks. Now that this is in, a question I have is how far we want to go with using this templating. There are certainly more groups of insns which are sufficiently similar, but I guess using templates for just two or three insns wouldn't be helpful readability wise. An example of where I'm on the edge are the {,V}PCLMUL pseudos. Do you have any thoughts on the general question, or is it entirely up to me to decide where else to use this new functionality? Jan