public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [GCC 8,2] Aarch64-none-eabi UCVTF problem
@ 2020-12-18 13:39 Mihailo Stojanovic
  2020-12-18 22:11 ` Richard Earnshaw
  0 siblings, 1 reply; 2+ messages in thread
From: Mihailo Stojanovic @ 2020-12-18 13:39 UTC (permalink / raw)
  To: gcc-help

Hi all,

ARM Cortex-A53 CPU stalls during the execution of
a bare metal application containing the following
assembly instruction:

ucvtf    s0, s0

According to the A64 ISA, UCVTF instruction doesn't
allow floating-point registers as source registers, but
executing the same instruction in qemu-arm user mode
yields a correct result. I am wondering whether this
is a compiler bug, or is there something I am missing?

Source code was compiled by the aarch64-none-eabi-gcc
(version 8.2.0) compiler, with -O3 and -fno-strict-aliasing
flags.

I am currently working on creating a minimal reproducer,
so I could provide it if necessary.

Note that manually modifying the assembly file to use
a general-purpose register as a source fixes this behaviour.

Best regards,
Mihailo

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [GCC 8,2] Aarch64-none-eabi UCVTF problem
  2020-12-18 13:39 [GCC 8,2] Aarch64-none-eabi UCVTF problem Mihailo Stojanovic
@ 2020-12-18 22:11 ` Richard Earnshaw
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2020-12-18 22:11 UTC (permalink / raw)
  To: Mihailo Stojanovic, gcc-help

On 18/12/2020 13:39, Mihailo Stojanovic via Gcc-help wrote:
> Hi all,
> 
> ARM Cortex-A53 CPU stalls during the execution of
> a bare metal application containing the following
> assembly instruction:
> 
> ucvtf    s0, s0
> 
> According to the A64 ISA, UCVTF instruction doesn't
> allow floating-point registers as source registers, but
> executing the same instruction in qemu-arm user mode
> yields a correct result. I am wondering whether this
> is a compiler bug, or is there something I am missing?

I think you're missing that there are multiple variants of this instruction.

ucvtf s0, s0

assembles to the opcode

0x7e21d800

which by my reckoning matches to the single-precision sub-variant of
Scalar single-precision and double-precision clause of
  C7.2.353      UCVTF (vector, integer)
In the current armv8 ARM ARM.  This variant is a single lane instance of
the general vector conversion operation.

If the operation is stalling and your processor is running 'bare-metal'
have you enabled the floating-point/simd unit on the processor.  If you
haven't then the CPU will take an undefined instruction trap.

> Source code was compiled by the aarch64-none-eabi-gcc
> (version 8.2.0) compiler, with -O3 and -fno-strict-aliasing
> flags.
> 
> I am currently working on creating a minimal reproducer,
> so I could provide it if necessary.
> 
> Note that manually modifying the assembly file to use
> a general-purpose register as a source fixes this behaviour.
> 
> Best regards,
> Mihailo
> 

R.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-18 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 13:39 [GCC 8,2] Aarch64-none-eabi UCVTF problem Mihailo Stojanovic
2020-12-18 22:11 ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).