<?xml version="1.0" ?><?xml-stylesheet type="text/xsl" encoding="UTF-8" href="iform.xsl" version="1.0"?><!DOCTYPE instructionsection  PUBLIC '-//ARM//DTD instructionsection //EN'  'iform-p.dtd'><!-- Copyright (c) 2010-2026 Arm Limited or its affiliates. All rights reserved. --><!-- This document is Non-Confidential. This document may only be used and distributed in accordance with the terms of the agreement entered into by Arm and the party that Arm delivered this document to. --><instructionsection id="FCMP_float" title="FCMP -- A64" type="instruction">
  <docvars>
    <docvar key="instr-class" value="float"/>
    <docvar key="isa" value="A64"/>
    <docvar key="mnemonic" value="FCMP"/>
  </docvars>
  <heading>FCMP</heading>
  <desc>
    <brief>
      <para>Floating-point quiet compare (scalar)</para>
    </brief>
    <authored>
      <para>This instruction compares the two SIMD&amp;FP source register values,
or the first SIMD&amp;FP source register value and zero. It writes the result to the
<xref linkend="ARMARM_PSTATE">PSTATE</xref>.{N, Z, C, V} flags.</para>
      <para>This instruction raises an Invalid Operation floating-point exception if either or both of the operands
is a signaling NaN.</para>
      <para>This instruction can generate a floating-point exception.
  Depending on the settings in <register_link id="AArch64-fpcr.xml" state="AArch64">FPCR</register_link>,
  the exception results in either a flag being set in <register_link id="AArch64-fpsr.xml" state="AArch64">FPSR</register_link>
  or a synchronous exception being generated.
  For more information, see
  <xref linkend="ARMARM_BEIJDDAG">Floating-point exceptions and exception traps</xref>.</para>
      <para>Depending on the settings in the <register_link id="AArch64-cpacr_el1.xml" state="AArch64">CPACR_EL1</register_link>,
  <register_link id="AArch64-cptr_el2.xml" state="AArch64">CPTR_EL2</register_link>, and <register_link id="AArch64-cptr_el3.xml" state="AArch64">CPTR_EL3</register_link> registers,
  and the current Security state and Exception level,
  an attempt to execute the instruction might be trapped.</para>
    </authored>
    <affected_by_sme output="NZCV condition flags"/>
  </desc>
  <operationalnotes>
    <operationalnote>
      <operationalnote_content>
        <para>The IEEE 754 standard specifies that the result of a comparison is precisely one of &lt;, ==, &gt; or unordered.  If either or both of the operands is a NaN, they are unordered, and all three of (Operand1 &lt; Operand2), (Operand1 == Operand2) and (Operand1 &gt; Operand2) are false. An unordered comparison sets the PSTATE condition flags to N=0, Z=0, C=1, and V=1.</para>
        <para>If FEAT_SME is implemented and the PE is in Streaming SVE mode, then any subsequent instruction which is dependent on the NZCV condition flags written by this instruction might be significantly delayed.</para>
      </operationalnote_content>
    </operationalnote>
  </operationalnotes>
  <alias_list howmany="0"/>
  <classes>
    <iclass name="Floating-point" oneof="1" id="iclass_floating_point" no_encodings="6" isa="A64">
      <docvars>
        <docvar key="instr-class" value="float"/>
        <docvar key="isa" value="A64"/>
        <docvar key="mnemonic" value="FCMP"/>
      </docvars>
      <iclassintro count="6"/>
      <regdiagram form="32" psname="A64.simd_dp.floatcmp.FCMP_H_floatcmp" tworows="1">
        <box hibit="31" name="M" usename="1" settings="1" psbits="x">
          <c>0</c>
        </box>
        <box hibit="30" width="1" settings="1">
          <c>0</c>
        </box>
        <box hibit="29" name="S" usename="1" settings="1" psbits="x">
          <c>0</c>
        </box>
        <box hibit="28" width="5" settings="5">
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="23" width="2" name="ftype" usename="1">
          <c colspan="2"/>
        </box>
        <box hibit="21" width="1" settings="1">
          <c>1</c>
        </box>
        <box hibit="20" width="5" name="Rm" usename="1">
          <c colspan="5"/>
        </box>
        <box hibit="15" width="2" name="op" usename="1" settings="2" psbits="xx">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="13" width="4" settings="4">
          <c>1</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="9" width="5" name="Rn" usename="1">
          <c colspan="5"/>
        </box>
        <box hibit="4" width="2" name="opc" usename="1" settings="1" psbits="xx">
          <c>0</c>
          <c>x</c>
        </box>
        <box hibit="2" width="3" settings="3">
          <c>0</c>
          <c>0</c>
          <c>0</c>
        </box>
      </regdiagram>
      <encoding name="FCMP_H_floatcmp" oneofinclass="6" oneof="6" label="Half-precision" bitdiffs="ftype == 11 &amp;&amp; opc == 00">
        <docvars>
          <docvar key="compare-with" value="cmp-reg"/>
          <docvar key="datatype" value="half"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCMP"/>
        </docvars>
        <arch_variants>
          <arch_variant feature="FEAT_FP16" name="v8Ap2"/>
        </arch_variants>
        <box hibit="23" width="2" name="ftype">
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="4" width="2" name="opc">
          <c/>
          <c>0</c>
        </box>
        <asmtemplate><text>FCMP  </text><a hover="For the &quot;Half-precision&quot; variant: is the 16-bit name of the first SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field." link="Hn">&lt;Hn&gt;</a><text>, </text><a hover="Is the 16-bit name of the second SIMD&amp;FP source register, encoded in the &quot;Rm&quot; field." link="Hm">&lt;Hm&gt;</a></asmtemplate>
      </encoding>
      <encoding name="FCMP_HZ_floatcmp" oneofinclass="6" oneof="6" label="Half-precision, zero" bitdiffs="ftype == 11 &amp;&amp; Rm == (00000) &amp;&amp; opc == 01">
        <docvars>
          <docvar key="compare-with" value="cmp-zero"/>
          <docvar key="datatype" value="half"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCMP"/>
        </docvars>
        <arch_variants>
          <arch_variant feature="FEAT_FP16" name="v8Ap2"/>
        </arch_variants>
        <box hibit="23" width="2" name="ftype">
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="20" width="5" name="Rm">
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
        </box>
        <box hibit="4" width="2" name="opc">
          <c/>
          <c>1</c>
        </box>
        <asmtemplate><text>FCMP  </text><a hover="For the &quot;Half-precision, zero&quot; variant: is the 16-bit name of the SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field." link="Hn__2">&lt;Hn&gt;</a><text>, #0.0</text></asmtemplate>
      </encoding>
      <encoding name="FCMP_S_floatcmp" oneofinclass="6" oneof="6" label="Single-precision" bitdiffs="ftype == 00 &amp;&amp; opc == 00">
        <docvars>
          <docvar key="compare-with" value="cmp-reg"/>
          <docvar key="datatype" value="single"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCMP"/>
        </docvars>
        <arch_variants>
          <arch_variant feature="FEAT_FP" name="v8Ap0"/>
        </arch_variants>
        <box hibit="23" width="2" name="ftype">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="4" width="2" name="opc">
          <c/>
          <c>0</c>
        </box>
        <asmtemplate><text>FCMP  </text><a hover="For the &quot;Single-precision&quot; variant: is the 32-bit name of the first SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field." link="Sn__3">&lt;Sn&gt;</a><text>, </text><a hover="Is the 32-bit name of the second SIMD&amp;FP source register, encoded in the &quot;Rm&quot; field." link="Sm">&lt;Sm&gt;</a></asmtemplate>
      </encoding>
      <encoding name="FCMP_SZ_floatcmp" oneofinclass="6" oneof="6" label="Single-precision, zero" bitdiffs="ftype == 00 &amp;&amp; Rm == (00000) &amp;&amp; opc == 01">
        <docvars>
          <docvar key="compare-with" value="cmp-zero"/>
          <docvar key="datatype" value="single"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCMP"/>
        </docvars>
        <arch_variants>
          <arch_variant feature="FEAT_FP" name="v8Ap0"/>
        </arch_variants>
        <box hibit="23" width="2" name="ftype">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="20" width="5" name="Rm">
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
        </box>
        <box hibit="4" width="2" name="opc">
          <c/>
          <c>1</c>
        </box>
        <asmtemplate><text>FCMP  </text><a hover="For the &quot;Single-precision, zero&quot; variant: is the 32-bit name of the SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field." link="Sn">&lt;Sn&gt;</a><text>, #0.0</text></asmtemplate>
      </encoding>
      <encoding name="FCMP_D_floatcmp" oneofinclass="6" oneof="6" label="Double-precision" bitdiffs="ftype == 01 &amp;&amp; opc == 00">
        <docvars>
          <docvar key="compare-with" value="cmp-reg"/>
          <docvar key="datatype" value="double"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCMP"/>
        </docvars>
        <arch_variants>
          <arch_variant feature="FEAT_FP" name="v8Ap0"/>
        </arch_variants>
        <box hibit="23" width="2" name="ftype">
          <c>0</c>
          <c>1</c>
        </box>
        <box hibit="4" width="2" name="opc">
          <c/>
          <c>0</c>
        </box>
        <asmtemplate><text>FCMP  </text><a hover="For the &quot;Double-precision&quot; variant: is the 64-bit name of the first SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field." link="Dn__2">&lt;Dn&gt;</a><text>, </text><a hover="Is the 64-bit name of the second SIMD&amp;FP source register, encoded in the &quot;Rm&quot; field." link="Dm">&lt;Dm&gt;</a></asmtemplate>
      </encoding>
      <encoding name="FCMP_DZ_floatcmp" oneofinclass="6" oneof="6" label="Double-precision, zero" bitdiffs="ftype == 01 &amp;&amp; Rm == (00000) &amp;&amp; opc == 01">
        <docvars>
          <docvar key="compare-with" value="cmp-zero"/>
          <docvar key="datatype" value="double"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCMP"/>
        </docvars>
        <arch_variants>
          <arch_variant feature="FEAT_FP" name="v8Ap0"/>
        </arch_variants>
        <box hibit="23" width="2" name="ftype">
          <c>0</c>
          <c>1</c>
        </box>
        <box hibit="20" width="5" name="Rm">
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
        </box>
        <box hibit="4" width="2" name="opc">
          <c/>
          <c>1</c>
        </box>
        <asmtemplate><text>FCMP  </text><a hover="For the &quot;Double-precision, zero&quot; variant: is the 64-bit name of the SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field." link="Dn">&lt;Dn&gt;</a><text>, #0.0</text></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="A64.simd_dp.floatcmp.FCMP_H_floatcmp" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">if !IsFeatureImplemented(FEAT_FP) then <a link="func_EndOfDecode_1" file="shared_pseudocode.xml">EndOfDecode</a>(<a link="enum_Decode_UNDEF" file="shared_pseudocode.xml">Decode_UNDEF</a>); end;
