Skip to content
  • Chun-wei Fan's avatar
    gsk/ngl/fp16.c: Implement runtime F16C detection on MSVC · d5ced212
    Chun-wei Fan authored
    We need to use __cpuid() to check for the presence of F16C instructions on
    Visual Studio builds, and call the half_to_float4() or float_to_half4()
    implementation accordingly, as the __builtin_cpu...() functions are strictly
    for GCC or CLang only.
    
    Also, since __m128i_u is not a standard intrisics type across the board, just
    use __m128i on Visual Studio as it is safe to do so there for use for
    _mm_loadl_epi64().
    
    Like running on Darwin, we cannot use the alias __attribute__ as __attribute__
    is also for GCC and CLang only.
    d5ced212