Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

RFC: turn on fun & safe math optimizations for NEON #108

Open
Artoria2e5 opened this issue Aug 14, 2019 · 8 comments
Open

RFC: turn on fun & safe math optimizations for NEON #108

Artoria2e5 opened this issue Aug 14, 2019 · 8 comments
Assignees
Labels

Comments

@Artoria2e5
Copy link
Contributor

Artoria2e5 commented Aug 14, 2019

https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
If the selected floating-point hardware includes the NEON extension (e.g. -mfpu=neon), note that floating-point operations are not generated by GCC’s auto-vectorization pass unless -funsafe-math-optimizations is also specified. This is because NEON hardware does not fully implement the IEEE 754 standard for floating-point arithmetic (in particular denormal values are treated as zero), so the use of NEON instructions may lead to a loss of precision.

Icenowy says v8 neon is ok, but we are still doing arm7hf so... (also, do people really care about denormals?)

@KexyBiscuit
Copy link
Contributor

Add Armv8-A AArch64 as a new arch. is an option, isn't it?

@Icenowy
Copy link
Contributor

Icenowy commented Aug 14, 2019

@KexyBiscuit our arm64 port is already ARMv8-A AArch64.

@Artoria2e5 I think accuracy is still a problem. Maybe it can be an option that can be enabled per package.

@KexyBiscuit
Copy link
Contributor

@Icenowy What a typo... I meant AArch32.

@Icenowy
Copy link
Contributor

Icenowy commented Aug 14, 2019

@KexyBiscuit for ARMv8 AArch32, this port is nearly useless -- the only suitable ARM Cortex(R) core is Cortex-A32.

@Artoria2e5
Copy link
Contributor Author

Test case: https://news.ycombinator.com/item?id=13244168

No, even with ARMv8-a set as -march gcc does not give a shit about neon instrinsics without fun & safe. Instrinsics!

@KexyBiscuit
Copy link
Contributor

@Icenowy It's useful for those devices using AArch64 processor but with AArch32 OS, like Rasp. Pi.

@Icenowy
Copy link
Contributor

Icenowy commented Aug 14, 2019

@KexyBiscuit currently I don't know any other device that officially support AArch32 kernel on AArch64 CPU -- except for some Qualcomm ones which we may never be able to support.

@Artoria2e5
Copy link
Contributor Author

事实的处理中会管 denormal 的人真的很少,甚至连 Intel 的编译器在不是 O0 的时候都会把它摘掉……真的这个精度没有人会管。

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

No branches or pull requests

4 participants