1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>OSSetGQR[n]</title> 10</head> 11 12<body> 13 14<h1>OSSetGQR[n]</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/os.h> 19 20// GQR type formats 21#define OS_GQR_F32 0x0000 22#define OS_GQR_U8 0x0004 23#define OS_GQR_U16 0x0005 24#define OS_GQR_S8 0x0006 25#define OS_GQR_S16 0x0007 26 27// GQR scale factors 28#define OS_GQR_SCALE_NONE 0 29#define OS_GQR_SCALE_2 1 30#define OS_GQR_SCALE_4 2 31#define OS_GQR_SCALE_8 3 32#define OS_GQR_SCALE_16 4 33#define OS_GQR_SCALE_32 5 34#define OS_GQR_SCALE_64 6 35#define OS_GQR_SCALE_128 7 36#define OS_GQR_SCALE_256 8 37#define OS_GQR_SCALE_512 9 38#define OS_GQR_SCALE_1024 10 39#define OS_GQR_SCALE_2048 11 40#define OS_GQR_SCALE_4096 12 41#define OS_GQR_SCALE_8192 13 42#define OS_GQR_SCALE_16384 14 43#define OS_GQR_SCALE_32768 15 44#define OS_GQR_SCALE_65536 16 45#define OS_GQR_SCALE_MAX 31 46 47#define OS_GQR_DIVIDE_2 63 48#define OS_GQR_DIVIDE_4 62 49#define OS_GQR_DIVIDE_8 61 50#define OS_GQR_DIVIDE_16 60 51#define OS_GQR_DIVIDE_32 59 52#define OS_GQR_DIVIDE_64 58 53#define OS_GQR_DIVIDE_128 57 54#define OS_GQR_DIVIDE_256 56 55#define OS_GQR_DIVIDE_512 55 56#define OS_GQR_DIVIDE_1024 54 57#define OS_GQR_DIVIDE_2048 53 58#define OS_GQR_DIVIDE_4096 52 59#define OS_GQR_DIVIDE_8192 51 60#define OS_GQR_DIVIDE_16384 50 61#define OS_GQR_DIVIDE_32768 49 62#define OS_GQR_DIVIDE_65536 48 63#define OS_GQR_DIVIDE_MAX 32 64 65inline void OSSetGQR2(u32 type, u32 scale); 66inline void OSSetGQR3(u32 type, u32 scale); 67inline void OSSetGQR4(u32 type, u32 scale); 68inline void OSSetGQR5(u32 type, u32 scale); 69inline void OSSetGQR6(u32 type, u32 scale); 70inline void OSSetGQR7(u32 type, u32 scale); 71</pre></dd></dl> 72 73<h2>Arguments</h2> 74<TABLE class="arguments" border="1" > 75 <tr> 76<TH>type</TH> 77<TD>Data Types. The specifiable values are: <code>OS_GQR_F32, OS_GQR_S8, OS_GQR_S16, OS_GQR_U8, OS_GQR_U16</code>.</TD> 78 </tr> 79 <tr> 80<TH><STRONG><EM><CODE>scale</CODE></EM></STRONG></TH> 81<TD>Scaling coefficient. The specifiable values are: <code>OS_GQR_SCALE_* or OS_GQR_DIVIDE_*</code>.</TD> 82 </tr> 83</TABLE> 84 85<h2>Return Values</h2> 86<P>None.</P> 87 88<h2>Description</h2> 89<P>Sets a value to a GQR (quantization register) in the Broadway CPU. These register values are used to convert from floating-point to integer or vice versa with a paired single floating-point load/store instruction.</P> 90<P>The <SPAN class="argument">type</SPAN> argument defines the data type used to load floating-point values from memory or store floating-point values into memory. The <SPAN class="argument">scale</SPAN> argument defines the scale factor when a value is stored into memory as an integer value. For loading a value from memory, the inverted scale factor is applied. For example, If you use <code>OS_GQR_SCALE_4</code>, the value will be scaled by 4 when stored, and divided by 4 when loaded.)</P> 91<P>The Broadway CPU has 8 GQRs. Since GQR0 and GQR1 are reserved for the system, no APIs to modify them are available.</P> 92<P>Note: OS fast cast functions use GQR2 to GQR5. If you change them after <a href="OSInitFastCast.html"><code>OSInitFastCast</code></a> is called, such OS fast-cast functions as <a href="OSf32tos16.html"><CODE>OSf32tos16</CODE></a> and <a href="OSf32tos8.html"><CODE>OSf32tos8</CODE></a> will not behave correctly. In such a case, call the <A href="OSInitFastCast.html"><code>OSInitFastCast</code></A> function again to re-initialize the four registers.</P> 93 94<h2>See Also</h2> 95<P class="reference"> 96<a href="OSInitFastCast.html">OSInitFastCast</a>, 97<a href="OSf32tos16.html">OSf32tos16</a>, 98<a href="OSf32tos8.html">OSf32tos8</a>, 99<a href="OSf32tou16.html">OSf32tou16</a>, 100<a href="OSf32tou8.html">OSf32tou8</a>, 101<a href="OSs16tof32.html">OSs16tof32</a>, 102<a href="OSs8tof32.html">OSs8tof32</a>, 103<a href="OSu16tof32.html">OSu16tof32</a>, 104<a href="OSu8tof32.html">OSu8tof32</a> 105</p> 106 107<H2>Revision History</H2> 108<P> 1092006/03/01 Initial version.<br> 110</P> 111 112<hr><p>CONFIDENTIAL</p></body> 113</html>