Declarations for the types used by Intel in the instrinsics guide?












2















Where are the declarations for the types used by the Intel intrinsic functions, according to the Intrinsics Guide?



For example, _mm_stream_si64 is defined as:



void _mm_stream_si64 (__int64* mem_addr, __int64 a)


However, after including <immintrin.h> on gcc on Linux, the type __int64 does not exist.










share|improve this question


















  • 1





    GCC/clang's intrinsics are mostly compatible with ICC's documentation, but I think they don't provide that type. IIRC, they use a normal int64_t instead for the declaration of intrinsics that Intel defines with __int64.

    – Peter Cordes
    Nov 22 '18 at 20:23






  • 1





    @PeterCordes that was the first thing I tried, but int64_t doesn't work either, because mem_addr in that function is declared as long long *, and you can't convert int64_t * to that (at least you can't if your compiler is strict). So it seems hard to write portable code here...

    – BeeOnRope
    Nov 22 '18 at 21:28








  • 1





    Oops, I knew it was some standard type. Why can't you just use long long, then? Is it not alias-compatible with __int64 on ICC and/or MSVC? It's portably 64-bit on all compilers that support Intel intrinsics, in 32 and 64 bit mode. (64-bit movnti is only available in 64-bit mode, but possibly relevant for other intrinsics. Although usually the ones that can do 64-bit things in 32-bit mode use __m64)

    – Peter Cordes
    Nov 22 '18 at 21:45








  • 1





    @PeterCordes - yeah I guess I can just use long long (that's what I'm currently doing anyway). My concern was say that on Windows something like __int64 might be long int or whatever and then I'd have the reverse problem there. Of course it isn't, it seems to be long long there. It's a bit annoying you can't look at the guide and know what types to use though (why don't they just declare it as long long or at least define the types they use? seems Windows-centric).

    – BeeOnRope
    Nov 22 '18 at 22:05








  • 1





    Be careful with that; IIRC __int64 is the same as long on Windows and most Linux machines, but it's long long on macOS. The mismatch can cause some problems (for example, it bit me here). Basically the best thing you can do is just use the types Intel's (IMHO very poorly designed) API specifies, and cast as necessary so your API can use more reasonable types.

    – nemequ
    Nov 25 '18 at 6:24
















2















Where are the declarations for the types used by the Intel intrinsic functions, according to the Intrinsics Guide?



For example, _mm_stream_si64 is defined as:



void _mm_stream_si64 (__int64* mem_addr, __int64 a)


However, after including <immintrin.h> on gcc on Linux, the type __int64 does not exist.










share|improve this question


















  • 1





    GCC/clang's intrinsics are mostly compatible with ICC's documentation, but I think they don't provide that type. IIRC, they use a normal int64_t instead for the declaration of intrinsics that Intel defines with __int64.

    – Peter Cordes
    Nov 22 '18 at 20:23






  • 1





    @PeterCordes that was the first thing I tried, but int64_t doesn't work either, because mem_addr in that function is declared as long long *, and you can't convert int64_t * to that (at least you can't if your compiler is strict). So it seems hard to write portable code here...

    – BeeOnRope
    Nov 22 '18 at 21:28








  • 1





    Oops, I knew it was some standard type. Why can't you just use long long, then? Is it not alias-compatible with __int64 on ICC and/or MSVC? It's portably 64-bit on all compilers that support Intel intrinsics, in 32 and 64 bit mode. (64-bit movnti is only available in 64-bit mode, but possibly relevant for other intrinsics. Although usually the ones that can do 64-bit things in 32-bit mode use __m64)

    – Peter Cordes
    Nov 22 '18 at 21:45








  • 1





    @PeterCordes - yeah I guess I can just use long long (that's what I'm currently doing anyway). My concern was say that on Windows something like __int64 might be long int or whatever and then I'd have the reverse problem there. Of course it isn't, it seems to be long long there. It's a bit annoying you can't look at the guide and know what types to use though (why don't they just declare it as long long or at least define the types they use? seems Windows-centric).

    – BeeOnRope
    Nov 22 '18 at 22:05








  • 1





    Be careful with that; IIRC __int64 is the same as long on Windows and most Linux machines, but it's long long on macOS. The mismatch can cause some problems (for example, it bit me here). Basically the best thing you can do is just use the types Intel's (IMHO very poorly designed) API specifies, and cast as necessary so your API can use more reasonable types.

    – nemequ
    Nov 25 '18 at 6:24














2












2








2








Where are the declarations for the types used by the Intel intrinsic functions, according to the Intrinsics Guide?



For example, _mm_stream_si64 is defined as:



void _mm_stream_si64 (__int64* mem_addr, __int64 a)


However, after including <immintrin.h> on gcc on Linux, the type __int64 does not exist.










share|improve this question














Where are the declarations for the types used by the Intel intrinsic functions, according to the Intrinsics Guide?



For example, _mm_stream_si64 is defined as:



void _mm_stream_si64 (__int64* mem_addr, __int64 a)


However, after including <immintrin.h> on gcc on Linux, the type __int64 does not exist.







x86 intel sse intrinsics






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 20:04









BeeOnRopeBeeOnRope

25.3k875173




25.3k875173








  • 1





    GCC/clang's intrinsics are mostly compatible with ICC's documentation, but I think they don't provide that type. IIRC, they use a normal int64_t instead for the declaration of intrinsics that Intel defines with __int64.

    – Peter Cordes
    Nov 22 '18 at 20:23






  • 1





    @PeterCordes that was the first thing I tried, but int64_t doesn't work either, because mem_addr in that function is declared as long long *, and you can't convert int64_t * to that (at least you can't if your compiler is strict). So it seems hard to write portable code here...

    – BeeOnRope
    Nov 22 '18 at 21:28








  • 1





    Oops, I knew it was some standard type. Why can't you just use long long, then? Is it not alias-compatible with __int64 on ICC and/or MSVC? It's portably 64-bit on all compilers that support Intel intrinsics, in 32 and 64 bit mode. (64-bit movnti is only available in 64-bit mode, but possibly relevant for other intrinsics. Although usually the ones that can do 64-bit things in 32-bit mode use __m64)

    – Peter Cordes
    Nov 22 '18 at 21:45








  • 1





    @PeterCordes - yeah I guess I can just use long long (that's what I'm currently doing anyway). My concern was say that on Windows something like __int64 might be long int or whatever and then I'd have the reverse problem there. Of course it isn't, it seems to be long long there. It's a bit annoying you can't look at the guide and know what types to use though (why don't they just declare it as long long or at least define the types they use? seems Windows-centric).

    – BeeOnRope
    Nov 22 '18 at 22:05








  • 1





    Be careful with that; IIRC __int64 is the same as long on Windows and most Linux machines, but it's long long on macOS. The mismatch can cause some problems (for example, it bit me here). Basically the best thing you can do is just use the types Intel's (IMHO very poorly designed) API specifies, and cast as necessary so your API can use more reasonable types.

    – nemequ
    Nov 25 '18 at 6:24














  • 1





    GCC/clang's intrinsics are mostly compatible with ICC's documentation, but I think they don't provide that type. IIRC, they use a normal int64_t instead for the declaration of intrinsics that Intel defines with __int64.

    – Peter Cordes
    Nov 22 '18 at 20:23






  • 1





    @PeterCordes that was the first thing I tried, but int64_t doesn't work either, because mem_addr in that function is declared as long long *, and you can't convert int64_t * to that (at least you can't if your compiler is strict). So it seems hard to write portable code here...

    – BeeOnRope
    Nov 22 '18 at 21:28








  • 1





    Oops, I knew it was some standard type. Why can't you just use long long, then? Is it not alias-compatible with __int64 on ICC and/or MSVC? It's portably 64-bit on all compilers that support Intel intrinsics, in 32 and 64 bit mode. (64-bit movnti is only available in 64-bit mode, but possibly relevant for other intrinsics. Although usually the ones that can do 64-bit things in 32-bit mode use __m64)

    – Peter Cordes
    Nov 22 '18 at 21:45








  • 1





    @PeterCordes - yeah I guess I can just use long long (that's what I'm currently doing anyway). My concern was say that on Windows something like __int64 might be long int or whatever and then I'd have the reverse problem there. Of course it isn't, it seems to be long long there. It's a bit annoying you can't look at the guide and know what types to use though (why don't they just declare it as long long or at least define the types they use? seems Windows-centric).

    – BeeOnRope
    Nov 22 '18 at 22:05








  • 1





    Be careful with that; IIRC __int64 is the same as long on Windows and most Linux machines, but it's long long on macOS. The mismatch can cause some problems (for example, it bit me here). Basically the best thing you can do is just use the types Intel's (IMHO very poorly designed) API specifies, and cast as necessary so your API can use more reasonable types.

    – nemequ
    Nov 25 '18 at 6:24








1




1





GCC/clang's intrinsics are mostly compatible with ICC's documentation, but I think they don't provide that type. IIRC, they use a normal int64_t instead for the declaration of intrinsics that Intel defines with __int64.

– Peter Cordes
Nov 22 '18 at 20:23





GCC/clang's intrinsics are mostly compatible with ICC's documentation, but I think they don't provide that type. IIRC, they use a normal int64_t instead for the declaration of intrinsics that Intel defines with __int64.

– Peter Cordes
Nov 22 '18 at 20:23




1




1





@PeterCordes that was the first thing I tried, but int64_t doesn't work either, because mem_addr in that function is declared as long long *, and you can't convert int64_t * to that (at least you can't if your compiler is strict). So it seems hard to write portable code here...

– BeeOnRope
Nov 22 '18 at 21:28







@PeterCordes that was the first thing I tried, but int64_t doesn't work either, because mem_addr in that function is declared as long long *, and you can't convert int64_t * to that (at least you can't if your compiler is strict). So it seems hard to write portable code here...

– BeeOnRope
Nov 22 '18 at 21:28






1




1





Oops, I knew it was some standard type. Why can't you just use long long, then? Is it not alias-compatible with __int64 on ICC and/or MSVC? It's portably 64-bit on all compilers that support Intel intrinsics, in 32 and 64 bit mode. (64-bit movnti is only available in 64-bit mode, but possibly relevant for other intrinsics. Although usually the ones that can do 64-bit things in 32-bit mode use __m64)

– Peter Cordes
Nov 22 '18 at 21:45







Oops, I knew it was some standard type. Why can't you just use long long, then? Is it not alias-compatible with __int64 on ICC and/or MSVC? It's portably 64-bit on all compilers that support Intel intrinsics, in 32 and 64 bit mode. (64-bit movnti is only available in 64-bit mode, but possibly relevant for other intrinsics. Although usually the ones that can do 64-bit things in 32-bit mode use __m64)

– Peter Cordes
Nov 22 '18 at 21:45






1




1





@PeterCordes - yeah I guess I can just use long long (that's what I'm currently doing anyway). My concern was say that on Windows something like __int64 might be long int or whatever and then I'd have the reverse problem there. Of course it isn't, it seems to be long long there. It's a bit annoying you can't look at the guide and know what types to use though (why don't they just declare it as long long or at least define the types they use? seems Windows-centric).

– BeeOnRope
Nov 22 '18 at 22:05







@PeterCordes - yeah I guess I can just use long long (that's what I'm currently doing anyway). My concern was say that on Windows something like __int64 might be long int or whatever and then I'd have the reverse problem there. Of course it isn't, it seems to be long long there. It's a bit annoying you can't look at the guide and know what types to use though (why don't they just declare it as long long or at least define the types they use? seems Windows-centric).

– BeeOnRope
Nov 22 '18 at 22:05






1




1





Be careful with that; IIRC __int64 is the same as long on Windows and most Linux machines, but it's long long on macOS. The mismatch can cause some problems (for example, it bit me here). Basically the best thing you can do is just use the types Intel's (IMHO very poorly designed) API specifies, and cast as necessary so your API can use more reasonable types.

– nemequ
Nov 25 '18 at 6:24





Be careful with that; IIRC __int64 is the same as long on Windows and most Linux machines, but it's long long on macOS. The mismatch can cause some problems (for example, it bit me here). Basically the best thing you can do is just use the types Intel's (IMHO very poorly designed) API specifies, and cast as necessary so your API can use more reasonable types.

– nemequ
Nov 25 '18 at 6:24












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437453%2fdeclarations-for-the-types-used-by-intel-in-the-instrinsics-guide%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437453%2fdeclarations-for-the-types-used-by-intel-in-the-instrinsics-guide%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

Refactoring coordinates for Minecraft Pi buildings written in Python