From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 51F1D3858CD1 for ; Wed, 20 Dec 2023 12:01:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51F1D3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 51F1D3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703073668; cv=none; b=iJVzVD2px5kRCwJfDqN68XehMERXE5qti0GEfpqMg8+Ynlq24OkKhC3rtiZn4uMUaBxo0H9rXOdPs4mkdkWzhBaoo2Bl1bcqUSuNtSz4xY0YXCr1D/JAu0Mej8zw44j96Jf320JqCMnCAp9TuXG4HknA2FD3/f4421lhXdUPPnM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703073668; c=relaxed/simple; bh=MQly+6WHZ9mimWeh+LDTgVDpELFgJL475cy56FoNVM0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=vu44m+SEoYaPeeq0T6FV3W9BwSXYj0kb6vCmFEUtd41HUllPsWF9TDPYUZWK6GpoRVk7PJpVF9eYc8EBdMJHifwybtngoDaK6ZWW/eJy1aX7m70fKQ11cTng742nd4cPcwLM2lNcJWkdkkz1/vi88bE0cpmzBjUT3BFfcl9pVjQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3367601a301so1382895f8f.2 for ; Wed, 20 Dec 2023 04:01:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1703073665; x=1703678465; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0pEKlsr24VvG5YaSTUtj2wkNV+8j/6MThkys/a+oEkI=; b=IuWGQxo4QC5ZFxNyry692oc76iFbm/0k1alTwRXxIf+oNmVoCDGS07tTH5rGxYsjm+ 7MhIs9jdlyY9E2NnavGuMam0RCheiMyS3EgK0GDeVSOkKPUMT4GK2vJbTex4kNkYV9K4 YNED5zeECf+UYnI1gqyp2HYXIa/jbK5ps/9HfzwLKwvmU5QdhFVBP2DIfuk01D7cArDH sm61Cs7V2mKoE60M4HuCc0XhAEilFLp9SxB6w/TZG0V8HLrSTJ2NzkYl8kjNodT51bIn Y75FRvqHxSlzNokYBcvhN4Z0vGzCYQpVCaqmZb0rjjgbZhkQE294Yag6QWAgCT0MW+gk Dgwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703073665; x=1703678465; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0pEKlsr24VvG5YaSTUtj2wkNV+8j/6MThkys/a+oEkI=; b=aCd3FesuJc3f/FrCSJfPqzEdAvhZTasGw1Xl8E5ixK1qQ9tQnITYFB54tr/DRCkz5n e1qe3wy+w2HYHp6tqG8B8LJv9HuSaXjxqGYvEil0GaW8xUUAjJMPyZJBqYfqzxXSFgCA EFtIJQ/x6lbqW4nzSKhUVX5hVNwswpuJRsxmjTOznSKNw2XWUxYYAY0W32Yw4Eok31wO LHfsOfu2AZuemSiHn+5t0QRqcoH2xc1+mUr1D/6lCUhQ4nZCtBrItzyjnse0em2uBYj6 CtbLyl/IucrcxFzrc2wLpd58zsOSN4qn8fVSzRuxyyiy8UaQ2ExjaZSyomsAFK3ai0ZF iYUg== X-Gm-Message-State: AOJu0YySQ7j0xkuBINtycKxON4BzBnyqgHQDTGV4zXid9iVgpB9E4SGY JdrAnA6vOa67Pj9dxcJwxNOVJGgaYCFTqpuxb10q X-Google-Smtp-Source: AGHT+IHzqZn35eDyADisSuIyxZBwXQtMWvobJtg5LOyLpvjKAAF3BSCCOLVOh58oSz/7zyl+eLVo5Q== X-Received: by 2002:a5d:4483:0:b0:336:7e37:6ab7 with SMTP id j3-20020a5d4483000000b003367e376ab7mr195103wrq.132.1703073664983; Wed, 20 Dec 2023 04:01:04 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id t15-20020a0560001a4f00b003367d48520dsm989312wry.46.2023.12.20.04.01.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Dec 2023 04:01:04 -0800 (PST) Message-ID: Date: Wed, 20 Dec 2023 13:01:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/9] Support Intel APX EGPR Content-Language: en-US To: "Cui, Lili" Cc: "Lu, Hongjiu" , "binutils@sourceware.org" References: <20231219121218.974012-1-lili.cui@intel.com> <39ccd434-387b-4560-b5f4-6a1b7fd825c9@suse.com> <37bd6a7c-7960-4d6a-ac97-870172ab65f5@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32X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xG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3026.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 20.12.2023 12:50, Cui, Lili wrote: >>>>>> On 19.12.2023 13:12, Cui, Lili wrote: >>>>>>> *** BLURB HERE *** >>>>>>> Future optimizations to be made. >>>>>>> 1. The current implementation of vexvvvvv needs to be optimized. >>>>>>> 2. The handling of double VEX/EVEX templates in check_register() >>>>>>> needs to >>>>>> be optimized. >>>>>> >>>>>> I hope this is just stale here, and the dependency on templates was >>>>>> now removed again from check_register(). >>>>> >>>>> In fact, I didn't remove it in V4, I didn't find a better place to >>>>> deal with it. I >>>> don't know if you agree with this implementation below. >>>> >>>> I'm afraid I don't, both because it still isn't clear to me what's >>>> wrong with my alternative proposal, and also for the formal reason of ... >>>> >>> >>> For the alternative proposal, do you mean adding a new variable to avoid >> introducing new loops over all operands? How about this ? or do you want to >> add other variable and handle it in check_register? >> >> No, the alternative proposal continues to be to introduce a new enumerator >> to record in i.vec_encoding (vex_encoding_egpr is what iirc I had suggested >> before, despite the naming anomaly). What you outline below would, >> however, still be better than adding another loop (as you had it earlier), imo. >> > > I guessed you want to add a new type like vex_encoding_egpr, but I don't know how to do it differently with before, when the instruction support legacy, vex and evex encodings, if we put the vex and eves templates in front of the legacy templates (in i386-opc.tbl), we'll assign the vex_encoding_egpr for the legacy input, and it will have the same problem as before. And we also need to handle it in check_register(). Maybe you hinted at some other way of handling it, but I didn't get it. > > > if (current_templates.start->opcode_modifier.vex > && current_templates.start->opcode_modifier.evex) > i.vec_encoding = vex_encoding_egpr; Since setting of the new encoding type has to happen in check_register(), using current_templates (as said several times before) is not an option. Anyway, in the interest of forward progress, feel free to go with ... >>> --- a/gas/config/tc-i386.c >>> +++ b/gas/config/tc-i386.c >>> @@ -464,6 +464,9 @@ struct _i386_insn >>> /* Have NOTRACK prefix. */ >>> const char *notrack_prefix; >>> >>> + /* Has Egpr. */ >>> + bool has_egpr; >>> + >>> /* Error message. */ >>> enum i386_error error; >>> }; >> >> As a general remark, when you add new fields to a struct, please try to find a >> slot that ideally is using existing padding _and_ is next to related fields, or at >> least one of the two. >> > > Moved to > > --- a/gas/config/tc-i386.c > +++ b/gas/config/tc-i386.c > @@ -438,6 +438,9 @@ struct _i386_insn > /* Prefer the REX2 prefix in encoding. */ > bool rex2_encoding; > > + /* Has Egpr. */ > + bool has_egpr; ... this approach then, and subsequently I'll see if I can re-arrange things (and if I'm bothered enough to do so). The comment is pretty unhelpful as is, how about "Need to use an eGPR capable encoding (REX2 or EVEX)" or some such? Jan