[Bug middle-end/107727] error: multiversioning needs 'ifunc' which is not supported on this target (x86_64-w64-mingw32 target)

2022-11-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107727

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Build|x86_64-linux-gnu|
 Ever confirmed|0   |1
   Severity|normal  |enhancement
 Target|x86_64-w64-mingw32  |ones which don't support
   ||ifunc
   Last reconfirmed||2022-11-16
   Host|x86_64-linux-gnu|
  Component|target  |middle-end

--- Comment #4 from Andrew Pinski  ---
What they do is basically have the resolver always called:
callq   __cpu_indicator_init
movl__cpu_model+12(%rip), %eax
andl$1024, %eax # imm = 0x400
cmpl$1024, %eax # imm = 0x400
sete%al
andb$1, %al
testb   $1, %al
jne .LBB1_1
jmp .LBB1_2
.LBB1_1:
addq$40, %rsp
jmp _Z3foov.avx2# TAILCALL
.LBB1_2:
nop
addq$40, %rsp
jmp _Z3foov # TAILCALL

Not the fastest way of implementing this either.
A faster way to caching the result of the resolver.

Anyways we currently don't support multiversioning for non-ifuncs supported
targets. Someone will need to program up that support but it might be years
unless you pay someone to do it.

[Bug middle-end/107727] error: multiversioning needs 'ifunc' which is not supported on this target (x86_64-w64-mingw32 target)

2022-11-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107727

--- Comment #5 from Andrew Pinski  ---
(In reply to cqwrteur from comment #2)
> BTW. how could i detect this feature being available? I think
> 
> #if __has_cpp_attribute(__gnu__::__target__)
> 
> #endif
> 
> should not be true on targets that do not support it.

That is related to PR 93419 .