From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id CF6CF3858C5E for ; Wed, 24 Jan 2024 17:18:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF6CF3858C5E Authentication-Results: sourceware.org; dmarc=pass (p=none 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 CF6CF3858C5E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706116716; cv=none; b=Fv3ppXz/Pda44tM0akhDJAC/Cz7VlMGvysIGaRydqZHOj/fTamJSn5FKaKt4YjAi9rDIcq/MLRu1BXtWyeIbqbjEudbw1K3mvx3FCrgei3E2VaEyDDGLk8bPMSrpW0gYff/7HAoLuIhdnIChtdZYrh75vADgq2Yy+lRsSKZsM14= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706116716; c=relaxed/simple; bh=NmCwhCmxfCsDgXKRGthIzEyMKXWAMoXvaSBTVBv4y5M=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=mzBCT75MHNdzjulYr1QKXApGO8LaIIySKid/LZesnSS3WQBRAmQ38S8Qy0rq+twBFuSj530u3GbD/1kFKaplXi/icWWxoz8TgV32cOfV/vALwZY55GpwxiGYnohk9F/1+JYzeyKrosJc09KPZk+UuFPI1b/ggYtB9mV4XlzCjqs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706116714; 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=URUWRiCmRXP6oPhEBE0SaMH/NAikAi4k6uXHyO6qXnE=; b=CCVljWM0KkDgH1jXOjHRV1pKrOeoB1xsr5szqU6PrML/VYf4yxw4vNxolRyELb4YVUHeG1 KfxW7kpjVSn2g9uQV2/idECajs7GnmGzRj2gt9Rv27uo5/hXdZDLgl+d3pIjxIWyd5dpI9 UQUfOR1gXzuYRW9aRE5SABR/xg/FSb0= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-86-k_2u3Ug5NPW14y2YMA7AdQ-1; Wed, 24 Jan 2024 12:18:33 -0500 X-MC-Unique: k_2u3Ug5NPW14y2YMA7AdQ-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-783350c4584so1019203485a.1 for ; Wed, 24 Jan 2024 09:18:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706116712; x=1706721512; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=URUWRiCmRXP6oPhEBE0SaMH/NAikAi4k6uXHyO6qXnE=; b=eRYXwHBYt70cLR70eYO9vZL2tOycXJI9vnxIlRLA3rgGJBB7w4pmxlgqol1H2VwY3e AoVRbd5ju2WnzFVFM32dsX16M/2UaawK98jjVfwbe+7GbPqseoOkcwJYyMp43zQG2zCO l2P+eEx8HUuq+BfHy4GgLhyXBYXHJhO/W0UIzxUflA1/sepb5tJOVp2BWY/uIwF8yBJL UhUJxo1YQXX75Jet3bTRpY3CDZDRvp9TbMeVARjv5v2oh77QT3lntfEjQMui7QPVCdUi YmLN1GeIshjBpxzqJH+493fbW6uQNE4gYCnLZL+NsbHqkFsP5Aqz5qjMDsNXlXw042GV MyeQ== X-Gm-Message-State: AOJu0YxzfRmiS/0qBJOuNG/MYjlQBkdaEN4DX27gysaSiU7d/O1M8fJw Z03WwuNpiPUz6N3WYPiOwvlQZk3QrRWRaZpL1dWhZyolCwSaRuM2SY/cbhxvWSPk0ulCO9tW+qE 4qBETVqRAQm0eqNu0DE3lYZqT4A2pAWTzn2L7iDYpJ6eeU8LheESl X-Received: by 2002:a05:620a:468d:b0:783:ae03:749c with SMTP id bq13-20020a05620a468d00b00783ae03749cmr3575794qkb.85.1706116712229; Wed, 24 Jan 2024 09:18:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFt6GCTKcrmOcjLDXCb7G/+zF4F/99/960hZXcrVyTEsSaM91ev5ErpU+jfxTCK2smWG0PX+Q== X-Received: by 2002:a05:620a:468d:b0:783:ae03:749c with SMTP id bq13-20020a05620a468d00b00783ae03749cmr3575780qkb.85.1706116711992; Wed, 24 Jan 2024 09:18:31 -0800 (PST) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id q4-20020ae9e404000000b0078382946fb5sm4231056qkc.29.2024.01.24.09.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 09:18:31 -0800 (PST) Message-ID: <06d63ba528f086da2c195ea5b5a07ae4dd33c132.camel@redhat.com> Subject: Re: [PATCH] libgccjit: Allow comparing aligned int types From: David Malcolm To: Antoni Boucher , "jit@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" Date: Wed, 24 Jan 2024 12:18:30 -0500 In-Reply-To: <9e79a3d614b1db87c564b0e50f7091c2c203d246.camel@zoho.com> References: <9e79a3d614b1db87c564b0e50f7091c2c203d246.camel@zoho.com> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 Thu, 2023-12-21 at 08:33 -0500, Antoni Boucher wrote: > Hi. > This patch allows comparing aligned integer types as equal. > There's a TODO in the code about whether we should check that the > alignment is equal. > What are your thoughts on this? I think we should check for equal alignment. [...snip...] > diff --git a/gcc/testsuite/jit.dg/test-types.c b/gcc/testsuite/jit.dg/tes= t-types.c > index a01944e35fa..c2f4d2bcb3d 100644 > --- a/gcc/testsuite/jit.dg/test-types.c > +++ b/gcc/testsuite/jit.dg/test-types.c > @@ -485,11 +485,15 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result = *result) > =20 > CHECK_VALUE (z.m_FILE_ptr, stderr); > =20 > + gcc_jit_type *long_type =3D gcc_jit_context_get_type (ctxt, GCC_JIT_TY= PE_LONG); > + gcc_jit_type *int64_type =3D gcc_jit_context_get_type (ctxt, GCC_JIT_T= YPE_INT64_T); > if (sizeof(long) =3D=3D 8) > - CHECK (gcc_jit_compatible_types ( > - gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_LONG), > - gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT64_T))); > + CHECK (gcc_jit_compatible_types (long_type, int64_type)); > =20 > CHECK_VALUE (gcc_jit_type_get_size (gcc_jit_context_get_type (ctxt, GC= C_JIT_TYPE_FLOAT)), sizeof (float)); > CHECK_VALUE (gcc_jit_type_get_size (gcc_jit_context_get_type (ctxt, GC= C_JIT_TYPE_DOUBLE)), sizeof (double)); > + > + gcc_jit_type *aligned_long =3D gcc_jit_type_get_aligned (long_type, 4)= ; > + gcc_jit_type *aligned_int64 =3D gcc_jit_type_get_aligned (int64_type, = 4); > + CHECK (gcc_jit_compatible_types (aligned_long, aligned_int64)); This CHECK should be guarded on sizeof(long) =3D=3D 8 like the check above. Dave