From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ESf0ASHBfWrPSCMAWB0awg (envelope-from ) for ; Thu, 13 Aug 2026 09:05:37 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jCIYYHzI; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0325A1E166; Thu, 13 Aug 2026 09:05:37 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8C10C1E033 for ; Thu, 13 Aug 2026 09:05:35 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 55E914BA79AF for ; Thu, 13 Aug 2026 13:05:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55E914BA79AF Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jCIYYHzI Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 1381D4BA23EC for ; Thu, 13 Aug 2026 13:05:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1381D4BA23EC Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1381D4BA23EC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786626308; cv=none; b=p7aO0aZ7AmJg75SL9u3GWsJqhQTIf7cb03Hh7/bTb2IWa0jSZk3ZBn4JzQk9lWqfwd00ajCoQC+G/mUs1DjqVoYUruVdKXv69XGhTJ+OCitcup8z42X/+0161CYH2POXhCGuFP/FrDHC3z2YIypdtlH03e26aQiMj6yO3Df9gW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786626308; c=relaxed/simple; bh=402VculERaNBEnSB9SlrW4CvfsVUXJaG57APOzALbEw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=LBrJ7c9pB0a7p95/lzIFrehjhoxKhEBVTo2njoWcCP52ObTn+jMzD6nUfFzo9g5PiLIiXedtq7Y+vtnq573e5LCaqugF7axAIRG8G2RsNdw80tF6VroeL0DKpF8cjkIPj8axgmCAqmytfzJzliygmpveehL0EjWJQGWDeoI2rPI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jCIYYHzI DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1381D4BA23EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786626307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dJ27OA1CndWXTTlB46fDPnm9WVUz2IACC0vKJ7fntSI=; b=jCIYYHzIIt3zBcaO1EKHpoqb0JxZ4z2+faNI47Fxs54tF+qI4GYhHraB8vm+b5sJr6Nhrf CoN0020Ho/HZ6kZWIpwsY1klJA5rh+f+tbA8ON0MLeMosZZ49q9t67bo2cnytZuBUlpi1x 0FagOBF5Uc21a0grYEHFgH/544SkQjM= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-lNSrQiOkPhuxvcAs9oOy4g-1; Thu, 13 Aug 2026 09:05:05 -0400 X-MC-Unique: lNSrQiOkPhuxvcAs9oOy4g-1 X-Mimecast-MFC-AGG-ID: lNSrQiOkPhuxvcAs9oOy4g_1786626304 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38f57e31b6eso689741a91.1 for ; Thu, 13 Aug 2026 06:05:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786626304; x=1787231104; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=dJ27OA1CndWXTTlB46fDPnm9WVUz2IACC0vKJ7fntSI=; b=Mhm5pLlNfGaMR4bIRx4RKLrifVrxDInoaMNQwVoB+Tr5xsVvJKHF3xdwFy7MC63IPi AbYMeWXOcWRujvmsWkm2etOS/Ge0FJz+SoW4/ORs2uc1jMjvIkVGVIzivznk0VZL5UB/ zAQ6vkSDbWJEZymkYuYdYKTVCXUCEcIF669XfmhTI4mN7yIVUYoUonRJo1l/cDbdhugF DZclDu97Clpe8NT6gFZy3t+oG7n/vMSvYLsGrBU6Uft3Fj9CFOCNqpQLQXWqpox4jZQf cal3GCCwoISKoUH7KSFjynkItVOS66PcaUT+aEuOfJZw95rdPMSFmdlHkmC4jZX1C7s7 qElg== X-Forwarded-Encrypted: i=1; AHgh+Ror0FhBiRBEOERwJG73xMDGQ+bzOFc41riJ8QmeK+GDSSaQs17rkbh6Cj0+cWmlZ75DwVJ7dyBGNHW4nA==@sourceware.org X-Gm-Message-State: AOJu0Yyy3Ano6ZHquoSUEpjUTDybGHrFHLaMOS7EkKDkGbJSLTuqa1sZ ffFGBrGHfu79f5LsuhV+ifsHf+Q5Ob9+B6VAUV+v+pQhjcBDgMCejhdWYRXTYi2FhdjYiDqukH+ OfKNw22mjbKoPnsXfVngAGc3p2K1yI+JS9cZoaN/ymrclJHaqyM2VslKOLWYoeBo= X-Gm-Gg: AR+sD13IFgt+uAgW1FhhShgAVQI324y3NfGeh/LGQrXms89O3DiepyQClV6a9QG9rYv EYJ68/x9hx2WgDD81+9YJA2ZsJBvCDZYV48jDrCM+dezVGt1A+CMs60QwHazrPgGjBZgrkP5Z5e Jn1N/o57zJS4vZpm0Qw2/NcFmblMiS61xFVt9QS/lQ3jL9/BzecRMuzy7tE46329owcIL7Cp8v1 ZhTX+qNU+sSOyRHgHbejprxdXRPC6jXqRhjBkbtvcHwSPKYO5pjkQGm0iqR2qVXqcdGfPXtwkbm lqf1FYgMsJ6TKFe7/RvsIlm+6D3Z17KMiSy+AByUroYwbOf/f2N8DhsRIKOhsYEpBiUCLEk1lxo L5akUbiSBOg== X-Received: by 2002:a17:90b:1d44:b0:37c:607b:2cd9 with SMTP id 98e67ed59e1d1-3931de20696mr6912214a91.0.1786626304221; Thu, 13 Aug 2026 06:05:04 -0700 (PDT) X-Received: by 2002:a17:90b:1d44:b0:37c:607b:2cd9 with SMTP id 98e67ed59e1d1-3931de20696mr6911990a91.0.1786626303010; Thu, 13 Aug 2026 06:05:03 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:993e::75d? ([2804:14d:8084:993e::75d]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3931f41cd2fsm3055965a91.12.2026.08.13.06.05.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Aug 2026 06:05:02 -0700 (PDT) Message-ID: <0f068fec-3d51-4e58-beb8-f8293002bdff@redhat.com> Date: Thu, 13 Aug 2026 10:04:57 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/record: avoid rax usage in i386-avx-record.exp To: "Joos, Christina" , "gdb-patches@sourceware.org" References: <20260810193232.54873-1-guinevere@redhat.com> From: Guinevere Larsen In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VXvW84_NFqKsh00pFK5qKNltehuSAjkY2FU7kscIDyA_1786626304 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 8/13/26 3:17 AM, Joos, Christina wrote: >> -----Original Message----- >> From: Joos, Christina >> Sent: Mittwoch, 12. August 2026 15:31 >> To: 'Guinevere Larsen' ; gdb- >> patches@sourceware.org >> Subject: RE: [PATCH] gdb/record: avoid rax usage in i386-avx-record.exp >> >>> -----Original Message----- >>> From: Guinevere Larsen >>> Sent: Montag, 10. August 2026 21:33 >>> To: gdb-patches@sourceware.org >>> Cc: Guinevere Larsen ; Joos, Christina >>> >>> Subject: [PATCH] gdb/record: avoid rax usage in i386-avx-record.exp >>> >>> My recent commit, 1c04308f0958cbac83bad22703758139ea6969b6: >>> >>> Author: Guinevere Larsen >>> Date: Tue Jun 16 16:03:43 2026 -0300 >>> gdb/record: add support for BMI2 instructions >>> >>> Introduced a few tests that rely on the rax register being set before >>> entering the function. This isn't reliable, as eax is almost always >>> set to 0 (except in my machine for some reason). To avoid ISAs getting >>> in the way, this commit changes the test to use r12 (and r12w/r12d >>> when appropriate), so that it won't be disturbed by the compiler. >>> >>> Reported-by: Christina Joos >>> --- >>> gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 32 +++++++++---------- >>> .../gdb.reverse/i386-avx-reverse.exp | 8 ++--- >>> 2 files changed, 20 insertions(+), 20 deletions(-) >>> >>> diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c >>> b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c >>> index 88cd3fc7f34..4d45482c07a 100644 >>> --- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c >>> +++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c >>> @@ -770,48 +770,48 @@ bmi_test () >>> { >>> /* start bmi_test. */ >>> /* Using GDB, load these values onto registers for testing. >>> - eax = 0x1312 >>> + r12 = 0x1312 >>> ebx = 0xdeadbeef >>> ecx = 0xcafeface >>> edx = 0x2337 >>> r8 = 0 >>> this way it's easy to confirm we're undoing things correctly. >>> */ >>> >>> - asm volatile ("andn %rbx, %rax, %r8"); >>> - asm volatile ("andn %ebx, %eax, %ecx"); >>> + asm volatile ("andn %rbx, %r12, %r8"); asm volatile ("andn %ebx, >>> + %r12d, %ecx"); >>> >>> asm volatile ("bextr %rcx, %r8, %rbx"); >>> asm volatile ("bextr %ebx, %ecx, %r8d"); >>> >>> - asm volatile ("blsi %rax, %rcx"); >>> + asm volatile ("blsi %r12, %rcx"); >>> asm volatile ("blsi %ebx, %r8d"); >>> >>> asm volatile ("blsmsk %r8, %rbx"); >>> - asm volatile ("blsmsk %eax, %eax"); >>> + asm volatile ("blsmsk %r12d, %r12d"); >>> >>> asm volatile ("blsr %rcx, %rbx"); >>> asm volatile ("blsr %r8d, %ecx"); >>> >>> - asm volatile ("lzcnt %rax, %r8"); >>> - asm volatile ("lzcnt %eax, %ecx"); >>> - asm volatile ("lzcnt %ax, %bx"); >>> + asm volatile ("lzcnt %r12, %r8"); >>> + asm volatile ("lzcnt %r12d, %ecx"); asm volatile ("lzcnt %r12w, >>> + %bx"); >>> >>> - asm volatile ("tzcnt %rax, %rcx"); >>> - asm volatile ("tzcnt %eax, %ebx"); >>> - asm volatile ("tzcnt %ax, %r8w"); >>> + asm volatile ("tzcnt %r12, %rcx"); >>> + asm volatile ("tzcnt %r12d, %ebx"); asm volatile ("tzcnt %r12w, >>> + %r8w"); >>> >>> - asm volatile ("mulx %eax, %ebx, %ecx"); >>> + asm volatile ("mulx %r12d, %ebx, %ecx"); >>> asm volatile ("mulx %ebx, %ecx, %ebx"); >>> >>> asm volatile ("pdep %r8, %rcx, %rbx"); >>> asm volatile ("pext %edx, %ecx, %ebx"); >>> asm volatile ("rorx $10, %r8, %rbx"); >>> - asm volatile ("sarx %edx, %ebx, %eax"); >>> - asm volatile ("shlx %eax, %ecx, %ebx"); >>> - asm volatile ("shrx %r8d, %eax, %ecx"); >>> + asm volatile ("sarx %edx, %ebx, %r12d"); asm volatile ("shlx >>> + %r12d, %ecx, %ebx"); asm volatile ("shrx %r8d, %r12d, %ecx"); >>> >>> asm volatile ("bzhi %edx, %ebx, %r8d"); >>> - asm volatile ("bzhi %rax, %rcx, %r8"); >>> + asm volatile ("bzhi %r12, %rcx, %r8"); >>> >>> return 0; /* end bmi_test */ >>> } >>> diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp >>> b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp >>> index 5d65245db39..a5b0e6612aa 100644 >>> --- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp >>> +++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp >>> @@ -1201,7 +1201,7 @@ gdb_test "finish" "Run till exit >>> from.*convert_test.*" \ gdb_test_no_output \ >>> "set \$r8 = 0" "set r8 for bmi test" >>> gdb_test_no_output \ >>> - "set \$eax = 0x1312" "set eax for bmi test" >>> + "set \$r12 = 0x1312" "set r12 for bmi test" >>> gdb_test_no_output "set \$ebx = 0xdeadbeef" "set ebx for bmi test" >>> gdb_test_no_output "set \$ecx = 0xcafeface" "set ecx for bmi test" >>> gdb_test_no_output "set \$edx = 0x2337" "set edx for bmi test" >>> @@ -1213,7 +1213,7 @@ if {[record_full_function "bmi"] == true} { >>> >>> test_one_general_register "shrx" "ecx" "0xe884173" >>> test_one_general_register "shlx" "ebx" "0x0" >>> - test_one_general_register "sarx" "eax" "0x3" >>> + test_one_general_register "sarx" "r12" "0x3" >>> test_one_general_register "rorx" "ebx" "0x3b" >>> test_one_general_register "pext" "ebx" "0x0" >>> test_one_general_register "pdep" "ebx" "0x0" >>> @@ -1232,13 +1232,13 @@ if {[record_full_function "bmi"] == true} { >>> test_one_general_register "blsr" "ecx" "0x2" >>> test_one_general_register "blsr" "ebx" "0xffffffff" >>> >>> - test_one_general_register "blsmsk" "eax" "0x1312" >>> + test_one_general_register "blsmsk" "r12" "0x1312" >>> test_one_general_register "blsmsk" "ebx" "0x0" >>> >>> test_one_general_register "blsi" "r8" "0x0" >>> test_one_general_register "blsi" "ecx" "0xdeadaced" >>> >>> - test_one_general_register "bextr" "eax" "0x1312" >>> + test_one_general_register "bextr" "r12" "0x1312" >>> test_one_general_register "bextr" "ebx" "0xdeadbeef" >>> >>> test_one_general_register "andn" "ecx" "0xcafeface" >>> >>> base-commit: a80fede20bc1330eca5e419392c6595bb3a6ac1d >>> -- >>> 2.55.0 >> Hi Guinevere, >> >> Thank you for this patch. >> My machine has been updated recently to Ubuntu 26.04 and now the test >> passes also for me (without your patch). >> Reason is that I now use a newer gcc version (gcc-15) by default. >> >> Using gcc-14 it still fails, so maybe it would make sense to mention that in the >> commit message. >> >> I still think using callee saved registers in the entire test would be better, also to >> avoid future mistakes. >> But since it's now passing again, I guess this is also fine. >> >> So with that fixed: > This comment might not be so clear about "that", so to clarify: > > With a comment about the compiler in the commit message. > > Reviewed-by: Christina Joos Oh, thanks for double checking the compiler version, and the quick review! I'll send a v2 to the list soon. -- Cheers, Guinevere Larsen it/its she/her (deprecated) > Kind Regards, > Christina > ________________________________________ > Intel Deutschland GmbH > > Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany > > Tel: +49 (89) 99143-0 > > www.intel.de > > Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman > > Chairperson of the Supervisory Board: Sonja Pierer > > Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. >