x86: Add support to build wcscpy with explicit ISA level
commit192979ee351315b84ff4277d0985f26243717cd7
authorNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 13 Jul 2022 23:33:00 +0000 (13 16:33 -0700)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Sat, 16 Jul 2022 10:07:59 +0000 (16 03:07 -0700)
treea62f2737cc82add1047d89ef9e89984849a6de8d
parentceabdcd130ca7043b0fcf2676183d79431d10493
x86: Add support to build wcscpy with explicit ISA level

1. Add ISA level build guards to different implementations.
    - wcscpy-ssse3.S is used as ISA level 2/3/4.
    - wcscpy-generic.c is only used at ISA level 1 and will
      only build if compiled with ISA level == 1. Otherwise
      there is no reason to include it as we will always use
      wcscpy-ssse3.S

2. Refactor the ifunc selector and ifunc implementation list to use
   the ISA level aware wrapper macros that allow functions below the
   compiled ISA level (with a guranteed replacement) to be skipped.

Tested with and without multiarch on x86_64 for ISA levels:
{generic, x86-64-v2, x86-64-v3, x86-64-v4}

And m32 with and without multiarch.
sysdeps/x86_64/Makefile
sysdeps/x86_64/multiarch/Makefile
sysdeps/x86_64/multiarch/ifunc-impl-list.c
sysdeps/x86_64/multiarch/wcscpy-generic.c
sysdeps/x86_64/multiarch/wcscpy-ssse3.S
sysdeps/x86_64/multiarch/wcscpy.c
sysdeps/x86_64/wcscpy-generic.c [copied from sysdeps/x86_64/multiarch/wcscpy-generic.c with 64% similarity]
sysdeps/x86_64/wcscpy.S [copied from sysdeps/x86_64/multiarch/wcscpy-generic.c with 51% similarity]