Files
clang-p2996/clang/test/CodeGen/arm-fp16-arguments.c
Lucas Prates ada4c9dc4a [ARM][Clang] Removing lowering of half-precision FP arguments and returns from Clang's CodeGen
Summary:
On the process of moving the argument lowering handling for
half-precision floating point arguments and returns to the backend, this
patch removes the code that was responsible for handling the coercion of
those arguments in Clang's Codegen.

Reviewers: rjmccall, chill, ostannard, dnsampaio

Reviewed By: ostannard

Subscribers: stuij, kristof.beyls, dmgreen, danielkiss, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81451
2020-06-18 13:17:07 +01:00

34 lines
1.4 KiB
C

// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=SOFT
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi hard -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=HARD
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fnative-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=NATIVE
__fp16 g;
void t1(__fp16 a) { g = a; }
// SOFT: define void @t1(half [[PARAM:%.*]])
// HARD: define arm_aapcs_vfpcc void @t1(half [[PARAM:%.*]])
// NATIVE: define void @t1(half [[PARAM:%.*]])
// CHECK: store half [[PARAM]], half* @g
__fp16 t2() { return g; }
// SOFT: define half @t2()
// HARD: define arm_aapcs_vfpcc half @t2()
// NATIVE: define half @t2()
// CHECK: [[LOAD:%.*]] = load half, half* @g
// CHECK: ret half [[LOAD]]
_Float16 h;
void t3(_Float16 a) { h = a; }
// SOFT: define void @t3(half [[PARAM:%.*]])
// HARD: define arm_aapcs_vfpcc void @t3(half [[PARAM:%.*]])
// NATIVE: define void @t3(half [[PARAM:%.*]])
// CHECK: store half [[PARAM]], half* @h
_Float16 t4() { return h; }
// SOFT: define half @t4()
// HARD: define arm_aapcs_vfpcc half @t4()
// NATIVE: define half @t4()
// CHECK: [[LOAD:%.*]] = load half, half* @h
// CHECK: ret half [[LOAD]]