[PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-18 Thread H.J. Lu via Gcc-patches
patch. > I think we can do better. > Move cpuinfo.h from libgcc to common/config/i386 so that get_intel_cpu can be shared by libgcc, GCC driver, gcc.target/i386/builtin_target.c and libgfortran to detect the specific type of Intel CPU. Update libgfortran to use has_cpu_feature to detect x86

Re: [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-18 Thread Uros Bizjak via Gcc-patches
On Tue, May 19, 2020 at 4:17 AM H.J. Lu wrote: > > On Mon, May 18, 2020 at 5:57 AM H.J. Lu wrote: > > > > On Mon, May 18, 2020 at 5:43 AM Uros Bizjak wrote: > > > > > > On Mon, May 18, 2020 at 2:34 PM H.J. Lu wrote: > > > > > > > > On Mon, May 18, 2020 at 5:18 AM Uros Bizjak wrote: > > > > > >

Re: [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-19 Thread Thomas Koenig via Gcc-patches
Am 19.05.20 um 04:16 schrieb H.J. Lu via Fortran: Tested on Linux/x86 and Linux/x86-64. OK for master? Libfortran parts are OK. Regards Thomas

V2 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-19 Thread H.J. Lu via Gcc-patches
fig/i386 so that get_intel_cpu > > can be shared by libgcc, GCC driver, gcc.target/i386/builtin_target.c > > and libgfortran to detect the specific type of Intel CPU. Update > > libgfortran to use has_cpu_feature to detect x86 CPU features. > > > > Tested on Linux/x8

V2 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-21 Thread H.J. Lu via Gcc-patches
patch, it is clear that cpuinfo.c and driver-i386.c > > should stay apart. They are two different things, and they are > > orthogonal to each other; one can be updated without affecting the > > other one. driver-i386.c handles way more targets than cpuinfo.c and > > your patc

V3 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-22 Thread H.J. Lu via Gcc-patches
river-i386.c handles way more targets than cpuinfo.c and > > > your patch only handles a subset of them. The unification does not > > > bring any benefit, it even complicates things more. > > > > There should one place to check a CPU feature, not 2. It can > > be done

V4 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-25 Thread H.J. Lu via Gcc-patches
waitpkg, cldemote, ptwrite, avx512bf16, enqcmd, > avx512vp2intersect, serialize, tsxldtrk, NULL); > > and instead mark flags in 'isa_names_table' that should be used for > -match=native option emission. > We know names of th

V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-26 Thread H.J. Lu via Gcc-patches
-- H.J. From 48a429a02c91937ba2a4bd37f42304c2ce59bb28 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 18 May 2020 05:58:41 -0700 Subject: [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386 Move cpuinfo.h from libgcc to common/config/i386 and move isa_names_table to comm

V7 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-24 Thread H.J. Lu via Gcc-patches
On Mon, Jun 22, 2020 at 04:25:46PM -0700, H.J. Lu wrote: > On Sun, Jun 21, 2020 at 10:22 AM H.J. Lu wrote: > > > > On Sun, Jun 21, 2020 at 10:18 AM Uros Bizjak wrote: > > > > > > On Sat, Jun 20, 2020 at 3:40 PM H.J. Lu wrote: > > > > > > > > > > >> 2) can we automatically deduce option name: > >

Re: V2 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-19 Thread Uros Bizjak via Gcc-patches
On Tue, May 19, 2020 at 9:58 PM H.J. Lu wrote: > > On Mon, May 18, 2020 at 10:56 PM Uros Bizjak wrote: > > > > On Tue, May 19, 2020 at 4:17 AM H.J. Lu wrote: > > > > > > On Mon, May 18, 2020 at 5:57 AM H.J. Lu wrote: > > > > > > > > On Mon, May 18, 2020 at 5:43 AM Uros Bizjak wrote: > > > > >

Re: V2 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-19 Thread H.J. Lu via Gcc-patches
On Tue, May 19, 2020 at 2:07 PM Uros Bizjak wrote: > > On Tue, May 19, 2020 at 9:58 PM H.J. Lu wrote: > > > > On Mon, May 18, 2020 at 10:56 PM Uros Bizjak wrote: > > > > > > On Tue, May 19, 2020 at 4:17 AM H.J. Lu wrote: > > > > > > > > On Mon, May 18, 2020 at 5:57 AM H.J. Lu wrote: > > > > >

Re: V2 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-19 Thread H.J. Lu via Gcc-patches
On Tue, May 19, 2020 at 2:07 PM Uros Bizjak wrote: > > On Tue, May 19, 2020 at 9:58 PM H.J. Lu wrote: > > > > On Mon, May 18, 2020 at 10:56 PM Uros Bizjak wrote: > > > > > > On Tue, May 19, 2020 at 4:17 AM H.J. Lu wrote: > > > > > > > > On Mon, May 18, 2020 at 5:57 AM H.J. Lu wrote: > > > > >

Re: V2 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-19 Thread Uros Bizjak via Gcc-patches
On Tue, May 19, 2020 at 11:40 PM H.J. Lu wrote: > > > > > > > > I will take a look to see if we share the same CPU detection > > > > > > > > code between > > > > > > > > libgcc and config/i386/driver-i386.c. > > > > > > > > > > > > > > I don't think it will bring any benefit, this is mainly one

Re: V2 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-20 Thread H.J. Lu via Gcc-patches
On Tue, May 19, 2020 at 11:10 PM Uros Bizjak wrote: > > On Tue, May 19, 2020 at 11:40 PM H.J. Lu wrote: > > > > > > > > > > I will take a look to see if we share the same CPU detection > > > > > > > > > code between > > > > > > > > > libgcc and config/i386/driver-i386.c. > > > > > > > > > > > >

Re: V3 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-25 Thread Martin Liška
Hello. I really welcome the unification patch and I have some comments (ideas): 1) +static inline int +has_cpu_feature (struct __processor_model *cpu_model, + unsigned int *cpu_features2, + enum processor_features f) +{ + unsigned int i; + if (f < 32) +return cp

Re: V4 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-26 Thread Martin Liška
On 5/25/20 7:42 PM, H.J. Lu wrote: Here is the updated patch. OK for master? Thank you for the updated patch. I have still few nits: 1) I would make all the: + has_sse3 = has_feature (FEATURE_SSE3); a macro. The local variable seems to superfluous. 2) can we automatically deduce option

