Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 1.47 KB

umul128.md

File metadata and controls

77 lines (54 loc) · 1.47 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: _umul128
_umul128
09/02/2019
__umul128
__umul128 intrinsic
13684df3-3ac7-467c-b258-a0e93bc490b5

_umul128

Microsoft Specific

Multiplies two 64-bit unsigned integers passed in as the first two arguments and puts the high 64 bits of the product in the 64-bit unsigned integer pointed to by HighProduct and returns the low 64 bits of the product.

Syntax

unsigned __int64 _umul128(
   unsigned __int64 Multiplier,
   unsigned __int64 Multiplicand,
   unsigned __int64 *HighProduct
);

Parameters

Multiplier
[in] The first 64-bit integer to multiply.

Multiplicand
[in] The second 64-bit integer to multiply.

HighProduct
[out] The high 64 bits of the product.

Return value

The low 64 bits of the product.

Requirements

Intrinsic Architecture Header
_umul128 x64 <intrin.h>

Example

// umul128.c
// processor: x64

#include <stdio.h>
#include <intrin.h>

#pragma intrinsic(_umul128)

int main()
{
    unsigned __int64 a = 0x0fffffffffffffffI64;
    unsigned __int64 b = 0xf0000000I64;
    unsigned __int64 c, d;

    d = _umul128(a, b, &c);

    printf_s("%#I64x * %#I64x = %#I64x%I64x\n", a, b, c, d);
}
0xfffffffffffffff * 0xf0000000 = 0xeffffffffffffff10000000

END Microsoft Specific

See also

Compiler intrinsics