libatomic/ChangeLog:
        * libatomic_i.h: Add GEN_SELECTOR implementation for
        IFUNC_NCOND(N) == 4.
---
 libatomic/libatomic_i.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/libatomic/libatomic_i.h b/libatomic/libatomic_i.h
index 861a22da152..0a854fd908c 100644
--- a/libatomic/libatomic_i.h
+++ b/libatomic/libatomic_i.h
@@ -275,6 +275,24 @@ bool libat_is_lock_free (size_t, void *) MAN(is_lock_free);
            return C3(libat_,X,_i3);                            \
          return C2(libat_,X);                                  \
        }
+# elif IFUNC_NCOND(N) == 4
+#  define GEN_SELECTOR(X)                                      \
+       extern typeof(C2(libat_,X)) C3(libat_,X,_i1) HIDDEN;    \
+       extern typeof(C2(libat_,X)) C3(libat_,X,_i2) HIDDEN;    \
+       extern typeof(C2(libat_,X)) C3(libat_,X,_i3) HIDDEN;    \
+       extern typeof(C2(libat_,X)) C3(libat_,X,_i4) HIDDEN;    \
+       static typeof(C2(libat_,X)) * C2(select_,X) (IFUNC_RESOLVER_ARGS) \
+       {                                                       \
+         if (IFUNC_COND_1)                                     \
+           return C3(libat_,X,_i1);                            \
+         if (IFUNC_COND_2)                                     \
+           return C3(libat_,X,_i2);                            \
+         if (IFUNC_COND_3)                                     \
+           return C3(libat_,X,_i3);                            \
+         if (IFUNC_COND_4)                                     \
+           return C3(libat_,X,_i4);                            \
+         return C2(libat_,X);                                  \
+       }
 # else
 #  error "Unsupported number of ifunc alternatives."
 # endif
-- 
2.42.0

Reply via email to