1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7    <link rel="stylesheet" href="../css/timetable.css" type="text/css" />
8    <title>m4x3 - 4x3 multiply</title>
9  </head>
10  <body>
11    <h1>m4x3 - 4x3 multiply</h1>
12
13    <h2>Calling Format</h2>
14    <div class="section">
15      <pre class="definition">
16m4x3    dest.xyz, src0, src1
17</pre>
18    </div>
19
20    <h2>Operands</h2>
21    <div class="section">
22      <table class="arguments">
23        <thead>
24          <tr>
25            <th>Name</th>
26            <td>Registers</td>
27          </tr>
28        </thead>
29        <tr>
30          <th>dest</th>
31          <td>
32            An output register or temporary register.<br>Requires the mask { .xyz }.<br>
33          </td>
34        </tr>
35        <tr>
36          <th>src0</th>
37          <td>
38            A temporary register, an input register, or a floating-point constant register.<br>
39          </td>
40        </tr>
41        <tr>
42          <th>src1</th>
43          <td>
44            A temporary register, an input register, or a floating-point constant register.<br>Specifies the starting register of a 4x3 matrix. (In other words, if <SPAN class="argument">src1</SPAN> is <CODE>r0</CODE>, then the 4x3 matrix is stored in <CODE>r0</CODE>, <CODE>r1</CODE>, and <CODE>r2</CODE>.)<br>
45          </td>
46        </tr>
47      </table>
48      <p class="notice">
49        You cannot specify a floating-point constant register for both <SPAN class="argument">src0</SPAN> and <SPAN class="argument">src1</SPAN>.<br> You cannot specify an input register for both <SPAN class="argument">src0</SPAN> and <SPAN class="argument">src1</SPAN> at the same time.<br> You cannot specify the same register for <SPAN class="argument">dest</SPAN> and <SPAN class="argument">src0</SPAN>.<br>
50      </p>
51      <p class="warning">
52        If you set <SPAN class="argument">dest</SPAN> to the registers that immediately follow <SPAN class="argument">src1</SPAN> (this is <SPAN class="argument">src2</SPAN>, <SPAN class="argument">src3</SPAN> 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.<br>
53      </p>
54    </div>
55
56    <h2>Overview</h2>
57    <div class="section">
58      <p>
59        Stores the result of multiplying a 4x3 matrix and a 4-component vector in <CODE>dest</CODE>.<br>
60      </p>
61    </div>
62
63    <h2>Operation</h2>
64    <div class="section">
65<pre class="definition">
66src2 = Next_Index_Of ( src1 )
67src3 = Next_Index_Of ( src2 )
68dest.x = ( src0.x * src1.x ) + ( src0.y * src1.y ) + ( src0.z * src1.z ) + ( src0.w * src1.w )
69dest.y = ( src0.x * src2.x ) + ( src0.y * src2.y ) + ( src0.z * src2.z ) + ( src0.w * src2.w )
70dest.z = ( src0.x * src3.x ) + ( src0.y * src3.y ) + ( src0.z * src3.z ) + ( src0.w * src3.w )
71</pre>
72    </div>
73
74    <h2>Macro Expansion</h2>
75    <div class="section">
76<pre class="definition">
77dp4     dest.x, src0, src1
78dp4     dest.y, src0, src2  // src2 = next index of src1
79dp4     dest.z, src0, src3  // src3 = next index of src2
80</pre>
81    </div>
82
83    <h2>Code Example</h2>
84    <div class="section">
85<pre class="definition">
86m4x3    r0.xyz, r1, c0
87// This is expanded as follows
88// dp4     r0.x, r1, c0
89// dp4     r0.y, r1, c1
90// dp4     r0.z, r1, c2
91</pre>
92    </div>
93
94    <h2>Timetable</h2>
95    <div class="section">
96      <table class="timetable">
97        <tr>
98          <th></th>
99          <th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th>
100        </tr>
101        <tr>
102          <th>dp4</th>
103          <td class="read">read</td>
104          <td class="MUL">MUL</td>
105          <td class="ADD">ADD</td>
106          <td class="ADD">ADD</td>
107          <td class="post">post</td>
108          <td class="write">write</td>
109        </tr>
110        <tr>
111          <th>dp4</th>
112          <td class="empty"></td>
113          <td class="read">read</td>
114          <td class="MUL">MUL</td>
115          <td class="ADD">ADD</td>
116          <td class="ADD">ADD</td>
117          <td class="post">post</td>
118          <td class="write">write</td>
119        </tr>
120        <tr>
121          <th>dp4</th>
122          <td class="empty" colspan="2"></td>
123          <td class="read">read</td>
124          <td class="MUL">MUL</td>
125          <td class="ADD">ADD</td>
126          <td class="ADD">ADD</td>
127          <td class="post">post</td>
128          <td class="write">write</td>
129          <td class="dummy"></td>
130        </tr>
131      </table>
132    </div>
133
134
135  <h2>Revision History</h2>
136  <div class="section">
137    <dl class="history">
138      <dt>2011/12/20</dt>
139      <dd>Initial version.<br />
140      </dd>
141    </dl>
142  </div>
143
144  <hr><p>CONFIDENTIAL</p></body>
145</html>