Bug 391311 - [Patch] Fix arm64 valgrind tests compilation with clang
Summary: [Patch] Fix arm64 valgrind tests compilation with clang
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.13.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Floyd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-02 18:49 UTC by Vasily Tarasov
Modified: 2024-07-09 11:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fix arm64 valgrind tests compilation with clang (11.67 KB, patch)
2018-03-02 18:49 UTC, Vasily Tarasov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vasily Tarasov 2018-03-02 18:49:51 UTC
Created attachment 111149 [details]
Fix arm64 valgrind tests compilation with clang

Android Open Source Project compiles Valgrind using clang, with it's own assember, with semantics different from gcc's.
Switching to external assember with "-no-integrated-as" is not an option, as it doesn't propagate arch feature expansions properly.

The attached patch makes arm64 Valgrind tests compilation clang-friendly:
- per https://developer.arm.com/docs/100069/0607/a64-floating-point-instructions/fcmp
  fcmp accept a floating point zero, replacing #0 with #0.0
- per http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0802b/MOVI_advsimd_vector.html
  movi's 8-bit immediate is not allowed to be shifted, removing LSL #0.
- ifdef-ing crypto assembly with __ARM_FEATURE_CRYPTO. Tests will be included in kryo, and excluded for generic arm64 builds.
- per http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0802b/ADD_addsub_ext.html
  add extended register's 64-bit version, extend is required to be uxtx
Comment 1 Paul Floyd 2024-07-09 07:51:59 UTC
I may well have reinvented this wheel with the port to FreeBSD arm64, which also uses the LLVM toolchain.
Comment 2 Paul Floyd 2024-07-09 11:45:57 UTC
Other than the 

+#if defined(__ARM_FEATURE_CRYPTO)

bits all these have been addressed (and sime without using clang conditional blocks).