On Tue, Jul 13, 2021 at 09:35:18AM -0700, H.J. Lu wrote: > Here is the v3 patch. OK for master?
>From my POV LGTM, but please give Uros a chance to chime in. > From ceab81ef97ab102c410830c41ba7fea911170d1a Mon Sep 17 00:00:00 2001 > From: "H.J. Lu" <hjl.to...@gmail.com> > Date: Fri, 9 Jul 2021 09:16:01 -0700 > Subject: [PATCH v3] x86: Don't enable UINTR in 32-bit mode > > UINTR is available only in 64-bit mode. Since the codegen target is > unknown when the the gcc driver is processing -march=native, to properly > handle UINTR for -march=native: > > 1. Pass "arch [32|64]" and "tune [32|64]" to host_detect_local_cpu to > indicate 32-bit and 64-bit codegen. > 2. Change ix86_option_override_internal to enable UINTR only in 64-bit > mode for -march=CPU when PTA_CPU includes PTA_UINTR. > > gcc/ > > PR target/101395 > * config/i386/driver-i386.c (host_detect_local_cpu): Check > "arch [32|64]" and "tune [32|64]" for 32-bit and 64-bit codegen. > Enable UINTR only for 64-bit codegen. > * config/i386/i386-options.c > (ix86_option_override_internal::DEF_PTA): Skip PTA_UINTR if not > in 64-bit mode. > * config/i386/i386.h (ARCH_ARG): New. > (CC1_CPU_SPEC): Pass "[arch|tune] 32" for 32-bit codegen and > "[arch|tune] 64" for 64-bit codegen. > > gcc/testsuite/ > > PR target/101395 > * gcc.target/i386/pr101395-1.c: New test. > * gcc.target/i386/pr101395-2.c: Likewise. > * gcc.target/i386/pr101395-3.c: Likewise. Jakub