all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 4a82fc1cbdc353ae9b13d07f8ec5338a7a852ba0 2841 bytes (raw)
name: gnu/packages/patches/glibc-2-26-0009.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 
From 645b7635ba8fd58062245419e8bb668ab90cd3ec Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Mon, 7 Aug 2017 09:14:14 -0300
Subject: [PATCH 09/90] powerpc: Restrict xssqrtqp operands to Vector Registers
 (bug 21941)

POWER ISA 3.0 introduces the xssqrtqp instructions, which expects
operands to be in Vector Registers (Altivec/VMX), even though this
instruction belongs to the Vector-Scalar Instruction Set.

In GCC's Extended Assembly for POWER, the 'wq' register constraint is
provided for use with IEEE 754 128-bit floating-point values.  However,
this constraint does not limit the register allocation to Vector
Registers (Altivec/VMX) and could assign a Vector-Scalar Register (VSX)
to the operands of the instruction.

This patch changes the register constraint used in sqrtf128 from 'wq' to
'v', in order to request a Vector Register (Altivec/VMX) for use with
the xssqrtqp instruction.

Tested for powerpc64le and --with-cpu=power9.

	[BZ #21941]
	* sysdeps/powerpc/fpu/math_private.h (__ieee754_sqrtf128): Since
	xssqrtqp requires operands to be in Vector Registers
	(Altivec/VMX), replace the register constraint 'wq' with 'v'.
	* sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
	(__ieee754_sqrtf128): Likewise.

(cherry picked from commit 4d98ace9de3183309cb394cd0110eda5ad2d2531)

diff --git a/ChangeLog b/ChangeLog
index 0057c0902a..6886cd9361 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-08-10  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	[BZ #21941]
+	* sysdeps/powerpc/fpu/math_private.h (__ieee754_sqrtf128): Since
+	xssqrtqp requires operands to be in Vector Registers
+	(Altivec/VMX), replace the register constraint 'wq' with 'v'.
+	* sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
+	(__ieee754_sqrtf128): Likewise.
+
 2017-08-11  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #21242]
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index d8fd4923ac..396fd0562e 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -30,7 +30,7 @@ extern __always_inline _Float128
 __ieee754_sqrtf128 (_Float128 __x)
 {
   _Float128 __z;
-  asm ("xssqrtqp %0,%1" : "=wq" (__z) : "wq" (__x));
+  asm ("xssqrtqp %0,%1" : "=v" (__z) : "v" (__x));
   return __z;
 }
 #endif
diff --git a/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
index 769d3f8922..59fd8269f5 100644
--- a/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
+++ b/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
@@ -30,7 +30,7 @@ __float128
 __ieee754_sqrtf128 (__float128 a)
 {
   __float128 z;
-  asm ("xssqrtqp %0,%1" : "=wq" (z) : "wq" (a));
+  asm ("xssqrtqp %0,%1" : "=v" (z) : "v" (a));
   return z;
 }
 strong_alias (__ieee754_sqrtf128, __sqrtf128_finite)

debug log:

solving 4a82fc1cb ...
found 4a82fc1cb in https://yhetil.org/guix/87ine0pjiu.fsf@fastmail.com/ ||
	https://yhetil.org/guix/87d148pe57.fsf@fastmail.com/

applying [1/1] https://yhetil.org/guix/87ine0pjiu.fsf@fastmail.com/
diff --git a/gnu/packages/patches/glibc-2-26-0009.patch b/gnu/packages/patches/glibc-2-26-0009.patch
new file mode 100644
index 000000000..4a82fc1cb

1:53: trailing whitespace.
 
1:54: space before tab in indent.
 	[BZ #21242]
Checking patch gnu/packages/patches/glibc-2-26-0009.patch...
Applied patch gnu/packages/patches/glibc-2-26-0009.patch cleanly.
warning: 2 lines add whitespace errors.

skipping https://yhetil.org/guix/87d148pe57.fsf@fastmail.com/ for 4a82fc1cb
index at:
100644 4a82fc1cbdc353ae9b13d07f8ec5338a7a852ba0	gnu/packages/patches/glibc-2-26-0009.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.