Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

intrinsic for mulx

gastineau
Beginner
499 Views

 

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
499 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

0 Kudos
Anoop_M_Intel
Employee
499 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

0 Kudos
Kittur_G_Intel
Employee
499 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

0 Kudos
Reply