Community
cancel
Showing results for 
Search instead for 
Did you mean: 
gastineau
Beginner
134 Views

intrinsic for mulx

 

Hello,

I read the white paper "New Instructions Support Large Integer Arithmetic". I read that the umul128  intrinsic compiler will provide the instruction mulx to perform the full product of two integers.

But I can't find any reference in the compiler C++ (2015.1.108) documentation.

Is the intrinsic available for mulx using the intel c++ compiler ?

Or how I can replace it with an asm instruction ? An example is welcome for the multiplication of two 64-bits integers.

 

Mickaël

0 Kudos
3 Replies
JenniferJ
Moderator
134 Views

Please check this intrinsics web app: https://software.intel.com/sites/landingpage/IntrinsicsGuide/

You can search for Multiply, and filter out by SSE2 and one by one to find the right one for you.

Jennifer

Anoop_M_Intel
Employee
134 Views

The intrinsic which generates mulx instruction for 64 bit Integer multiplication is _mulx_u64(). Below is an example for the same:

#include <stdio.h>
int main()
{
    unsigned __int64 a = 0x0fffffffffffffff;
    unsigned __int64 b = 0xf0000000;
    unsigned __int64 c, d;
    d = _mulx_u64(a, b, &c);
    printf_s("%#I64x * %#I64x = %#I64x%I64x\n", a, b, c, d);
}

This intrinsic is also supported on Microsoft Visual Studio Compiler. We are working on updating the white paper (New Instructions Support Large Integer Arithmetic) with the right intrinsic. Thanks for bringing this to our attention.

Regards
Anoop

Kittur_G_Intel
Employee
134 Views

BTW, just a note that the compiler manual is the official reference for intrinsics but the intrinsics web app page link provided above is  a secondary resource mainly targeted at searching/filtering intrinsics. It is kept in sync with the compiler and should include all intrinsics included in the Intel Compiler headers, and any new ones that are added immediately upon release. Therefore, pointing out any missing intrinsic released for public consumption is much appreciated.

_Kittur

Reply