Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soc: xlnx: zynq7000: add FPU support #83825

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mausys
Copy link
Contributor

@mausys mausys commented Jan 10, 2025

According to its datasheet the Zynq 7000 has a VFPv3U FPU

@mausys
Copy link
Contributor Author

mausys commented Jan 10, 2025

cmake/gcc-m-fpu.cmake Outdated Show resolved Hide resolved
@mausys
Copy link
Contributor Author

mausys commented Jan 13, 2025

i checked the FPU on the HW with this function:

static void fpu_info(void)
{
      int val_fpsid = 0;
      int val_mvfr0 = 0;
      int val_mvfr1 = 0;

      __asm__ ("vmrs  %[output], FPSID"  : [output] "=r" (val_fpsid));
      __asm__ ("vmrs  %[output], MVFR0"  : [output] "=r" (val_mvfr0));
      __asm__ ("vmrs  %[output], MVFR1"  : [output] "=r" (val_mvfr1));

      LOG_INF("fpsid=0x%x mvfr0=0x%x mvfr1=0x%x\n", val_fpsid, val_mvfr0, val_mvfr1);
}

output:
fpsid=0x41033094 mvfr0=0x10110222 mvfr1=0x1111111

So according to the reference manual (https://developer.arm.com/documentation/ddi0487/latest/) fp16 hw conversion is supported, but not the floating point exception trapping. But does it matter? VFP_FEATURE_TRAP isn't used anywhere.

According to its datasheet the Zynq 7000 has a VFPv3 FPU

Signed-off-by: Simon Maurer <[email protected]>
@mausys
Copy link
Contributor Author

mausys commented Jan 17, 2025

I removed the half-precision support. According to MVFR1 register only conversion and not arithmetic is supported and I'm not sure if for the gcc -mfpu=vfpv3-fp16 flag both must be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants