⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instructions2.doc4.html

📁 A Java virtual machine instruction consists of an opcode specifying the operation to be performed, f
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title>VM Spec  </title></head><body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000><table width=100%><tr><td><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc3.html">Prev</a> | <a href="Instructions2.doc5.html">Next</a> | <a href="VMSpecIX.fm.html">Index</a></td><td align=right><i><i>The Java<sup><font size=-2>TM</font></sup> Virtual Machine Specification</i></i></td></tr></table><hr><br> <a href="Instructions2.doc.html">A</a><a href="Instructions2.doc1.html">B</a><a href="Instructions2.doc2.html">C</a><a href="Instructions2.doc3.html">D</a><a href="Instructions2.doc4.html">F</a><a href="Instructions2.doc5.html">G</a><a href="Instructions2.doc6.html">I</a><a href="Instructions2.doc7.html">J</a><a href="Instructions2.doc8.html">L</a><a href="Instructions2.doc9.html">M</a><a href="Instructions2.doc10.html">N</a><a href="Instructions2.doc11.html">P</a><a href="Instructions2.doc12.html">R</a><a href="Instructions2.doc13.html">S</a><a href="Instructions2.doc14.html">T</a><a href="Instructions2.doc15.html">W</a><a name="f2d"></a><hr><h2>f2d</h2><a name="f2d.Operation"></a><p><b>Operation</b><br><blockquote><a name="67882"></a>Convert <code>float</code> to <code>double</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67881"></a> <i>f2d</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="f2d.Forms"></a><p><b>Forms</b><br><blockquote><a name="67883"></a><i>f2d</i> = 141 (0x8d)</blockquote><p><a name="f2d.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67884"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="f2d.Description"></a><p><b>Description</b><br><blockquote><a name="67885"></a>The <i>value</i> on the top of the operand stack must be of type <code>float</code>. It is popped from the operand stack and undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>. Then <i>value'</i> is converted to a <code>double</code> <i>result</i>. This <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="f2d.Notes"></a><p><b>Notes</b><br><blockquote><a name="67886"></a>Where an <i>f2d</i> instruction is FP-strict <a href="Overview.doc.html#28905">(&#167;3.8.2)</a> it performs a widening primitive conversion <a href="Concepts.doc.html#23435">(&#167;2.6.2)</a>. Because all values of the float value set <a href="Overview.doc.html#28147">(&#167;3.3.2)</a> are exactly representable by values of the double value set <a href="Overview.doc.html#28147">(&#167;3.3.2)</a>, such a conversion is exact.</blockquote><p><blockquote><a name="452499"></a>Where an <i>f2d</i> instruction is not FP-strict, the result of the conversion may be taken from the double-extended-exponent value set; it is not necessarily rounded to the nearest representable value in the double value set. However, if the operand <i>value</i> is taken from the float-extended-exponent value set and the target result is constrained to the double value set, rounding of <i>value</i> may be required.</blockquote><p><blockquote><a name="452494"></a></blockquote><p><a name="f2i"></a><hr><h2>f2i</h2><a name="f2i.Operation"></a><p><b>Operation</b><br><blockquote><a name="67896"></a>Convert <code>float</code> to <code>int</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67895"></a> <i>f2i</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="f2i.Forms"></a><p><b>Forms</b><br><blockquote><a name="67897"></a><i>f2i</i> = 139 (0x8b)</blockquote><p><a name="f2i.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67898"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="f2i.Description"></a><p><b>Description</b><br><blockquote><a name="67899"></a>The <i>value</i> on the top of the operand stack must be of type <code>float</code>. It is popped from the operand stack and undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>. Then <i>value' </i>is converted to an <code>int</code> <i>result</i>. This <i>result</i> is pushed onto the operand stack: </blockquote><p><ul><li>If the <i>value'</i> is NaN, the <i>result</i> of the conversion is an <code>int</code> 0. <p><li>Otherwise, if the <i>value'</i> is not an infinity, it is rounded to an  integer value <i>V</i>, rounding towards zero using IEEE 754 round towards zero mode. If this integer value <i>V</i> can be represented as an <code>int</code>, then the <i>result</i> is the <code>int</code> value <em>V</em>.<p><li>Otherwise, either the <i>value'</i> must be too small (a negative value of large magnitude or negative infinity), and the <i>result</i> is the smallest representable value of type <code>int</code>, or the <i>value'</i> must be  too large (a positive value of large magnitude or positive infinity), and the <i>result</i> is the largest representable value of type <code>int</code>.</ul><a name="f2i.Notes"></a><p><b>Notes</b><br><blockquote><a name="448323"></a>The <i>f2i</i> instruction performs a narrowing primitive conversion <a href="Concepts.doc.html#26142">(&#167;2.6.3)</a>. It may lose information about the overall magnitude of <i>value'</i> and may also lose precision.</blockquote><p><a name="f2l"></a><hr><h2>f2l</h2><a name="f2l.Operation"></a><p><b>Operation</b><br><blockquote><a name="67913"></a>Convert <code>float</code> to <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67912"></a> <i>f2l</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="f2l.Forms"></a><p><b>Forms</b><br><blockquote><a name="67914"></a><i>f2l</i> = 140 (0x8c)</blockquote><p><a name="f2l.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67915"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="f2l.Description"></a><p><b>Description</b><br><blockquote><a name="67916"></a>The <i>value</i> on the top of the operand stack must be of type <code>float</code>. It is popped from the operand stack and undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>. Then <i>value' </i>is converted to a <code>long</code> <i>result</i>. This <i>result</i> is pushed onto the operand stack: </blockquote><p><ul><li>If the <i>value'</i> is NaN, the <i>result</i> of the conversion is a <code>long</code> 0. <p><li>Otherwise, if the <i>value'</i> is not an infinity, it is rounded to an  integer value <i>V</i>, rounding towards zero using IEEE 754 round towards zero mode. If this integer value <i>V</i> can be represented  as a <code>long</code>, then the <i>result</i> is the <code>long</code> value <em>V</em>.<p><li>Otherwise, either the <i>value'</i> must be too small (a negative value of large magnitude or negative infinity), and the <i>result</i> is the smallest representable value of type <code>long</code>, or the <i>value'</i> must be too large (a positive value of large magnitude or positive infinity), and the <i>result</i> is the largest representable value of type <code>long</code>.</ul><a name="f2l.Notes"></a><p><b>Notes</b><br><blockquote><a name="67920"></a>The <i>f2l</i> instruction performs a narrowing primitive conversion <a href="Concepts.doc.html#26142">(&#167;2.6.3)</a>. It may lose information about the overall magnitude of <i>value'</i> and may also lose precision.</blockquote><p><a name="fadd"></a><hr><h2>fadd</h2><a name="fadd.Operation"></a><p><b>Operation</b><br><blockquote><a name="67933"></a>Add <code>float</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67932"></a> <i>fadd</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="fadd.Forms"></a><p><b>Forms</b><br><blockquote><a name="67934"></a><i>fadd</i> = 98 (0x62)</blockquote><p><a name="fadd.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67935"></a>..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="fadd.Description"></a><p><b>Description</b><br><blockquote><a name="67936"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>float</code>. The values are popped from the operand stack and undergo value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value1'</i> and <i>value2'</i>. The <code>float</code> <i>result</i> is <i>value1' </i>+ <i>value2'</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><blockquote><a name="67937"></a>The result of an <i>fadd</i> instruction is governed by the rules of IEEE arithmetic:</blockquote><p><ul><li>If either <i>value1'</i> or <i>value2'</i> is NaN, the result is NaN.<p><li>The sum of two infinities of opposite sign is NaN.<p><li>The sum of two infinities of the same sign is the infinity of that sign.<p><li>The sum of an infinity and any finite value is equal to the infinity.<p><li>The sum of two zeroes of opposite sign is positive zero.<p><li>The sum of two zeroes of the same sign is the zero of that sign.<p><li>The sum of a zero and a nonzero finite value is equal to the nonzero value.<p><li>The sum of two nonzero finite values of the same magnitude and opposite sign is positive zero.</ul><ul><li>In the remaining cases, where neither operand is an infinity, a zero, or NaN and the values have the same sign or have different magnitudes, the sum is computed and rounded to the nearest  representable value using IEEE 754 round to nearest mode. If the magnitude is too large to represent as a <code>float</code>, we say the operation overflows; the result is then an infinity of appropriate sign. If the magnitude is too small to represent as a <code>float</code>, we say the operation underflows; the result is then a zero of appropriate sign. </ul><blockquote><a name="67947"></a>The Java virtual machine requires support of gradual underflow as defined by IEEE 754. Despite the fact that overflow, underflow, or loss of precision may occur, execution of an <i>fadd</i> instruction never throws a runtime exception.</blockquote><p><a name="faload"></a><hr><h2>faload</h2><a name="faload.Operation"></a><p><b>Operation</b><br><blockquote><a name="67957"></a>Load <code>float</code> from array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67956"></a> <i>faload</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="faload.Forms"></a><p><b>Forms</b><br><blockquote><a name="67958"></a><i>faload</i> = 48 (0x30)</blockquote><p><a name="faload.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67959"></a>..., <i>arrayref</i>, <i>index</i> <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="faload.Description"></a><p><b>Description</b><br><blockquote><a name="67960"></a>The <i>arrayref</i> must be of type <code>reference</code> and must refer to an array whose components are of type <code>float</code>. The <i>index</i> must be of type <code>int</code>. Both <i>arrayref</i> and <i>index</i> are popped from the operand stack. The <code>float</code> <i>value</i> in the component of the array at <i>index</i> is retrieved and pushed onto the operand stack.</blockquote><p><a name="faload.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="67962"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>faload</i> throws a <code>NullPointerException</code>. </blockquote><p><blockquote><a name="67963"></a>Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>faload</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.</blockquote><p><a name="fastore"></a><hr><h2>fastore</h2><a name="fastore.Operation"></a><p><b>Operation</b><br><blockquote><a name="67970"></a>Store into <code>float</code> array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67969"></a> <i>fastore</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="fastore.Forms"></a><p><b>Forms</b><br><blockquote><a name="67971"></a><i>fastore</i> = 81 (0x51)</blockquote><p><a name="fastore.Operand"></a><p><b>Operand Stack</b><br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -