[PATCH] Add Aarch64 SVE defines

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Add Aarch64 SVE defines

Alan Hayward
This patch adds Aarch64 SVE specific defines to glibc.

The Linux kernel changes for Aarch64 SVE have recently been pulled
into the head:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9b012e5f4a1d01dfa8abc6318211a67ba7d5db2
Although not due to be in a kernel release until early 2018, we'd
like to make sure any glibc changes are ready for a similar time.

I haven't run any testsuites as the changes are should not effect them.

Is this ok?


Thanks,
Alan.


2017-12-08  Alan Hayward  <[hidden email]>

        * elf/elf.h: Add NT_ARM_SVE.
        * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.


 elf/elf.h                                    | 2 ++
 sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | 1 +
 2 files changed, 3 insertions(+)


diff --git a/elf/elf.h b/elf/elf.h
index 01a43ce9ac..e54a529d51 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -795,6 +795,8 @@ typedef struct
 #define NT_ARM_HW_BREAK        0x402           /* ARM hardware breakpoint registers */
 #define NT_ARM_HW_WATCH        0x403           /* ARM hardware watchpoint registers */
 #define NT_ARM_SYSTEM_CALL     0x404   /* ARM system call number */
+#define NT_ARM_SVE     0x405           /* ARM Scalable Vector Extension
+                                          registers */

 /* Legal values for the note segment descriptor types for object files.  */

diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
index e46bb69118..255ddf0581 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
@@ -38,3 +38,4 @@
 #define HWCAP_FCMA             (1 << 14)
 #define HWCAP_LRCPC            (1 << 15)
 #define HWCAP_DCPOP            (1 << 16)
+#define HWCAP_SVE              (1 << 22)


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add Aarch64 SVE defines

Szabolcs Nagy-2
On 08/12/17 14:59, Alan Hayward wrote:

> This patch adds Aarch64 SVE specific defines to glibc.
>
> The Linux kernel changes for Aarch64 SVE have recently been pulled
> into the head:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9b012e5f4a1d01dfa8abc6318211a67ba7d5db2
> Although not due to be in a kernel release until early 2018, we'd
> like to make sure any glibc changes are ready for a similar time.
>
> I haven't run any testsuites as the changes are should not effect them.
>
> Is this ok?
>
>
> Thanks,
> Alan.
>
>
> 2017-12-08  Alan Hayward  <[hidden email]>
>
> * elf/elf.h: Add NT_ARM_SVE.
> * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.
>

nowadays these files need to be updated as well:

sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c

glibc release is in february so we have more time,
ideally we would wait for the kernel release.


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add Aarch64 SVE defines

Szabolcs Nagy-2
In reply to this post by Alan Hayward
On 08/12/17 14:59, Alan Hayward wrote:
> This patch adds Aarch64 SVE specific defines to glibc.
...
>
> 2017-12-08  Alan Hayward  <[hidden email]>
>
> * elf/elf.h: Add NT_ARM_SVE.
> * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.

i plan to apply the elf.h part of this patch
and then do the hwcap.h update separately.

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add Aarch64 SVE defines

Alan Hayward


> On 11 Jan 2018, at 17:37, Szabolcs Nagy <[hidden email]> wrote:
>
> On 08/12/17 14:59, Alan Hayward wrote:
>> This patch adds Aarch64 SVE specific defines to glibc.
> ...
>>
>> 2017-12-08  Alan Hayward  <[hidden email]>
>>
>> * elf/elf.h: Add NT_ARM_SVE.
>> * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.
>
> i plan to apply the elf.h part of this patch
> and then do the hwcap.h update separately.
>

Thanks for that!

I took a look at the dl-procinfo.c and it looked simple enough, but haven’t had
the time test to write the patch. Also, I wasn’t sure the best way to test the code
(Didn’t seem anything relevant in the test suite and I’m not sure how to use libc
to access the changes directly).


Alan.