[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86emul: work around gcc11 bug in SIMD tests


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 11 Feb 2022 12:01:53 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mqWSMNbinB3HFih3Xj9/43lf1h0NXWDh3BWfNe5x+o4=; b=kQPseOy+aw39XEg1OStGpwD7fEUNggyfEa97Sh0s2LB/LZoGdV66dgRHNwSJqkFRSn44oQtLMrNkYU2G9oV35QmuJ8qH/Tx1JfhfjNXmC/N1hBwiaxF+JSU0I1Dhd/mRwSBYV77ePd8PtuHkCCFLKYi2zE+Q493O/kRmbm3QlAOKGLlvZcjyGcZzCR3I9IXEdavYOv+BCAo7+eD+AqC54pe53qmeRv5Iu4P+ZbQf7vgY6+HsZnvTllgVsIOlT0RLNvQVVkRAOutG8OCEfwgSFKp8PiBaMj4mD9JGkmhmA5HMT6XlDj7sqqnwy7dcQk8xagB0AD+9tGbfQr2DlDbXHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JatLgsb8IHwjgL+vPOvP+Xse7if746rP0tX4BcPM9YOXXcVdDRUgG3EhDTt3ML9GDATpwJonbDZKwjJqLRjx7pDF9Kr4dK9CCFw7PgV3TD0epKEerg9Ii6Aiu9d7iXT6P9QTo8SBge62akkFsYr6PtazoEalTrF6GGtUzcF1WMZzupI8Wu2kTeuPqIM9sqvXa/2Rfp93IezAKEBdbsu0M+zTVxvDRG+vigtKwNxbn8MwYWmwlYgza6U8wFklerhejcImnGR4nCBsPyBBqn/GV67XqMyTRfVvxWLPKVGvc6leSm3te6sxS8nc3LdY3oerFxZ0lYOq3atwUSVQTa1olg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 11 Feb 2022 11:02:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Gcc11 looks to have trouble with conditional expressions used with
vector operands: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104497.
Replace two instances causing SEGV there in certain cases.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/tools/tests/x86_emulator/simd.c
+++ b/tools/tests/x86_emulator/simd.c
@@ -1727,8 +1727,8 @@ int simd_test(void)
     if ( !eq(x - src, (alt + 1) / 2) ) return __LINE__;
 #endif
 
-    for ( i = 0; i < ELEM_COUNT; ++i )
-        y[i] = (i & 1 ? inv : src)[i];
+    for ( y = src, i = 1; i < ELEM_COUNT; i += 2 )
+        y[i] = inv[i];
 
 #ifdef select
 # ifdef UINT_SIZE
--- a/tools/tests/x86_emulator/simd-sg.c
+++ b/tools/tests/x86_emulator/simd-sg.c
@@ -282,7 +282,7 @@ int sg_test(void)
 # if ELEM_SIZE == IDX_SIZE
     y = gather(x, array, idx, (idx & inv) != 0, ELEM_SIZE);
     for ( i = 0; i < ITEM_COUNT; ++i )
-        if ( y[i] != ((i + 1) & (ITEM_COUNT - i) ? idx : inv)[i] + 1 )
+        if ( y[i] != ((i + 1) & (ITEM_COUNT - i) ? idx[i] : inv[i]) + 1 )
             return __LINE__;
     for ( ; i < ELEM_COUNT; ++i )
         if ( y[i] )




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.