Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rKmoH-004UPK-N9 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jan 2024 22:00:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rKmoF-001kRu-SP for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jan 2024 22:00:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rKmoF-001kRh-Iv for pgsql-hackers@lists.postgresql.org; Tue, 02 Jan 2024 22:00:27 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rKmoA-00FDpA-Gx for pgsql-hackers@postgresql.org; Tue, 02 Jan 2024 22:00:24 +0000 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-3600dc78bc0so30071375ab.2 for ; Tue, 02 Jan 2024 14:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704232820; x=1704837620; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UCIh8OAHoziukeaBPzkNNaGdDaqANnV6uwJZv9aSTgc=; b=NhDNlFtrsH/DnmGmcGH8A+aZLsynPI4c4QkoPHGjGsE831tl4s4QX805NbjMAShRzC OQs39gbkVCdw0uZjK+czZgtsaOhto4WoQc3lpYvCr0ficMnjs4Lf0cYdFprL55pT6hdt b1zIxDzysrsNlsd9BSauM7XZ+7cN4s7ZtsZN0pHz5BKtNK+bc4EYeY/pjJaLfpjPWZpB af1tIQb2O48uqV5LEdSQEv50o59DqMaz3+SaKHE0NrKtM4clwVLw1wfAHflMa9KNh04C 411DO23eD0emgtSllrK49+Hdi++u8hQCmAqt4MTx96ixTNjfmipVF8zuB/uDFtz3nGtK //iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704232820; x=1704837620; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UCIh8OAHoziukeaBPzkNNaGdDaqANnV6uwJZv9aSTgc=; b=xAHuo4V0g0V+fMaiHHuj2zD+QGwi+fVEXDisPUx5TRbQhXeSvIi0l2dajuwkecI206 8WgQ9HULF2wr6DCpajd/dYL071cu1vDirn5knesh9qBzk8RJ+ajZWslUdyM2eBYMyQ1x UniRZ1YYBjL3XCkvjsj5nvOXywDKZ3v3jCUtgSZnMk6WK7mkhAXNboQo7yMJAdgnCepL ggaJpbr3Umk7Jq/ixVAiXQm56DDVqLrZFAe+eMp2wkHKxoYvGdImc6GJoEWHhemQZlYv C7R5K/Z8LHCzSxnKyLekruVzZD8z5i4in7FM6px4/iWlmBJNyFvDXtHXDZPc++SBDFmE UTdA== X-Gm-Message-State: AOJu0Ywa1lR7D8v2b8Ch2AR/qRGktKkeYjz+0upBz6xD2iQJbfbNkZ+r +E/k8wJqyozJ2/04tjkygNVF/MCm7uE= X-Google-Smtp-Source: AGHT+IHGw/4Qi1xed3nWx3YYLHZGAqaODF4Z1Jo/1cuFwArEODWdKxAPwWv4ikLdMXvIB2FYJ0JjUg== X-Received: by 2002:a05:6e02:3102:b0:35f:f5cf:cbb4 with SMTP id bg2-20020a056e02310200b0035ff5cfcbb4mr23053969ilb.40.1704232820426; Tue, 02 Jan 2024 14:00:20 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id cs13-20020a056638470d00b0046dda6b83c1sm225977jab.25.2024.01.02.14.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 14:00:20 -0800 (PST) Date: Tue, 2 Jan 2024 16:00:18 -0600 From: Nathan Bossart To: Tom Lane Cc: John Naylor , Ants Aasma , pgsql-hackers@postgresql.org Subject: Re: add AVX2 support to simd.h Message-ID: <20240102220018.GB1063425@nathanxps13> References: <20231129171526.GA857928@nathanxps13> <20240102161123.GA955987@nathanxps13> <4105101.1704217804@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4105101.1704217804@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jan 02, 2024 at 12:50:04PM -0500, Tom Lane wrote: > The patch needs better comments (as in, more than "none whatsoever"). Yes, will do. > Also, do you really want to structure the header so that USE_SSE2 > doesn't get defined? In that case you are committing to provide > an AVX2 replacement every single place that there's USE_SSE2, which > doesn't seem like a great thing to require. OTOH, maybe there's > no choice given than we need a different definition for Vector8 and > Vector32? Yeah, the precedent is to use these abstracted types elsewhere so that any SIMD-related improvements aren't limited to one architecture. There are a couple of places that do explicitly check for USE_NO_SIMD, though. Maybe there's an eventual use-case for using SSE2 intrinsics even when you have AVX2 support, but for now, ensuring we have an AVX2 replacement for everything doesn't seem particularly burdensome. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com