m4x3 - 4x3 multiply

m4x3 - 4x3 multiply

Calling Format

m4x3    dest.xyz, src0, src1

Operands

Name Registers
dest An output register or temporary register.
Requires the mask { .xyz }.
src0 A temporary register, an input register, or a floating-point constant register.
src1 A temporary register, an input register, or a floating-point constant register.
Specifies the starting register of a 4x3 matrix. (In other words, if src1 is r0, then the 4x3 matrix is stored in r0, r1, and r2.)

You cannot specify a floating-point constant register for both src0 and src1.
You cannot specify an input register for both src0 and src1 at the same time.
You cannot specify the same register for dest and src0.

If you set dest to the registers that immediately follow src1 (this is src2, src3 in Macro Expansion below), there is no way to anticipate the result because the contents of those registers will be updated during the execution of the expanded instructions.

Overview

Stores the result of multiplying a 4x3 matrix and a 4-component vector in dest.

Operation

src2 = Next_Index_Of ( src1 )
src3 = Next_Index_Of ( src2 )
dest.x = ( src0.x * src1.x ) + ( src0.y * src1.y ) + ( src0.z * src1.z ) + ( src0.w * src1.w )
dest.y = ( src0.x * src2.x ) + ( src0.y * src2.y ) + ( src0.z * src2.z ) + ( src0.w * src2.w )
dest.z = ( src0.x * src3.x ) + ( src0.y * src3.y ) + ( src0.z * src3.z ) + ( src0.w * src3.w )

Macro Expansion

dp4     dest.x, src0, src1
dp4     dest.y, src0, src2  // src2 = next index of src1
dp4     dest.z, src0, src3  // src3 = next index of src2

Code Example

m4x3    r0.xyz, r1, c0
// This is expanded as follows
// dp4     r0.x, r1, c0
// dp4     r0.y, r1, c1
// dp4     r0.z, r1, c2

Timetable

12345678
dp4 read MUL ADD ADD post write
dp4 read MUL ADD ADD post write
dp4 read MUL ADD ADD post write

Revision History

2011/12/20
Initial version.

CONFIDENTIAL