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>mad - Multiply and add</title> 9 </head> 10 <body> 11 <h1>mad - Multiply and add</h1> 12 13 <h2>Calling Format</h2> 14 <div class="section"> 15 <pre class="definition"> 16mad dest, src0, src1, src2 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>An output register or temporary register.</td> 32 </tr> 33 <tr> 34 <th>src0</th> 35 <td>A temporary register or input register.</td> 36 </tr> 37 <tr> 38 <th>src1</th> 39 <td>A temporary register, input register, or floating-point constant register.</td> 40 </tr> 41 <tr> 42 <th>src2</th> 43 <td>A temporary register, input register, or floating-point constant register.</td> 44 </tr> 45 </table> 46 <p class="notice"> 47 You cannot specify a floating-point constant register for both <SPAN class="argument">src1</SPAN> and <SPAN class="argument">src2</SPAN>.<BR> You cannot specify input registers with different indices for <SPAN class="argument">src0</SPAN>, <SPAN class="argument">src1</SPAN>, and <SPAN class="argument">src2</SPAN> at the same time.<br> 48 </p> 49 </div> 50 51 <h2>Overview</h2> 52 <div class="section"> 53 <p> 54 Adds <SPAN class="argument">src2</SPAN> to the product of <SPAN class="argument">src0</SPAN> and <SPAN class="argument">src1</SPAN> and then stores the result in <SPAN class="argument">dest</SPAN>.<BR> 55 </p> 56 </div> 57 58 <h2>Operation</h2> 59 <div class="section"> 60<pre class="definition"> 61dest.x = src0.x * src1.x + src2.x 62dest.y = src0.y * src1.y + src2.y 63dest.z = src0.z * src1.z + src2.z 64dest.w = src0.w * src1.w + src2.w 65</pre> 66 </div> 67 68 <h2>Code Example</h2> 69 <div class="section"> 70<pre class="definition"> 71mad r0, r1, c1, v2 72</pre> 73 </div> 74 75 <h2>Timetable</h2> 76 <div class="section"> 77 <table class="timetable"> 78 <tr> 79 <th></th> 80 <th>1</th><th>2</th><th>3</th><th>4</th><th>5</th> 81 </tr> 82 <tr> 83 <th>mad</th> 84 <td class="read">read</td> 85 <td class="MUL">MUL</td> 86 <td class="ADD">ADD</td> 87 <td class="post">post</td> 88 <td class="write">write</td> 89 <td class="dummy"></td> 90 </tr> 91 </table> 92 </div> 93 94 95 <h2>Revision History</h2> 96 <div class="section"> 97 <dl class="history"> 98 <dt>2011/12/20</dt> 99 <dd>Initial version.<br /> 100 </dd> 101 </dl> 102 </div> 103 104 <hr><p>CONFIDENTIAL</p></body> 105</html>