if ftype == '10' then <a link="func_EndOfDecode_1" file="shared_pseudocode.xml">EndOfDecode</a>(<a link="enum_Decode_UNDEF" file="shared_pseudocode.xml">Decode_UNDEF</a>); end;
if ftype == '11' &amp;&amp; !IsFeatureImplemented(FEAT_FP16) then <a link="func_EndOfDecode_1" file="shared_pseudocode.xml">EndOfDecode</a>(<a link="enum_Decode_UNDEF" file="shared_pseudocode.xml">Decode_UNDEF</a>); end;

let n : integer = UInt(Rn);
let m : integer = UInt(Rm);   // ignored when opc&lt;0&gt; == '1'

let datasize : integer{} = 8 &lt;&lt; UInt(ftype XOR '10');
let signal_all_nans : boolean = FALSE;
let cmp_with_zero : boolean = (opc[0] == '1');</pstext></ps>
      </ps_section>
    </iclass>
  </classes>
  <explanations scope="all">
    <explanation enclist="FCMP_H_floatcmp" symboldefcount="1">
      <symbol link="Hn">&lt;Hn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>For the &quot;Half-precision&quot; variant: is the 16-bit name of the first SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_HZ_floatcmp" symboldefcount="2">
      <symbol link="Hn__2">&lt;Hn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>For the &quot;Half-precision, zero&quot; variant: is the 16-bit name of the SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_H_floatcmp" symboldefcount="1">
      <symbol link="Hm">&lt;Hm&gt;</symbol>
      <account encodedin="Rm">
        <intro>
          <para>Is the 16-bit name of the second SIMD&amp;FP source register, encoded in the &quot;Rm&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_S_floatcmp" symboldefcount="1">
      <symbol link="Sn__3">&lt;Sn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>For the &quot;Single-precision&quot; variant: is the 32-bit name of the first SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_SZ_floatcmp" symboldefcount="2">
      <symbol link="Sn">&lt;Sn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>For the &quot;Single-precision, zero&quot; variant: is the 32-bit name of the SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_S_floatcmp" symboldefcount="1">
      <symbol link="Sm">&lt;Sm&gt;</symbol>
      <account encodedin="Rm">
        <intro>
          <para>Is the 32-bit name of the second SIMD&amp;FP source register, encoded in the &quot;Rm&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_D_floatcmp" symboldefcount="1">
      <symbol link="Dn__2">&lt;Dn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>For the &quot;Double-precision&quot; variant: is the 64-bit name of the first SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_DZ_floatcmp" symboldefcount="2">
      <symbol link="Dn">&lt;Dn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>For the &quot;Double-precision, zero&quot; variant: is the 64-bit name of the SIMD&amp;FP source register, encoded in the &quot;Rn&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCMP_D_floatcmp" symboldefcount="1">
      <symbol link="Dm">&lt;Dm&gt;</symbol>
      <account encodedin="Rm">
        <intro>
          <para>Is the 64-bit name of the second SIMD&amp;FP source register, encoded in the &quot;Rm&quot; field.</para>
        </intro>
      </account>
    </explanation>
  </explanations>
  <ps_section howmany="1">
    <ps name="A64.simd_dp.floatcmp.FCMP_H_floatcmp" sections="1" secttype="Operation">
      <pstext mayhavelinks="1" section="Execute" rep_section="execute"><a link="func_AArch64_CheckFPEnabled_0" file="shared_pseudocode.xml">AArch64_CheckFPEnabled</a>();

let operand1 : bits(datasize) = V{}(n);
let operand2 : bits(datasize) = if cmp_with_zero then <a link="func_FPZero_2" file="shared_pseudocode.xml">FPZero</a>{datasize}('0') else <a link="accessor_V_2" file="shared_pseudocode.xml">V</a>{datasize}(m);

PSTATE.[N,Z,C,V] = <a link="func_FPCompare_5" file="shared_pseudocode.xml">FPCompare</a>{datasize}(operand1, operand2, signal_all_nans, FPCR());</pstext></ps>
  </ps_section>
  <timestamp>2026-03-26 20:27:25</timestamp>
  <commit_id>2026-03_rel</commit_id>
</instructionsection>