<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://www.alphalinux.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Floating-Point_Instruction_Extension</id>
	<title>Floating-Point Instruction Extension - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.alphalinux.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Floating-Point_Instruction_Extension"/>
	<link rel="alternate" type="text/html" href="http://www.alphalinux.org/wiki/index.php?title=Floating-Point_Instruction_Extension&amp;action=history"/>
	<updated>2026-05-05T05:38:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>http://www.alphalinux.org/wiki/index.php?title=Floating-Point_Instruction_Extension&amp;diff=85&amp;oldid=prev</id>
		<title>Gareth: Imported from http://web.archive.org/web/20100713091534/http://www.alphalinux.org/wiki/index.php?title=Floating-Point_Instruction_Extension&amp;action=edit</title>
		<link rel="alternate" type="text/html" href="http://www.alphalinux.org/wiki/index.php?title=Floating-Point_Instruction_Extension&amp;diff=85&amp;oldid=prev"/>
		<updated>2019-08-29T18:22:01Z</updated>

		<summary type="html">&lt;p&gt;Imported from http://web.archive.org/web/20100713091534/http://www.alphalinux.org/wiki/index.php?title=Floating-Point_Instruction_Extension&amp;amp;action=edit&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Initially implemented in the [[Processors#EV6|EV6]] processor, the Floating-Point Instruction Extension adds nine instructions to calculate the square root and to transfer data directly between floating-point and integer registers.&lt;br /&gt;
&lt;br /&gt;
On previous generations, such as the [[Processors#EV5|EV5]], in order to copy data from a floating-point register to an integer register or vice versa, a temporary memory location must be used. Since memory is orders of magnitude slower than registers, this made transferring data between the register classes very slow and inefficient. Square root calculations must be done (slowly) in software without this extension, making programming more difficult.&lt;br /&gt;
&lt;br /&gt;
== Added Instructions ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:97%;&amp;quot;&lt;br /&gt;
! Mnemonic&lt;br /&gt;
! Description&lt;br /&gt;
! Floating-Point Format&lt;br /&gt;
|-&lt;br /&gt;
! itofs&lt;br /&gt;
| Copy Low 32 bits from Integer Register to Floating-Point Register using S_floating Format || IEEE&lt;br /&gt;
|-&lt;br /&gt;
! itoft&lt;br /&gt;
| Copy 64 bits from Integer Register to Floating-Point Register || IEEE&lt;br /&gt;
|-&lt;br /&gt;
! itoff&lt;br /&gt;
| Copy Low 32 bits from Integer Register to Floating-Point Register using F_floating Format || VAX&lt;br /&gt;
|-&lt;br /&gt;
! ftois&lt;br /&gt;
| Copy Floating-Point Register using S_floating Format to Integer Register || IEEE&lt;br /&gt;
|-&lt;br /&gt;
! ftoit&lt;br /&gt;
| Copy 64 bits from Floating-Point Register to Integer Register || IEEE&lt;br /&gt;
|-&lt;br /&gt;
! sqrts&lt;br /&gt;
| Calculate square root of S_floating Formatted Value || IEEE&lt;br /&gt;
|-&lt;br /&gt;
! sqrtt&lt;br /&gt;
| Calculate square root of T_floating Formatted Value || IEEE&lt;br /&gt;
|-&lt;br /&gt;
! sqrtf&lt;br /&gt;
| Calculate square root of F_floating Formatted Value || VAX&lt;br /&gt;
|-&lt;br /&gt;
! sqrtg&lt;br /&gt;
| Calculate square root of G_floating Formatted Value || VAX&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Determining Presence ==&lt;br /&gt;
&lt;br /&gt;
To determine the presence of FIX, use the [[amask]] instruction.&lt;br /&gt;
&lt;br /&gt;
== Latency and Slotting ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:97%;&amp;quot;&lt;br /&gt;
! Instruction&lt;br /&gt;
! Precision&lt;br /&gt;
! Latency&lt;br /&gt;
! Slotting&lt;br /&gt;
|-&lt;br /&gt;
! itof&lt;br /&gt;
| &amp;amp;nbsp; || 4 || L0, L1&lt;br /&gt;
|-&lt;br /&gt;
! ftoi&lt;br /&gt;
| &amp;amp;nbsp; || 3 || FST0, FST1, L0, L1&lt;br /&gt;
|-&lt;br /&gt;
! fsqrt&lt;br /&gt;
| Single || 18 || FA&lt;br /&gt;
|-&lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
| Double || 33 || FA&amp;lt;ref&amp;gt;{{cite web|url=http://h18002.www1.hp.com/alphaserver/technology/literature/cmpwrgd.pdf|title=Compiler Writer’s Guide for the Alpha 21264|year=1999|month=June|format=PDF|publisher=Compaq Computer Corporation|pages=35-38}}&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The latency of '''fsqrt''' instructions also depends on the slotting of the instruction consuming the result. If the consuming instruction is also slotted FA, then the latency is reduced by 3. That is, the latency of '''fsqrtt''' in the following example is 30 since '''faddt''' is slotted FA.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fsqrtt $f0,$f1     ; $f1 = sqrt($f0)&lt;br /&gt;
faddt  $f1,$f2,$f3 ; $f3 = $f1 + $f2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''fsqrt''' instructions are not pipelined.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Data Movement ===&lt;br /&gt;
&lt;br /&gt;
In order to copy data from an integer register to a floating-point register on Alphas prior to the EV6, a sequence similar to the following must be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;stq Rs,temp&lt;br /&gt;
ldt Fd,temp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''Rs'' is the integer register source, ''temp'' is the temporary memory location, and ''Fd'' is the floating-point register source.&lt;br /&gt;
&lt;br /&gt;
With FIX, this code is replaced by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;itoft Rs,Fd&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Square Root ===&lt;br /&gt;
&lt;br /&gt;
To calculate the square root on Alphas prior to the EV6, a [http://en.wikipedia.org/wiki/Methods_of_computing_square_roots routine] must be written in software.&lt;br /&gt;
&lt;br /&gt;
Using FIX, the square root can be calculated with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sqrtt Fs,Fd&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''Fs'' is the floating-point register source and ''Fd'' is the floating-point register destination.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]]&lt;/div&gt;</summary>
		<author><name>Gareth</name></author>
		
	</entry>
</feed>