This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] [builtins] Use _Float16 on extendhfsf2, truncdfhf2 __truncsfhf2 if available
ClosedPublic

Authored by zatrazz on Nov 27 2020, 11:47 AM.

Details

Summary

On AArch64 it allows use the native FP16 ABI (although libcalls are
not emitted for fptrunc/fpext lowering), while on other architectures
the expected current semantic is preserved (arm for instance).

For testing the _Float16 usage is enabled by architecture base,
currently only for arm, aarch64, and arm64.

This re-enabled revert done by https://reviews.llvm.org/rGb534beabeed3ba1777cd0ff9ce552d077e496726

Diff Detail

Event Timeline

zatrazz created this revision.Nov 27 2020, 11:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 27 2020, 11:47 AM
Herald added subscribers: Restricted Project, kristof.beyls, mgorny, dberris. · View Herald Transcript
zatrazz requested review of this revision.Nov 27 2020, 11:47 AM

That is my aim by changing how the tests are built by enabling _Float16 per architecture bases with:

if (${arch} MATCHES "arm|aarch64|arm64" AND COMPILER_RT_HAS_FLOAT16)
  list(APPEND BUILTINS_TEST_TARGET_CFLAGS -DCOMPILER_RT_HAS_FLOAT16)
  string(REPLACE ";" " " BUILTINS_TEST_TARGET_CFLAGS "${BUILTINS_TEST_TARGET_CFLAGS}")
endif()

On compiler-rt/test/builtins/CMakeLists.txt (I am assuming the tests are always built with the resulting
built clang). Do you see another case where I should handle as well?

MaskRay accepted this revision.Nov 30 2020, 11:00 PM
This revision is now accepted and ready to land.Nov 30 2020, 11:00 PM
This revision was landed with ongoing or failed builds.Dec 3 2020, 11:10 AM
This revision was automatically updated to reflect the committed changes.