IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

mulwide

def mulwide(a: UInt32, b: UInt32) -> UInt64

Performs a wide multiplication of two 32-bit unsigned integers.

Multiplies two 32-bit unsigned integers and returns the full 64-bit result. Useful when the product may exceed 32 bits.

Note: On NVIDIA GPUs, this maps directly to the MUL.WIDE.U32 PTX instruction. On others, it performs multiplication using 64-bit casts.

Args:

  • ​a (UInt32): First 32-bit unsigned integer operand.
  • ​b (UInt32): Second 32-bit unsigned integer operand.

Returns:

UInt64: The full 64-bit product of a * b

def mulwide(a: Int32, b: Int32) -> Int64

Performs a wide multiplication of two 32-bit signed integers.

Multiplies two 32-bit signed integers and returns the full 64-bit result. Useful when the product may exceed 32 bits or be negative.

Note: On NVIDIA GPUs, this maps directly to the MUL.WIDE.S32 PTX instruction. On others, it performs multiplication using 64-bit casts.

Args:

  • ​a (Int32): First 32-bit signed integer operand.
  • ​b (Int32): Second 32-bit signed integer operand.

Returns:

Int64: The full 64-bit signed product of a * b

Was this page helpful?