[PATCH] D113107: Support of expression granularity for _Float16.
Zahira Ammarguellat via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 22 10:42:37 PDT 2022
zahiraam added inline comments.
================
Comment at: clang/test/CodeGen/X86/Float16-arithmetic.c:207
+// CHECK-NEXT: [[EXT:%.*]] = fpext half [[TMP0]] to float
+// CHECK-NEXT: store float [[EXT]], ptr [[RETVAL]], align 2
+// CHECK-NEXT: [[TMP1:%.*]] = load half, ptr [[RETVAL]], align 2
----------------
zahiraam wrote:
> pengfei wrote:
> > Not sure if we need a fptrunc and store the half value. The following tests have the same problem.
> I think that's what we want?
> // CHECK-LABEL: @RealOp(
> // CHECK-NEXT: entry:
> // CHECK-NEXT: [[A_ADDR:%.*]] = alloca half, align 2
> // CHECK-NEXT: store half [[A:%.*]], ptr [[A_ADDR]], align 2
> // CHECK-NEXT: [[TMP0:%.*]] = load half, ptr [[A_ADDR]], align 2
> // CHECK-NEXT: [[EXT:%.*]] = fpext half [[TMP0]] to float
> // CHECK-NEXT: [[UNPROMOTION:%.*]] = fptrunc float [[EXT]] to half
> // CHECK-NEXT: ret half [[UNPROMOTION]]
>
> Do you agree? If this is correct, I will make the change the other operators.
But I feel like we should be returning a float no? In which case it will be more tricky (need to calculate the Address with the promoted elementype)? @rmjccall?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113107/new/
https://reviews.llvm.org/D113107
More information about the cfe-commits
mailing list