[llvm] [GlobalISel][AArch64] Legalize G_FABS and G_FNEG for SVE (PR #114784)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 10:25:31 PST 2024


================
@@ -0,0 +1,71 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
+; RUN: llc < %s -mtriple aarch64 -mattr=+sve  | FileCheck %s
+; RUN: llc < %s -mtriple aarch64 -mattr=+sve -global-isel -aarch64-enable-gisel-sve=1 | FileCheck %s
+
+;; fneg
+define <vscale x 2 x double> @fnegnxv2double(<vscale x 2 x double> %a) {
+; CHECK-LABEL: fnegnxv2double:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    ptrue p0.d
+; CHECK-NEXT:    fneg z0.d, p0/m, z0.d
+; CHECK-NEXT:    ret
+entry:
+  %c = fneg <vscale x 2 x double> %a
+  ret <vscale x 2 x double> %c
+}
+
----------------
tschuett wrote:

For AArch64 SVE, the size of the granule is 128 bit. It is your choice how to fill it:
* 2 x 64bit
* 4 x 32bit
* 8 x 16bit
We cannot scalarize or widen scalable vectors. The **vscale** is unknown  at compile time.

https://github.com/llvm/llvm-project/pull/114784


More information about the llvm-commits mailing list