From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="U3KnBvNi" 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