From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 1B8E53857013 for ; Tue, 12 Dec 2023 14:04:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B8E53857013 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 1B8E53857013 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702389907; cv=none; b=COzLa3QpKc3IAG67Aoicf9DZkFV3F7h2rdfe62RoHhbSNuSYRIHmcMdGanD/o9omWyXOlSF1Ks50O5bJ5Z+x8AipmVThpJYfnUcm5J1nIxgehL5L7n1r6nrfMD4MT9635jWRbQMEFjR9FCQSymyssd2R6H+vk0BMUDIxGORGw40= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702389907; c=relaxed/simple; bh=WZZyuhVcOcKm4FlOSCv86hvyw9eA5RFL+7Oi5oDrcto=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=B1FTtTOazk3Iy6l4VO5GaOhdBohHC7zIsE4R29zK7WtnnjlGp3OvkgXYG9mLobFACqBsvUDh9N7PKJRNZH9uNscam3kgUZM92BnI3tUj8DEgnOR6n5SMRjgIgK8Mp6B5SkcA5Ukm+mOLyfFWCKuiguyZjsENC1xBF3gkg5oR8e8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3362216835eso1624213f8f.3 for ; Tue, 12 Dec 2023 06:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1702389896; x=1702994696; 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=z7+31gbS60aHV7RLq87LSBnz1Xq1tp/S+y23pqYjVHo=; b=gr5s2GRTKeDoV76760SPTEMeho7k2T0oP1XN2Hb9LUcFKTPyBlFa17IEoqlzzxw7eO b2jUvc3v9O7IBARSPAe2BWLQxgefwVs51vvR+HJvvyzwtDCORhClNBF4Gz6TUbG0m2hy C5zkq1LWpnu9+mG07iKieFVgO3hgFYi0cWEeC+hVEGU/h5JT2V/py4o3VNK2tFr30nOf ejO/VTn4IbMBcIYDctUse9FypVG4IDFnzFO1fXyZlRjZE5Tz/R6lImpcRjGt5/qvQaXt +4Exu3q3SnogqkbM4HKfwX+p0mHqFdfcqGkHiAJseL0mUPxUQFYhJqXao/+kuUDQmj5G d08A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702389896; x=1702994696; 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=z7+31gbS60aHV7RLq87LSBnz1Xq1tp/S+y23pqYjVHo=; b=djtAMkqAwDiaZvOapY5HylHjOHNo7jVI/s6bn6tdy+yrNjPomJNltGHR2wc64QuwG6 o4L1N5Pt/F0w7GBPb4FvfGl04jASyMp9rhG1cL5NZJ0rtbgRt7wqT+thKGuBT297FhiT jp5Y5IS156hxhbnSEtwZav1/veu03zOA3AsttPi4Sk9Tp9L2FCXC4XU0fNQcUapyIMnZ PX/Py6nihGZRYaRd+ypl2LM+MLBbvBk5mbnVwdFKruLS0JIkZqJr7jto2idweIJYPdIq c+Lj9O1cI452Vn6vVZQ/vBgrUD2SAEC1HjzLvwOBrkj61YiSIxd+VdZ2tX3u64fS7GPB Woow== X-Gm-Message-State: AOJu0Yw/Nq1Q2JIgvqVw65JWNaJfovIZSeKfpYSmf6kMuiKA60xoUdeS kHXI7BcaBXKdxnsPc8HjoIYIX41lZVLGEP3Ys3px X-Google-Smtp-Source: AGHT+IGc1cd1MgyO875r1FGPoMZh7JYfmtivn3xQxQFEPVCAIiohyruoMI3DEE3fG2EjDJlLwaVJQQ== X-Received: by 2002:adf:e94a:0:b0:336:3510:61fb with SMTP id m10-20020adfe94a000000b00336351061fbmr378625wrn.55.1702389895791; Tue, 12 Dec 2023 06:04:55 -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 z4-20020adff1c4000000b003333af25cb2sm10891759wro.66.2023.12.12.06.04.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Dec 2023 06:04:55 -0800 (PST) Message-ID: Date: Tue, 12 Dec 2023 15:04:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/9] Support APX GPR32 with extend evex prefix Content-Language: en-US To: "Cui, Lili" Cc: "Lu, Hongjiu" , "binutils@sourceware.org" References: <20231124070213.3886483-1-lili.cui@intel.com> <20231124070213.3886483-4-lili.cui@intel.com> <546c8890-0526-49a3-8310-319358bf55c2@suse.com> <0bb5fbcd-f58e-48ad-a5ee-3413b026f903@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0u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QGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+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.4 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 12.12.2023 13:58, Cui, Lili wrote: >> >>>>> @@ -14233,6 +14276,12 @@ static bool check_register (const reg_entry >>>> *r) >>>>> if (!cpu_arch_flags.bitfield.cpuapx_f >>>>> || flag_code != CODE_64BIT) >>>>> return false; >>>>> + >>>>> + /* When using RegRex2, dual VEX/EVEX templates need to be >>>>> + marked as >>>> EVEX. >>>>> + For the later install_template function. */ >>>>> + if (current_templates->start->opcode_modifier.vex >>>>> + && current_templates->start->opcode_modifier.evex) >>>>> + i.vec_encoding = vex_encoding_evex; >>>> >>>> I'm afraid I don't understand the 2nd sentence of the comment. This >>>> may be related to my question regarding cpu_flags_match() further up. >>>> >>>> The first sentence isn't quite correct either - you don't mark any >>>> template here (and you can't, because we don't even know yet which >>>> template we're going to use). >>>> >>>> Finally - do you really need the .evex check here? (I won't exclude >>>> that this yields a better diagnostic in certain cases, but this wants >>>> clarifying if so.) >>>> >>> >>> If you look at install_template(), you'll see that before this function we >> need to know if the current encoding is evex. >> >> "This function" being check_register()? If so, then no, we can't know up front >> whether EVEX encoding is going to be needed, as operand parsing happens >> ahead of template selection. If instead you mean "that function" and hence >> install_template(), then yes, we need to know whether to use EVEX there. >> Yet how does that result in a need for the .evex check here? (Or maybe your >> reply was really to the first of the three parts of my earlier one?) >> > > Agree with you, put them here is unreasonable. > > For example > > vtestps (%r27),%ymm6 > > we should report unsupported Egpr. But without .evex check, it will report "Error: no EVEX encoding for `vtestps'" > >> But anyway - as said earlier on, using current_templates here looks wrong in >> the first place. check_register() deals with only a register, without regard to >> the context it is used in (with the sole exception of allow_pseudo_reg). >> May I remind you that earlier on I already indicated that I suspect you'll need >> a new enumerator to put in i.vec_encoding for this new purpose? >> > > If we don't put it in check_register(), we need to add a for loop at the beginning of the install_template() to check RegRex2. Do you think it is okay? Or create a function for it. > > for (unsigned int op = 0; op < i.operands; op++) > { > if (i.types[op].bitfield.class != Reg) > continue; > > if (i.op[op].regs->reg_flags & RegRex2) > i.vec_encoding = vex_encoding_evex; > } > > if ((i.index_reg && (i.index_reg->reg_flags & RegRex2)) > || (i.base_reg && (i.base_reg->reg_flags & RegRex2))) > i.vec_encoding = vex_encoding_evex; As a last resort this may be an option. But until my suggestion wasn't at least tried or demonstrated to be worse, I don't think the above would be acceptable. Jan