Skip to main content

MulEmitter

Trait MulEmitter 

Source
pub trait MulEmitter<T0, T1, T2> {
    // Required method
    fn mul(&mut self, rd: T0, rs1: T1, rs2: T2);
}
Expand description

Signed multiply

MUL performs an XLEN-bitxXLEN-bit multiplication of rs1 by rs2 and places the lower XLEN bits in the destination register. Any overflow is thrown away.

[NOTE] If both the high and low bits of the same product are required, then the recommended code sequence is: MULH[[S]U] rdh, rs1, rs2; MUL rdl, rs1, rs2 (source register specifiers must be in same order and rdh cannot be the same as rs1 or rs2). Microarchitectures can then fuse these into a single multiply operation instead of performing two separate multiplies.

§Forms

Assembly: mul xd, xs1, xs2 Rust: mul(rd, rs1, rs2)

§Arguments

  • rd — Destination register.
  • rs1 — Source register.
  • rs2 — Source register.

Required Methods§

Source

fn mul(&mut self, rd: T0, rs1: T1, rs2: T2)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§