# (RV64 Only) 32-bit Multiply Instructions

__STATIC_FORCEINLINE long __RV_SMBB32 (unsigned long a, unsigned long b)
__STATIC_FORCEINLINE long __RV_SMBT32 (unsigned long a, unsigned long b)
__STATIC_FORCEINLINE long __RV_SMTT32 (unsigned long a, unsigned long b)
group NMSIS_Core_DSP_Intrinsic_RV64_32B_MULT

(RV64 Only) 32-bit Multiply Instructions

there is 3 RV64 Only) 32-bit Multiply Instructions

Functions

__STATIC_FORCEINLINE long __RV_SMBB32 (unsigned long a, unsigned long b)

SMBB32 (Signed Multiply Bottom Word & Bottom Word)

Type: DSP (RV64 Only)

Syntax:

```SMBB32 Rd, Rs1, Rs2
SMBT32 Rd, Rs1, Rs2
SMTT32 Rd, Rs1, Rs2
```

Purpose

:

Multiply the signed 32-bit element of a register with the signed 32-bit element of another register and write the 64-bit result to a third register.

• SMBB32: bottom*bottom

• SMBT32: bottom*top

• SMTT32: top*top

Description

:

For the

`SMBB32` instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2. It is actually an alias of `MULSR64` instruction. For the `SMBT32` instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2. For the `SMTT32` instruction, it multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2. The 64-bit multiplication result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.

Operations:

```res = Rs1.W[0] * Rs2.W[0]; // SMBB32 res = Rs1.W[0] * Rs2.w[1]; // SMBT32 res = Rs1.W[1] * Rs2.W[1];
// SMTT32 Rd = res;
```

Parameters
• a[in] unsigned long type of value stored in a

• b[in] unsigned long type of value stored in b

Returns

value stored in long type

__STATIC_FORCEINLINE long __RV_SMBT32 (unsigned long a, unsigned long b)

SMBT32 (Signed Multiply Bottom Word & Top Word)

Type: DSP (RV64 Only)

Syntax:

```SMBB32 Rd, Rs1, Rs2
SMBT32 Rd, Rs1, Rs2
SMTT32 Rd, Rs1, Rs2
```

Purpose

:

Multiply the signed 32-bit element of a register with the signed 32-bit element of another register and write the 64-bit result to a third register.

• SMBB32: bottom*bottom

• SMBT32: bottom*top

• SMTT32: top*top

Description

:

For the

`SMBB32` instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2. It is actually an alias of `MULSR64` instruction. For the `SMBT32` instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2. For the `SMTT32` instruction, it multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2. The 64-bit multiplication result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.

Operations:

```res = Rs1.W[0] * Rs2.W[0]; // SMBB32 res = Rs1.W[0] * Rs2.w[1]; // SMBT32 res = Rs1.W[1] * Rs2.W[1];
// SMTT32 Rd = res;
```

Parameters
• a[in] unsigned long type of value stored in a

• b[in] unsigned long type of value stored in b

Returns

value stored in long type

__STATIC_FORCEINLINE long __RV_SMTT32 (unsigned long a, unsigned long b)

SMTT32 (Signed Multiply Top Word & Top Word)

Type: DSP (RV64 Only)

Syntax:

```SMBB32 Rd, Rs1, Rs2
SMBT32 Rd, Rs1, Rs2
SMTT32 Rd, Rs1, Rs2
```

Purpose

:

Multiply the signed 32-bit element of a register with the signed 32-bit element of another register and write the 64-bit result to a third register.

• SMBB32: bottom*bottom

• SMBT32: bottom*top

• SMTT32: top*top

Description

:

For the

`SMBB32` instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2. It is actually an alias of `MULSR64` instruction. For the `SMBT32` instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2. For the `SMTT32` instruction, it multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2. The 64-bit multiplication result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.

Operations:

```res = Rs1.W[0] * Rs2.W[0]; // SMBB32 res = Rs1.W[0] * Rs2.w[1]; // SMBT32 res = Rs1.W[1] * Rs2.W[1];
// SMTT32 Rd = res;
```

Parameters
• a[in] unsigned long type of value stored in a

• b[in] unsigned long type of value stored in b

Returns

value stored in long type