1. 10
    1. 1

      Doing [runtime detection] correctly is very hard and something I don’t particularly want to dig deeply into here.

      It’s kinda not that hard, especially not in Rust which gives you #[target_feature(..)] and std::arch macros (sadly doesn’t make it easy to use ifuncs instead of if statements but oh well the benefit from rtld-time resolution shouldn’t be that big performance wise)

      1. 1

        sadly doesn’t make it easy to use ifuncs instead of if statements

        There is ifunky. The much more widely used memchr does something similar, though I suppose that doesn’t count as easy.

        1. 1

          “without the need for loader support” yeah those aren’t really it either.

      2. 1

        Don’t you use cfg_feature_enabled for runtime feature detection, and target_feature for compile-time feature detection?

        1. 2

          It’s not compile-time detection, it enables that feature for codegen inside of a function.

    2. [Comment removed by author]