<?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-2025 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="FCVTZS_sisd" title="FCVTZS (scalar SIMD&amp;FP) -- A64" type="instruction">
  <docvars>
    <docvar key="instr-class" value="float"/>
    <docvar key="isa" value="A64"/>
    <docvar key="mnemonic" value="FCVTZS"/>
  </docvars>
  <heading>FCVTZS (scalar SIMD&amp;FP)</heading>
  <desc>
    <brief>
      <para>Floating-point convert to signed integer, rounding toward zero (scalar SIMD&amp;FP)</para>
    </brief>
    <authored>
      <para>This instruction converts the floating-point value in the SIMD&amp;FP source
register to a 32-bit or 64-bit signed integer using
the Round toward Zero rounding mode, and writes the result to the
SIMD&amp;FP destination register.</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>
  </desc>
  <alias_list howmany="0"/>
  <classes>
    <iclass name="Floating-point" oneof="1" id="iclass_floating_point" no_encodings="4" isa="A64">
      <docvars>
        <docvar key="instr-class" value="float"/>
        <docvar key="isa" value="A64"/>
        <docvar key="mnemonic" value="FCVTZS"/>
      </docvars>
      <iclassintro count="4"/>
      <arch_variants>
        <arch_variant feature="FEAT_FPRCVT" name="v9Ap6"/>
      </arch_variants>
      <regdiagram form="32" psname="A64.simd_dp.float2int.FCVTZS_sisd_32H" tworows="1">
        <box hibit="31" width="1" name="sf" usename="1">
          <c colspan="1"/>
        </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="2" name="rmode" usename="1" settings="2" psbits="xx">
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="18" width="3" name="opcode" usename="1" settings="3" psbits="xxx">
          <c>1</c>
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="15" width="6" settings="6">
          <c>0</c>
          <c>0</c>
          <c>0</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="5" name="Rd" usename="1">
          <c colspan="5"/>
        </box>
      </regdiagram>
      <encoding name="FCVTZS_sisd_32H" oneofinclass="4" oneof="4" label="Half-precision to 32-bit" bitdiffs="sf == 0 &amp;&amp; ftype == 11">
        <docvars>
          <docvar key="convert-type" value="half-to-single"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCVTZS"/>
        </docvars>
        <box hibit="31" width="1" name="sf">
          <c>0</c>
        </box>
        <box hibit="23" width="2" name="ftype">
          <c>1</c>
          <c>1</c>
        </box>
        <asmtemplate><text>FCVTZS  </text><a hover="Is the 32-bit name of the SIMD&amp;FP destination register, encoded in the &quot;Rd&quot; field." link="Sd">&lt;Sd&gt;</a><text>, </text><a hover="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></asmtemplate>
      </encoding>
      <encoding name="FCVTZS_sisd_64H" oneofinclass="4" oneof="4" label="Half-precision to 64-bit" bitdiffs="sf == 1 &amp;&amp; ftype == 11">
        <docvars>
          <docvar key="convert-type" value="half-to-double"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCVTZS"/>
        </docvars>
        <box hibit="31" width="1" name="sf">
          <c>1</c>
        </box>
        <box hibit="23" width="2" name="ftype">
          <c>1</c>
          <c>1</c>
        </box>
        <asmtemplate><text>FCVTZS  </text><a hover="Is the 64-bit name of the SIMD&amp;FP destination register, encoded in the &quot;Rd&quot; field." link="Dd">&lt;Dd&gt;</a><text>, </text><a hover="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></asmtemplate>
      </encoding>
      <encoding name="FCVTZS_sisd_64S" oneofinclass="4" oneof="4" label="Single-precision to 64-bit" bitdiffs="sf == 1 &amp;&amp; ftype == 00">
        <docvars>
          <docvar key="convert-type" value="single-to-double"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCVTZS"/>
        </docvars>
        <box hibit="31" width="1" name="sf">
          <c>1</c>
        </box>
        <box hibit="23" width="2" name="ftype">
          <c>0</c>
          <c>0</c>
        </box>
        <asmtemplate><text>FCVTZS  </text><a hover="Is the 64-bit name of the SIMD&amp;FP destination register, encoded in the &quot;Rd&quot; field." link="Dd">&lt;Dd&gt;</a><text>, </text><a hover="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></asmtemplate>
      </encoding>
      <encoding name="FCVTZS_sisd_32D" oneofinclass="4" oneof="4" label="Double-precision to 32-bit" bitdiffs="sf == 0 &amp;&amp; ftype == 01">
        <docvars>
          <docvar key="convert-type" value="double-to-single"/>
          <docvar key="instr-class" value="float"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="FCVTZS"/>
        </docvars>
        <box hibit="31" width="1" name="sf">
          <c>0</c>
        </box>
        <box hibit="23" width="2" name="ftype">
          <c>0</c>
          <c>1</c>
        </box>
        <asmtemplate><text>FCVTZS  </text><a hover="Is the 32-bit name of the SIMD&amp;FP destination register, encoded in the &quot;Rd&quot; field." link="Sd">&lt;Sd&gt;</a><text>, </text><a hover="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></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="A64.simd_dp.float2int.FCVTZS_sisd_32H" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">if !IsFeatureImplemented(FEAT_FPRCVT) then EndOfDecode(Decode_UNDEF); end;
let d : integer = UInt(Rd);
let n : integer = UInt(Rn);

let intsize : integer{} = 32 &lt;&lt; UInt(sf);
let fltsize : integer{} = 8 &lt;&lt; UInt(ftype XOR '10');</pstext></ps>
      </ps_section>
    </iclass>
  </classes>
  <explanations scope="all">
    <explanation enclist="FCVTZS_sisd_32H, FCVTZS_sisd_32D" symboldefcount="1">
      <symbol link="Sd">&lt;Sd&gt;</symbol>
      <account encodedin="Rd">
        <intro>
          <para>Is the 32-bit name of the SIMD&amp;FP destination register, encoded in the "Rd" field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCVTZS_sisd_32H, FCVTZS_sisd_64H" symboldefcount="1">
      <symbol link="Hn__2">&lt;Hn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>Is the 16-bit name of the SIMD&amp;FP source register, encoded in the "Rn" field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCVTZS_sisd_64H, FCVTZS_sisd_64S" symboldefcount="1">
      <symbol link="Dd">&lt;Dd&gt;</symbol>
      <account encodedin="Rd">
        <intro>
          <para>Is the 64-bit name of the SIMD&amp;FP destination register, encoded in the "Rd" field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCVTZS_sisd_64S" symboldefcount="1">
      <symbol link="Sn">&lt;Sn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>Is the 32-bit name of the SIMD&amp;FP source register, encoded in the "Rn" field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="FCVTZS_sisd_32D" symboldefcount="1">
      <symbol link="Dn">&lt;Dn&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>Is the 64-bit name of the SIMD&amp;FP source register, encoded in the "Rn" field.</para>
        </intro>
      </account>
    </explanation>
  </explanations>
  <ps_section howmany="1">
    <ps name="A64.simd_dp.float2int.FCVTZS_sisd_32H" sections="1" secttype="Operation">
      <pstext mayhavelinks="1" section="Execute" rep_section="execute">AArch64_CheckFPEnabled();

var fltval : bits(fltsize);
var intval : bits(intsize);
let merge : boolean = IsMerging(FPCR());
var result : bits(128) = if merge then V{128}(d) else Zeros{128};

fltval = V{fltsize}(n);
intval = FPToFixed{intsize, fltsize}(fltval, 0, FALSE, FPCR(), FPRounding_ZERO);
result[0+:intsize] = intval;

V{128}(d) = result;</pstext></ps>
  </ps_section>
  <timestamp>2026-03-12 12:23:09</timestamp>
  <commit_id>2025-09_rel_asl1</commit_id>
</instructionsection>
