FIAS . Impressum . Privacy

Vc issue

Matthias Kretz [please enable javascript to see the address]
Thu Sep 10 17:16:41 CEST 2015


On Thursday 10 September 2015 14:15:02 Duhem, Laurent wrote:
> I had a look at your ./mic/intrinsics.h file.
> 
> Machine instruction for those kind of intrinsic have a field of 3 bits in
> the mnemonic to specify the conversion argument (so called MVEX.SSS field)
> – same for the memory hint: the hint is represented by one bit ( MVEX.EH).
> 
> Hence the compiler can’t generate the final machine instruction unless the
> conversion and hit are a fixed compile time constant.

I know. And that's the case here. The argument used for conv is a constant 
expression. And that's not the issue for the compilation error. ICC doesn't 
complain about the argument not being an immediate value - it doesn't even get 
so far as to check it. ICC fails earlier.

This testcase should hopefully make it clear:
#include <immintrin.h>
struct A
{
    constexpr operator _MM_DOWNCONV_EPI32_ENUM() const { return 
_MM_DOWNCONV_EPI32_NONE; }
    constexpr operator _MM_UPCONV_EPI32_ENUM() const { return 
_MM_UPCONV_EPI32_NONE; }
};

int f(_MM_DOWNCONV_EPI32_ENUM) { return 0; }

int main()
{
    f(A());
    _mm512_i32extscatter_epi32(nullptr, __m512i(), __m512i(), A(), 1, 0);
    return 0;
}

The expression f(A()) is not ambiguous, while _mm512_i32extscatter_epi32(..., 
A(), ...) is. This would be impossible if the fourth parameter of 
_mm512_i32extscatter_epi32 were of type _MM_DOWNCONV_EPI32_ENUM. The compiler 
error says the parameter is of type unsigned int: 'error: more than one 
conversion function from "A" to "unsigned int" applies'.

My complaint is about the type of the conv argument of 
_mm512_i32extscatter_epi32. It's unsigned int. It was _MM_DOWNCONV_EPI32_ENUM 
in previous ICC versions and it still is documented as _MM_DOWNCONV_EPI32_ENUM 
in the ICC 16 documentation.



More information about the Vc mailing list
FIAS . Impressum . Privacy