Re: V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-05-26 Thread Martin Liška
On 5/26/20 1:59 PM, H.J. Lu wrote: On Tue, May 26, 2020 at 2:30 AM Martin Liška wrote: On 5/25/20 7:42 PM, H.J. Lu wrote: Here is the updated patch. OK for master? Thank you for the updated patch. I have still few nits: 1) I would make all the: + has_sse3 = has_feature (FEATURE_SSE3);

Re: V7 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-24 Thread Uros Bizjak via Gcc-patches
On Wed, Jun 24, 2020 at 2:27 PM H.J. Lu wrote: > > On Mon, Jun 22, 2020 at 04:25:46PM -0700, H.J. Lu wrote: > > On Sun, Jun 21, 2020 at 10:22 AM H.J. Lu wrote: > > > > > > On Sun, Jun 21, 2020 at 10:18 AM Uros Bizjak wrote: > > > > > > > > On Sat, Jun 20, 2020 at 3:40 PM H.J. Lu wrote: > > > >

PING^1: V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-09 Thread H.J. Lu via Gcc-patches
On Tue, May 26, 2020 at 6:27 AM Martin Liška wrote: > > On 5/26/20 1:59 PM, H.J. Lu wrote: > > On Tue, May 26, 2020 at 2:30 AM Martin Liška wrote: > >> > >> On 5/25/20 7:42 PM, H.J. Lu wrote: > >>> Here is the updated patch. OK for master? > >> > >> Thank you for the updated patch. > >> > >> I h

PING^2: V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-16 Thread H.J. Lu via Gcc-patches
On Tue, Jun 9, 2020 at 9:35 AM H.J. Lu wrote: > > On Tue, May 26, 2020 at 6:27 AM Martin Liška wrote: > > > > On 5/26/20 1:59 PM, H.J. Lu wrote: > > > On Tue, May 26, 2020 at 2:30 AM Martin Liška wrote: > > >> > > >> On 5/25/20 7:42 PM, H.J. Lu wrote: > > >>> Here is the updated patch. OK for m

Re: PING^2: V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-20 Thread H.J. Lu via Gcc-patches
On Tue, Jun 16, 2020 at 10:11 AM H.J. Lu wrote: > > On Tue, Jun 9, 2020 at 9:35 AM H.J. Lu wrote: > > > > On Tue, May 26, 2020 at 6:27 AM Martin Liška wrote: > > > > > > On 5/26/20 1:59 PM, H.J. Lu wrote: > > > > On Tue, May 26, 2020 at 2:30 AM Martin Liška wrote: > > > >> > > > >> On 5/25/20 7

Re: PING^2: V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-21 Thread Uros Bizjak via Gcc-patches
On Sat, Jun 20, 2020 at 3:40 PM H.J. Lu wrote: > > > > >> 2) can we automatically deduce option name: > > > > >> > > > > >>> + ISA_NAMES_TABLE_ENTRY("rdpid", FEATURE_RDPID, P_ZERO, "-mrdpid") > > > > >>> + ISA_NAMES_TABLE_ENTRY("rdrnd", FEATURE_RDRND, P_ZERO, "-mrdrnd") > > > > >> > > > > >> I

Re: PING^2: V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-21 Thread H.J. Lu via Gcc-patches
On Sun, Jun 21, 2020 at 10:18 AM Uros Bizjak wrote: > > On Sat, Jun 20, 2020 at 3:40 PM H.J. Lu wrote: > > > > > > >> 2) can we automatically deduce option name: > > > > > >> > > > > > >>> + ISA_NAMES_TABLE_ENTRY("rdpid", FEATURE_RDPID, P_ZERO, > > > > > >>> "-mrdpid") > > > > > >>> + ISA_NAME

Re: PING^2: V5 [PATCH] x86: Move cpuinfo.h from libgcc to common/config/i386

2020-06-23 Thread Martin Liška
On 6/16/20 7:11 PM, H.J. Lu wrote: On Tue, Jun 9, 2020 at 9:35 AM H.J. Lu wrote: On Tue, May 26, 2020 at 6:27 AM Martin Liška wrote: On 5/26/20 1:59 PM, H.J. Lu wrote: On Tue, May 26, 2020 at 2:30 AM Martin Liška wrote: On 5/25/20 7:42 PM, H.J. Lu wrote: Here is the updated patch. OK