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>m3x3 - 3x3 multiply</title>
9  </head>
10  <body>
11    <h1>m3x3 - 3x3 multiply</h1>
12
13    <h2>Calling Format</h2>
14    <div class="section">
15      <pre class="definition">
16m3x3    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>A temporary register, input register, or floating-point constant register.</td>
38        </tr>
39        <tr>
40          <th>src1</th>
41          <td>
42            A temporary register, an input register, or a floating-point constant register.<br>Specifies the starting register of a 3x3 matrix. (In other words, if <SPAN class="argument">src1</SPAN> is <CODE>r0</CODE>, then the 3x3 matrix is stored in <CODE>r0</CODE>, <CODE>r1</CODE>, and <CODE>r2</CODE>.)<br>
43          </td>
44        </tr>
45      </table>
46      <p class="notice">
47        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>
48      </p>
49      <p class="warning">
50        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 content of those registers will be updated during the execution of the expanded instructions.
51      </p>
52    </div>
53
54    <h2>Overview</h2>
55    <div class="section">
56      <p>
57        Stores the result of multiplying a 3x3 matrix and a 3-component vector in <CODE>dest</CODE>.<br>
58      </p>
59    </div>
60
61    <h2>Operation</h2>
62    <div class="section">
63<pre class="definition">
64src2 = Next_Index_Of ( src1 )
65src3 = Next_Index_Of ( src2 )
66dest.x = ( src0.x * src1.x ) + ( src0.y * src1.y ) + ( src0.z * src1.z )
67dest.y = ( src0.x * src2.x ) + ( src0.y * src2.y ) + ( src0.z * src2.z )
68dest.z = ( src0.x * src3.x ) + ( src0.y * src3.y ) + ( src0.z * src3.z )
69</pre>
70    </div>
71
72    <h2>Macro Expansion</h2>
73    <div class="section">
74<pre class="definition">
75dp3     dest.x, src0, src1
76dp3     dest.y, src0, src2  // src2 = next index of src1
77dp3     dest.z, src0, src3  // src3 = next index of src2
78</pre>
79    </div>
80
81    <h2>Code Example</h2>
82    <div class="section">
83<pre class="definition">
84m3x3    r0.xyz, r1, c0
85// This is expanded as follows
86// dp3     r0.x, r1, c0
87// dp3     r0.y, r1, c1
88// dp3     r0.z, r1, c2
89</pre>
90    </div>
91
92    <h2>Timetable</h2>
93    <div class="section">
94      <table class="timetable">
95        <tr>
96          <th></th>
97          <th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th>
98        </tr>
99        <tr>
100          <th>dp3</th>
101          <td class="read">read</td>
102          <td class="MUL">MUL</td>
103          <td class="ADD">ADD</td>
104          <td class="ADD">ADD</td>
105          <td class="post">post</td>
106          <td class="write">write</td>
107        </tr>
108        <tr>
109          <th>dp3</th>
110          <td class="empty"></td>
111          <td class="read">read</td>
112          <td class="MUL">MUL</td>
113          <td class="ADD">ADD</td>
114          <td class="ADD">ADD</td>
115          <td class="post">post</td>
116          <td class="write">write</td>
117        </tr>
118        <tr>
119          <th>dp3</th>
120          <td class="empty" colspan="2"></td>
121          <td class="read">read</td>
122          <td class="MUL">MUL</td>
123          <td class="ADD">ADD</td>
124          <td class="ADD">ADD</td>
125          <td class="post">post</td>
126          <td class="write">write</td>
127          <td class="dummy"></td>
128        </tr>
129      </table>
130    </div>
131
132
133  <h2>Revision History</h2>
134  <div class="section">
135    <dl class="history">
136      <dt>2011/12/20</dt>
137      <dd>Initial version.<br />
138      </dd>
139    </dl>
140  </div>
141
142  <hr><p>CONFIDENTIAL</p></body>
143</html>