From mboxrd@z Thu Jan 1 00:00:00 1970 X-Received: by 2002:a05:622a:4d4a:b0:418:fed:c02 with SMTP id fe10-20020a05622a4d4a00b004180fed0c02mr114633qtb.8.1700396541120; Sun, 19 Nov 2023 04:22:21 -0800 (PST) X-Received: by 2002:a17:902:e551:b0:1cf:54e4:cdcc with SMTP id n17-20020a170902e55100b001cf54e4cdccmr1003397plf.4.1700396540815; Sun, 19 Nov 2023 04:22:20 -0800 (PST) Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!eternal-september.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 19 Nov 2023 04:22:20 -0800 (PST) Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1210:1c95:d400:4ce4:ca54:9b14:c497; posting-account=DQbqYQoAAACn8hHn2LmG2aF7Mhbxl_Lf NNTP-Posting-Host: 2a02:1210:1c95:d400:4ce4:ca54:9b14:c497 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Using Log_Float in inline assembler for ARM From: Ahlan Marriott Injection-Date: Sun, 19 Nov 2023 12:22:21 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2438 Xref: news.eternal-september.org comp.lang.ada:65866 List-Id: Hi, The following procedure Unbiased_Rounding for Float works as expected. function Unbiased_Rounding (X : Float) return Float is Y : Float; begin Asm ("vrintn.f32 %0,%1", Outputs =3D> Float'asm_output ("=3Dt", Y), Inputs =3D> Float'asm_input ("t", X)); return Y; end Unbiased_Rounding; according to https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html the constraint t means "VFP floating-point registers s0-s31. Used for 32 bi= t values=E2=80=9D and the constraint w means "VFP floating-point registers = d0-d31 and the appropriate subset d0-d15 based on command line options. Use= d for 64 bit values only=E2=80=9D therefore we wrote our long_float version as function Unbiased_Rounding (X : Long_Float) return Long_Float is Y : Long_Float; begin Asm ("vrintn.f64 %0,%1", Outputs =3D> Long_Float'asm_output ("=3Dw", Y), Inputs =3D> Long_Float'asm_input ("w", X)); return Y; end Unbiased_Rounding; however this fails to compile. GNAT 11.2/0-4 (Alire) complains Error: invalid instruction shape -- `vrintn.f64 s14,s14=E2=80=99 presumably because the operands are S registers rather than double precisio= ns D registers. Is this a bug or have we misunderstood something? Best wishes, Ahlan