[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 11:50:59 PST 2025


JonPsson1 wrote:

Patch rebased and updated.

-- Saw two failing compiler-rt tests now:

```
Failed Tests (2):
  Builtins-s390x-linux :: clear_cache_test.c
  Builtins-s390x-linux :: enable_execute_stack_test.c

```
  clear_cache_test.c contains a call to the compiler-rt clear_cache() function. From README.txt:

```
  // __clear_cache() is used to tell process that new instructions have been
  // written to an address range.  Necessary on processors that do not have
  // a unified instruction and data cache.
  void __clear_cache(void* start, void* end);

  // __enable_execute_stack() is used with nested functions when a trampoline
  // function is written onto the stack and that page range needs to be made
  // executable.
  void __enable_execute_stack(void* addr);

```
I see a lot of target specific pre-processing in clear_cache.c that either disables this to a no-op, or does something target specific. The test itself this is disabled for some targets. Seems reasonable to leave this as unsupported and disable the test (for now?). Also disabling enable_execute_stack_test.c.

-- The 'bool HalfArgsAndReturns' Clang flag seems to desipite the name only be relevant for __fp16, so it is kept as the default 'false'. Added a comment next to it.

-- Handling of FP-args types / sizes updated per review. This was a bit more involved than I first thought as over-alignments actually imply a greater size and type.

-- Added tests for overaligned (a4 / a16)  _Float16 in systemz-abi.c.

@uweigand: patch ready for a review now.

https://github.com/llvm/llvm-project/pull/109164


More information about the llvm-commits mailing list