Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp67878lqc; Thu, 29 Feb 2024 10:28:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVqB0tC0pRxtYU6XdIX5HeX1NodCFKzHK/qidFoJSrAFDYykZ/SapdbNo4xRQeDZb1jXgzTMeToS2ovS7lTJxrDI7nPEs2qrrhKDqcLog== X-Google-Smtp-Source: AGHT+IFTTzREt95t/I7MZi4mVsPYkPE2LuKXgeZmMeGqGCoeOlvG3SRQ5yZL3K5+Ozpu1ShOdtJ0 X-Received: by 2002:a05:6358:e49d:b0:178:99cc:e52e with SMTP id by29-20020a056358e49d00b0017899cce52emr3358181rwb.20.1709231284282; Thu, 29 Feb 2024 10:28:04 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dv12-20020ad44eec000000b0068efcba558fsi1818385qvb.480.2024.02.29.10.28.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:28:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=U3KnBvNi; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-87288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87288-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EAB941C23712 for ; Thu, 29 Feb 2024 18:28:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0A847D099; Thu, 29 Feb 2024 18:27:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="U3KnBvNi" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C481160649 for ; Thu, 29 Feb 2024 18:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709231258; cv=none; b=dqyE19N5nxmhbsct6M1MYtZiWSZA4YarQm0OPrYwR8ZtyiU5QwnPRcRzzT2/HiO2+pi3u/dcCz5U9cm3CtaiDcD0+hR8KxOCJ7PsVMJxZ6CJpI6Z0KATcPJyNhKpom62/BTHe5xEtnJ1PGp/Upoo9dvxdfXimeteRLE1O6ufL9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709231258; c=relaxed/simple; bh=ovsg3EsGVNBuUxD8Aou40oEaBLO7MWU4ochzYJsB2Lg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OTGuVd3IcxFflNvqXjZ0spGTqV6raBVSIixaNdtu4HiacfF4yY6WEkOH7ii9ihAgZHmbv82aO+r2b694BBgBBM/XE6RsubORUS+youGYfC6H3xTdn6JR7u9YOn9DfdjZSh+EiCkNymNjjZ/+g03yyxInKQsrzh8rf8WLYae4gVg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=U3KnBvNi; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709231257; x=1740767257; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ovsg3EsGVNBuUxD8Aou40oEaBLO7MWU4ochzYJsB2Lg=; b=U3KnBvNi/vuxrkWs3XmG+KDBUQxdnUvLGkQuy1Q49m5oYLJRr/Bikl6A +7LYqUVtO2VEJzIWGqBH2Le8BBdBkgoKyncokiBt/hFPN6YpoQFJ6Hjcm ia2p0Fn9ceTK05UfrIQrxjM5hK/4FLAJTj74UeJeeRLZn+cljHty2NPPO 07BrkCREAsUqC/8ifUPq+kAE/jknwA9m3Owbd2NcE+h0ih9TgUPP783yG UzdgntrKDsoVsqDZbH5d8oHf+jxM7C7uAiCGqBv3LWuq8gLhtnWcFHbQl Ufp3HflZgewo+D77pfYuI9AX+odHTq1k8WK9ZvMPPcCDKP65hBCMxFrtW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10999"; a="3899201" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="3899201" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 10:27:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10999"; a="913988859" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="913988859" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 10:27:33 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rfl7y-00000008kFY-1VIr; Thu, 29 Feb 2024 20:27:30 +0200 Date: Thu, 29 Feb 2024 20:27:30 +0200 From: Andy Shevchenko To: Lucas De Marchi Cc: Yury Norov , Dmitry Baryshkov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jani Nikula , intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula Subject: Re: [PATCH v3 1/3] bits: introduce fixed-type genmasks Message-ID: References: <20240208074521.577076-1-lucas.demarchi@intel.com> <20240208074521.577076-2-lucas.demarchi@intel.com> <3o3nvkg76sofrhgcuogo3wuhitnz3bgus6qzle7pejng3v4s62@frdbuj46uiu7> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Feb 29, 2024 at 12:21:34PM -0600, Lucas De Marchi wrote: > On Thu, Feb 29, 2024 at 12:49:57PM +0200, Andy Shevchenko wrote: > > On Wed, Feb 28, 2024 at 05:39:21PM -0600, Lucas De Marchi wrote: > > > On Thu, Feb 22, 2024 at 06:49:59AM -0800, Yury Norov wrote: .. > > > I build-tested this in x86-64, x86-32 and arm64. I didn't like much the > > > need to fork the __GENMASK() implementation on the 2 sides of the ifdef > > > since I think the GENMASK_INPUT_CHECK() should be the one covering the > > > input checks. However to make it common we'd need to solve 2 problems: > > > the casts and the sizeof. The sizeof can be passed as arg to > > > __GENMASK(), however the casts I think would need a __CAST_U8(x) > > > or the like and sprinkle it everywhere, which would hurt readability. > > > Not pretty. Or go back to the original submission and make it less > > > horrible :-/ > > > > I'm wondering if we can use _Generic() approach here. > > in assembly? Yes. -- With Best Regards, Andy Shevchenko