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

📄 instructions2.doc4.html

📁 A Java virtual machine instruction consists of an opcode specifying the operation to be performed, f
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<blockquote><a name="67972"></a>..., <i>arrayref</i>, <i>index</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="fastore.Description"></a><p><b>Description</b><br><blockquote><a name="67973"></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>, and the <i>value</i> must be of type <code>float</code>. The <i>arrayref</i>, <i>index</i>, and <i>value</i> are popped from the operand stack. The <code>float</code> <i>value</i> undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>, and <i>value'</i> is stored as the component of the array indexed by <i>index</i>. </blockquote><p><a name="fastore.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="67975"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>fastore</i> throws a <code>NullPointerException</code>. </blockquote><p><blockquote><a name="67976"></a>Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>fastore</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.</blockquote><p><a name="fcmpop"></a><hr><h2>fcmp&lt;op&gt;</h2><a name="fcmpop.Operation"></a><p><b>Operation</b><br><blockquote><a name="67986"></a>Compare <code>float</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67985"></a> <i>fcmp&lt;op&gt;</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="fcmpop.Forms"></a><p><b>Forms</b><br><blockquote><a name="67987"></a><i>fcmpg</i> = 150 (0x96) <i>fcmpl</i> = 149 (0x95)</blockquote><p><a name="fcmpop.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67988"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="fcmpop.Description"></a><p><b>Description</b><br><blockquote><a name="96568"></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>. A floating-point comparison is performed:</blockquote><p><a name="408885"></a><ul><li>If <i>value1'</i> is greater than <i>value2'</i>, the <code>int</code> value <i>1</i> is pushed onto the operand stack. <p><a name="408886"></a><li>Otherwise, if <i>value1'</i> is equal to <i>value2'</i>, the <code>int</code> value <i>0</i> is pushed onto the operand stack.<p><a name="408887"></a><li>Otherwise, if <i>value1'</i> is less than <i>value2'</i>, the <code>int</code> value -<i>1</i> is pushed onto the operand stack. <p><a name="408888"></a><li>Otherwise, at least one of <i>value1'</i> or <i>value2'</i> is NaN. The <i>fcmpg</i> instruction pushes the <code>int</code> value <i>1</i> onto the operand stack and the <i>fcmpl</i> instruction pushes the <code>int</code> value -<i>1</i> onto the operand stack.<p></ul><blockquote><a name="67990"></a>Floating-point comparison is performed in accordance with IEEE 754. All values other than NaN are ordered, with negative infinity less than all finite values and positive infinity greater than all finite values. Positive zero and negative zero are considered equal.</blockquote><p><a name="fcmpop."></a><p><b></b><br><a name="fcmpop.Notes"></a><p><b>Notes</b><br><blockquote><a name="408942"></a>The <i>fcmpg</i> and <i>fcmpl</i> instructions differ only in their treatment of a comparison involving NaN. NaN is unordered, so any <code>float</code> comparison fails if either or both of its operands are NaN. With both <i>fcmpg</i> and <i>fcmpl</i> available, any <code>float</code> comparison may be compiled to push the same <i>result</i> onto the operand stack whether the comparison fails on non-NaN values or fails because it encountered a NaN. For more information, see <a href="Compiling.doc.html#8478">Section 7.5, "More Control Examples."</a></blockquote><p><a name="fconst_f"></a><hr><h2>fconst_&lt;f&gt;</h2><a name="fconst_f.Operation"></a><p><b>Operation</b><br><blockquote><a name="68001"></a>Push <code>float</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68000"></a> <i>fconst_&lt;f&gt;</i><td><a name="87568"></a> </Table><br></code></blockquote><p><a name="fconst_f.Forms"></a><p><b>Forms</b><br><blockquote><a name="68002"></a><i>fconst_0</i> = 11 (0xb) <i>fconst_1</i> = 12 (0xc) <i>fconst_2</i> = 13 (0xd)</blockquote><p><a name="fconst_f.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68003"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>&lt;f&gt;</i></blockquote><p><a name="fconst_f.Description"></a><p><b>Description</b><br><blockquote><a name="68004"></a>Push the <code>float</code> constant <i>&lt;f&gt;</i> (<i>0.0</i>, <i>1.0</i>, or <i>2.0</i>) onto the operand stack.</blockquote><p><a name="fdiv"></a><hr><h2>fdiv</h2><a name="fdiv.Operation"></a><p><b>Operation</b><br><blockquote><a name="68020"></a>Divide <code>float</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68019"></a> <i>fdiv</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="fdiv.Forms"></a><p><b>Forms</b><br><blockquote><a name="68021"></a><i>fdiv</i> = 110 (0x6e)</blockquote><p><a name="fdiv.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68022"></a>..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="fdiv.Description"></a><p><b>Description</b><br><blockquote><a name="68023"></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="68024"></a>The result of an <i>fdiv</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>If neither <i>value1'</i> nor <i>value2'</i> is NaN, the sign of the result is  positive if both values have the same sign, negative if the values have different signs.<p><li>Division of an infinity by an infinity results in NaN.<p><li>Division of an infinity by a finite value results in a signed infinity, with the sign-producing rule just given.<p><li>Division of a finite value by an infinity results in a signed zero, with the sign-producing rule just given.<p><li>Division of a zero by a zero results in NaN; division of zero by any other finite value results in a signed zero, with the sign-producing rule just given.<p><li>Division of a nonzero finite value by a zero results in a signed infinity, with the sign-producing rule just given.</ul><ul><li>In the remaining cases, where neither operand is an infinity, a zero, or NaN, the quotient is computed and rounded to the nearest <code>float</code> 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="68033"></a>The Java virtual machine requires support of gradual underflow as defined by IEEE 754. Despite the fact that overflow, underflow, division by zero, or loss of precision may occur, execution of an <i>fdiv</i> instruction never throws a runtime exception.</blockquote><p><a name="fload"></a><hr><h2>fload</h2><a name="fload.Operation"></a><p><b>Operation</b><br><blockquote><a name="68054"></a>Load <code>float</code> from local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68051"></a> <i>fload</i><td><a name="87568"></a> <tr><td><a name="68053"></a> <i>index</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="fload.Forms"></a><p><b>Forms</b><br><blockquote><a name="68055"></a><i>fload</i> = 23 (0x17)</blockquote><p><a name="fload.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68056"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="fload.Description"></a><p><b>Description</b><br><blockquote><a name="68057"></a>The <i>index</i> is an unsigned byte that must be an index into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The local variable at <i>index</i> must contain a <code>float</code>. The <i>value</i> of the local variable at <i>index</i> is pushed onto the operand stack.</blockquote><p><a name="fload.Notes"></a><p><b>Notes</b><br><blockquote><a name="68061"></a>The <i>fload</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index.</blockquote><p><a name="fload_n"></a><hr><h2>fload_&lt;n&gt;</h2><a name="fload_n.Operation"></a><p><b>Operation</b><br><blockquote><a name="68071"></a>Load <code>float</code> from local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68070"></a> <i>fload_&lt;n&gt;</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="fload_n.Forms"></a><p><b>Forms</b><br><blockquote><a name="68072"></a><i>fload_0</i> = 34 (0x22) <i>fload_1</i> = 35 (0x23) <i>fload_2</i> = 36 (0x24) <i>fload_3</i> = 37 (0x25)</blockquote><p><a name="fload_n.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68073"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="fload_n.Description"></a><p><b>Description</b><br><blockquote><a name="68074"></a>The <i>&lt;n&gt;</i> must be an index into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The local variable at <i>&lt;n&gt;</i> must contain a <code>float</code>. The <i>value</i> of the local variable at <i>&lt;n&gt; </i>is pushed onto the operand stack.</blockquote><p><a name="fload_n.Notes"></a><p><b>Notes</b><br><blockquote><a name="68078"></a>Each of the <i>fload_&lt;n&gt;</i> instructions is the same as <i>fload</i> with an <i>index</i> of <i>&lt;n&gt;</i>, except that the operand <i>&lt;n&gt;</i> is implicit.</blockquote><p><a name="fmul"></a><hr><h2>fmul</h2><a name="fmul.Operation"></a><p><b>Operation</b><br><blockquote><a name="68085"></a>Multiply <code>float</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68084"></a> <i>fmul</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="fmul.Forms"></a><p><b>Forms</b><br><blockquote><a name="68086"></a><i>fmul</i> = 106 (0x6a)</blockquote><p><a name="fmul.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68087"></a>..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="fmul.Description"></a><p><b>Description</b><br><blockquote><a name="68088"></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="68089"></a>The result of an <i>fmul</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>If neither <i>value1'</i> nor <i>value2'</i> is NaN, the sign of the result is  positive if both values have the same sign, and negative if the  values have different signs.<p><li>Multiplication of an infinity by a zero results in NaN.<p><li>Multiplication of an infinity by a finite value results in a signed infinity, with the sign-producing rule just given.<p><li>In the remaining cases, where neither an infinity nor NaN is involved, the product 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="68095"></a>

⌨️ 快捷键说明

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