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>OSf32tos16</title> 10</head> 11 12<body> 13 14<h1>OSf32tos16</h1> 15 16 17<h2>C Specification</h2> 18<BLOCKQUOTE> 19<pre><CODE> 20#include <revolution/os.h> 21 22<code>inline void OSf32tos16(f32* in, s16* out);</code> 23</CODE></pre> 24</BLOCKQUOTE> 25<h2>Arguments</h2> 26<TABLE border="1" cellpadding="3" cellspacing="0.1"> 27 <tr> 28<TD width="120" bgcolor="#ffffe8"><em><strong><code><STRONG><EM><CODE>in</CODE></EM></STRONG></code></strong></em></TD> 29<TD width="520">Pointer to the 32-bit floating point value to convert.</TD> 30 </tr> 31 <tr> 32<TD width="120" bgcolor="#ffffe8"><strong><em><code><STRONG><EM><CODE>out</CODE></EM></STRONG></code></em></strong></TD> 33<TD width="520">Pointer to the signed 16-bit value to store.</TD> 34 </tr> 35</TABLE> 36<h2>Return Values</h2> 37 38<p>None.</p> 39<H2>Description</H2> 40<P>Fast converts a single precision floating point value into a signed 16-bit integer in two cycles (using a load and store).</P> 41<P>The <a href="OSInitFastCast.html"><code>OSInitFastCast</code></a> function must be called before invoking this function.</P> 42<P>In the standard debug builds, this function and all other fast cast functions will not be inline-expanded.</P> 43<P>This function takes addresses as arguments to load/store instructions. Taking addresses as arguments ensures that the compiler will reserve space on the stack (rather than forcing the programmer or the inline function to allocate space). The stack-allocated variables will likely be in the cache.</P> 44 45 46 47<h2>See Also</h2> 48 49<p><code><a href="OSInitFastCast.html">OSInitFastCast</a>, <a href="OSf32tos16.html">OSf32tos16</a>, <a href="OSf32tos8.html">OSf32tos8</a>, <a href="OSf32tou16.html">OSf32tou16</a>, <a href="OSf32tou8.html">OSf32tou8</a>, <a href="OSs16tof32.html">OSs16tof32</a>, <a href="OSs8tof32.html">OSs8tof32</a>, <a href="OSu16tof32.html">OSu16tof32</a>, <a href="OSu8tof32.html">OSu8tof32</a></code></p> 50<H2>Revision History</H2> 51<P>2006/03/01 Initial version.</P> 52<hr> 53<P>CONFIDENTIAL</p> 54</BODY> 55</HTML>