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 1tWLu9-00FzMZ-0L for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2025 20:46:53 +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 1tWLu8-002kEK-Em for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2025 20:46:52 +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 1tWLu8-002kEC-2t for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2025 20:46:51 +0000 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tWLu4-000y1Q-1J for pgsql-hackers@postgresql.org; Fri, 10 Jan 2025 20:46:51 +0000 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-3a9cdcec53fso16261945ab.1 for ; Fri, 10 Jan 2025 12:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736542007; x=1737146807; 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=840YNml/iYtjbiawpCkK4QLsQvmjfLlaRq9DxdnCdlE=; b=N1urTu/6h3lbj4lgjNX5s/DUbUuJYxoXaXRedrKXQtQjDlv99LkTYgmhDk2Afzq+SW ABU5R5/U2+xF5w8rqUtgz5G4M8Dtyy40pGWiH7IcBF5mXoPTN2Ba3LyHtb/IrnRcLHTq M79hy+//FSP8LmaKWtr83ecpKW+hUS6Ddmd5eFciQSgZJCaMG6dmhf5egZ8ICT7CMYxu JRLAln9hdT+XBlQocQv2/rUhwfXhku249qW27SrKjdwyaiByikraxrzZq4xfqa+cbkQv hr/RwzA4Gg0xw20LD0RR1OBgDoct7hUpxy8gamjdqocmwuVHl7aTaRAM5Hqjkm5RS2V8 IHyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736542007; x=1737146807; 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=840YNml/iYtjbiawpCkK4QLsQvmjfLlaRq9DxdnCdlE=; b=dwWSPdlcmZQEMzV9/yIXhZrJ0lDLTwEjt+DLJZ/hoiORXRCDGuzYcLB/gFzxAYOtai KHCndSmbtYnOJGE6RY5MXi9JBBr16R+63QlqUVFWP0etQoUSx3cICPZLvmiJKg4hmDxk b1scggzDTrDdFrUYoo3Lgb+T1jaNTO7eNfrMNUJI0igWwpuRDqS4NL0FtyW10TxotbxB tgTk5eyS+UcTBJ/r2n3KdAf9RP629619HLSOapEqob6KdfC0eFk68Y0F57YRJEG+Nsez EUC7iTrF/KFM/EzJ8mD4h/7UoYvZD7USvcohUqB5cBWKZ/CIheKNfE8HuMLm0c6V7Td7 Y/qg== X-Forwarded-Encrypted: i=1; AJvYcCWz/pqUXW+MKZPSdOg6AWMAcdHb9esfNpDrANxFe8WgUv4PWM4z9fNTaEvY1wqnL9ayFZNUM4KQCz9J5LI0@postgresql.org X-Gm-Message-State: AOJu0YyL4pr/rhjGaZBdlf0sJGSNUNIAV6FsV9T6IKB49pNBVuVdP+EQ 4T5P87+EoM09CnE25s7ZXLkmKWok/jRfVVWU3itU9CuPHe4oO1G1CVrQ6Q== X-Gm-Gg: ASbGncvvL27OadCDv9BsT50EfGGEOusb1k7cA4DsHxDKkKXhc9T9eYSkS/QrNvHO95F DubRDwaR0UzY+cMvvUUCVFCWPt9i0Xr0LPPk2Gc/3Usi9oq5AOBwnXqNUP2CXyeQUsZSUnPH4Xj WUj7flu3xAkaT5Yx71HgE1AYgQA6sNr7MFCdUTmdRD/Yu8VdUQv+5bJW4T5AJl75AkX5+Gautyj l3azerYzKb5zx5qD2L2BJ2X6eyEfEAeqIwlpqckph0ubSGFcAGgLmePv//20HMMMB8oN/XUNm3V bg1GBhxWXug/1ftP9s/QWJwUtDP9b/kx0quoyDiob6nhygE= X-Google-Smtp-Source: AGHT+IFxWqqTl9KIskgqw7bPVPFwkhbkWW7FeaKFTZG1K1iupe49hHc519AXMx+csSp5hyAE6Qb4ww== X-Received: by 2002:a92:cda6:0:b0:3a7:dee4:c41a with SMTP id e9e14a558f8ab-3ce3a877efamr101463825ab.8.1736542007117; Fri, 10 Jan 2025 12:46:47 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ea1b7457easm1076957173.120.2025.01.10.12.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 12:46:46 -0800 (PST) Date: Fri, 10 Jan 2025 14:46:45 -0600 From: Nathan Bossart To: "Chiranmoy.Bhattacharya@fujitsu.com" Cc: "Devanga.Susmitha@fujitsu.com" , "pgsql-hackers@postgresql.org" , "Ragesh.Hajela@fujitsu.com" Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 10, 2025 at 09:38:14AM -0600, Nathan Bossart wrote: > On Fri, Jan 10, 2025 at 11:10:03AM +0000, Chiranmoy.Bhattacharya@fujitsu.com wrote: >> We tried auto-vectorization and observed no performance improvement. > > Do you mean that the auto-vectorization worked and you observed no > performance improvement, or the auto-vectorization had no effect on the > code generated? I was able to get auto-vectorization to take effect on Apple clang 16 with the following addition to src/backend/utils/adt/Makefile: encode.o: CFLAGS += ${CFLAGS_VECTORIZE} -mllvm -force-vector-width=8 This gave the following results with your hex_encode_test() function: buf | HEAD | patch | % diff -------+-------+-------+-------- 16 | 21 | 16 | 24 64 | 54 | 41 | 24 256 | 138 | 100 | 28 1024 | 441 | 300 | 32 4096 | 1671 | 1106 | 34 16384 | 6890 | 4570 | 34 65536 | 27393 | 18054 | 34 This doesn't compare with the gains you are claiming to see with intrinsics, but it's not bad for a one line change. I bet there are ways to adjust the code so that the auto-vectorization is more effective, too. -- nathan