[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-28 Thread Matt Devereau via Phabricator via cfe-commits
MattDevereau abandoned this revision.
MattDevereau added a comment.

Abandoning this patch as it is redundant due to changes in D105331 
. This patch also drew attention to unused 
code removed in 841355c1e4e35fc02b5b171419979f5f9af0ebc8 
. Many 
thanks to @aaron.ballman


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments.



Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:3
+// RUN: %clang_cc1 %s -emit-llvm -triple aarch64-unknown-unknown -o - | 
FileCheck %s --check-prefix=AARCH64
+// REQUIRES: aarch64-registered-target
+

peterwaller-arm wrote:
> aaron.ballman wrote:
> > There's nothing AArch64-specific about the change, so I'd expect some more 
> > general codegen tests.
> > 
> > Actually, I took a look to see what calls 
> > `getFloatingTypeOfSizeWithinDomain()` and I can't find any callers of that. 
> > Do you have a test case where you were hitting that particular unreachable?
> Thanks for your observation @aaron.ballman.
> 
> It appears this has been working since D105331, which enabled it for X86.
> 
> Unless I'm missing something, the function in question appears to have been 
> unused since 2010 (the last use was removed in 
> d005ac937e4c08e0c607ddc42708f8bf2064c243 by @rjmccall), I presume 
> `getFloatingTypeOfSizeWithinDomain` should be removed then.
> I presume getFloatingTypeOfSizeWithinDomain should be removed then.

Agreed; I've gone ahead and removed it in 
841355c1e4e35fc02b5b171419979f5f9af0ebc8.

I think this patch can be abandoned, unless you think the extra test coverage 
is worth adding as an NFC commit?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-23 Thread Peter Waller via Phabricator via cfe-commits
peterwaller-arm added inline comments.



Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:3
+// RUN: %clang_cc1 %s -emit-llvm -triple aarch64-unknown-unknown -o - | 
FileCheck %s --check-prefix=AARCH64
+// REQUIRES: aarch64-registered-target
+

aaron.ballman wrote:
> There's nothing AArch64-specific about the change, so I'd expect some more 
> general codegen tests.
> 
> Actually, I took a look to see what calls 
> `getFloatingTypeOfSizeWithinDomain()` and I can't find any callers of that. 
> Do you have a test case where you were hitting that particular unreachable?
Thanks for your observation @aaron.ballman.

It appears this has been working since D105331, which enabled it for X86.

Unless I'm missing something, the function in question appears to have been 
unused since 2010 (the last use was removed in 
d005ac937e4c08e0c607ddc42708f8bf2064c243 by @rjmccall), I presume 
`getFloatingTypeOfSizeWithinDomain` should be removed then.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments.



Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:3
+// RUN: %clang_cc1 %s -emit-llvm -triple aarch64-unknown-unknown -o - | 
FileCheck %s --check-prefix=AARCH64
+// REQUIRES: aarch64-registered-target
+

There's nothing AArch64-specific about the change, so I'd expect some more 
general codegen tests.

Actually, I took a look to see what calls `getFloatingTypeOfSizeWithinDomain()` 
and I can't find any callers of that. Do you have a test case where you were 
hitting that particular unreachable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-16 Thread Peter Waller via Phabricator via cfe-commits
peterwaller-arm accepted this revision.
peterwaller-arm added a comment.
This revision is now accepted and ready to land.

LGTM.




Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:5
+  // AARCH64-LABEL: @add_float_rr(
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fadd

peterwaller-arm wrote:
> My read is that this appears to be testing both -ffast-math and _Float16. Do 
> we want to be testing both these things at once like this, can anyone comment?
> 
> My preference would be to have these test only the operators, and not the 
> flags, and then maybe have a single test which does
> https://clang.llvm.org/docs/LanguageExtensions.html#extensions-to-specify-floating-point-flags
> ```
> #pragma clang fp contract(fast)
> ```
> 
> and verifies that the flags are present.
> 
Discussed off-review: concluded for now that a no-optimizations test with no 
fast math flags seems reasonable, to address @fhahn's comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-16 Thread Matt Devereau via Phabricator via cfe-commits
MattDevereau updated this revision to Diff 409236.
MattDevereau added a comment.

Removed -O1 and -ffast-math flags


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

Files:
  clang/lib/AST/ASTContext.cpp
  clang/test/CodeGen/aarch64-complex-half-math.c

Index: clang/test/CodeGen/aarch64-complex-half-math.c
===
--- /dev/null
+++ clang/test/CodeGen/aarch64-complex-half-math.c
@@ -0,0 +1,419 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 %s -emit-llvm -triple aarch64-unknown-unknown -o - | FileCheck %s --check-prefix=AARCH64
+// REQUIRES: aarch64-registered-target
+
+// AARCH64-LABEL: @add_float_rr(
+// AARCH64-NEXT:  entry:
+// AARCH64-NEXT:[[RETVAL:%.*]] = alloca { half, half }, align 2
+// AARCH64-NEXT:[[A_ADDR:%.*]] = alloca half, align 2
+// AARCH64-NEXT:[[B_ADDR:%.*]] = alloca half, align 2
+// AARCH64-NEXT:store half [[A:%.*]], half* [[A_ADDR]], align 2
+// AARCH64-NEXT:store half [[B:%.*]], half* [[B_ADDR]], align 2
+// AARCH64-NEXT:[[TMP0:%.*]] = load half, half* [[A_ADDR]], align 2
+// AARCH64-NEXT:[[TMP1:%.*]] = load half, half* [[B_ADDR]], align 2
+// AARCH64-NEXT:[[ADD:%.*]] = fadd half [[TMP0]], [[TMP1]]
+// AARCH64-NEXT:[[RETVAL_REALP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[RETVAL]], i32 0, i32 0
+// AARCH64-NEXT:[[RETVAL_IMAGP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[RETVAL]], i32 0, i32 1
+// AARCH64-NEXT:store half [[ADD]], half* [[RETVAL_REALP]], align 2
+// AARCH64-NEXT:store half 0xH, half* [[RETVAL_IMAGP]], align 2
+// AARCH64-NEXT:[[TMP2:%.*]] = load { half, half }, { half, half }* [[RETVAL]], align 2
+// AARCH64-NEXT:ret { half, half } [[TMP2]]
+//
+_Float16 _Complex add_float_rr(_Float16 a, _Float16 b) {
+  return a + b;
+}
+// AARCH64-LABEL: @add_float_cr(
+// AARCH64-NEXT:  entry:
+// AARCH64-NEXT:[[RETVAL:%.*]] = alloca { half, half }, align 2
+// AARCH64-NEXT:[[A:%.*]] = alloca { half, half }, align 2
+// AARCH64-NEXT:[[B_ADDR:%.*]] = alloca half, align 2
+// AARCH64-NEXT:[[TMP0:%.*]] = bitcast { half, half }* [[A]] to [2 x half]*
+// AARCH64-NEXT:store [2 x half] [[A_COERCE:%.*]], [2 x half]* [[TMP0]], align 2
+// AARCH64-NEXT:store half [[B:%.*]], half* [[B_ADDR]], align 2
+// AARCH64-NEXT:[[A_REALP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[A]], i32 0, i32 0
+// AARCH64-NEXT:[[A_REAL:%.*]] = load half, half* [[A_REALP]], align 2
+// AARCH64-NEXT:[[A_IMAGP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[A]], i32 0, i32 1
+// AARCH64-NEXT:[[A_IMAG:%.*]] = load half, half* [[A_IMAGP]], align 2
+// AARCH64-NEXT:[[TMP1:%.*]] = load half, half* [[B_ADDR]], align 2
+// AARCH64-NEXT:[[ADD_R:%.*]] = fadd half [[A_REAL]], [[TMP1]]
+// AARCH64-NEXT:[[RETVAL_REALP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[RETVAL]], i32 0, i32 0
+// AARCH64-NEXT:[[RETVAL_IMAGP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[RETVAL]], i32 0, i32 1
+// AARCH64-NEXT:store half [[ADD_R]], half* [[RETVAL_REALP]], align 2
+// AARCH64-NEXT:store half [[A_IMAG]], half* [[RETVAL_IMAGP]], align 2
+// AARCH64-NEXT:[[TMP2:%.*]] = load { half, half }, { half, half }* [[RETVAL]], align 2
+// AARCH64-NEXT:ret { half, half } [[TMP2]]
+//
+_Float16 _Complex add_float_cr(_Float16 _Complex a, _Float16 b) {
+  return a + b;
+}
+// AARCH64-LABEL: @add_float_rc(
+// AARCH64-NEXT:  entry:
+// AARCH64-NEXT:[[RETVAL:%.*]] = alloca { half, half }, align 2
+// AARCH64-NEXT:[[B:%.*]] = alloca { half, half }, align 2
+// AARCH64-NEXT:[[A_ADDR:%.*]] = alloca half, align 2
+// AARCH64-NEXT:[[TMP0:%.*]] = bitcast { half, half }* [[B]] to [2 x half]*
+// AARCH64-NEXT:store [2 x half] [[B_COERCE:%.*]], [2 x half]* [[TMP0]], align 2
+// AARCH64-NEXT:store half [[A:%.*]], half* [[A_ADDR]], align 2
+// AARCH64-NEXT:[[TMP1:%.*]] = load half, half* [[A_ADDR]], align 2
+// AARCH64-NEXT:[[B_REALP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[B]], i32 0, i32 0
+// AARCH64-NEXT:[[B_REAL:%.*]] = load half, half* [[B_REALP]], align 2
+// AARCH64-NEXT:[[B_IMAGP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[B]], i32 0, i32 1
+// AARCH64-NEXT:[[B_IMAG:%.*]] = load half, half* [[B_IMAGP]], align 2
+// AARCH64-NEXT:[[ADD_R:%.*]] = fadd half [[TMP1]], [[B_REAL]]
+// AARCH64-NEXT:[[RETVAL_REALP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[RETVAL]], i32 0, i32 0
+// AARCH64-NEXT:[[RETVAL_IMAGP:%.*]] = getelementptr inbounds { half, half }, { half, half }* [[RETVAL]], i32 0, i32 1
+// AARCH64-NEXT:store half [[ADD_R]], half* [[RETVAL_REALP]], align 2
+// AARCH64-NEXT:store half 

[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments.



Comment at: clang/include/clang/AST/ASTContext.h:1117
   CanQualType BFloat16Ty;
-  CanQualType Float16Ty; // C11 extension ISO/IEC TS 18661-3
+  CanQualType Float16Ty, Float16ComplexTy; // C11 extension ISO/IEC TS 18661-3
   CanQualType VoidPtrTy, NullPtrTy;

paulwalker-arm wrote:
> peterwaller-arm wrote:
> > Is this necessary?
> Is this necessary? I don't see any other `*ComplexTy` types in this file 
> (i.e. there is no `DoubleComplexTy`).
This is the wrong way to handle this -- complex types are stored in the 
`ComplexTypes` folding set and are created through 
`ASTContext::getComplexType()`. So I don't think this change is necessary.



Comment at: clang/lib/AST/ASTContext.cpp:1330
   InitBuiltinType(Float16Ty,   BuiltinType::Float16);
+  InitBuiltinType(Float16ComplexTy,BuiltinType::Float16);
 

paulwalker-arm wrote:
> peterwaller-arm wrote:
> > Is this necessary?
> As above.
Same here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a reviewer: aaron.ballman.
fhahn added inline comments.



Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:1
+// RUN: %clang_cc1 %s -O1 -emit-llvm -triple aarch64-unknown-unknown 
-ffast-math -o - | FileCheck %s --check-prefix=AARCH64
+

peterwaller-arm wrote:
> Can these test outputs be autogenerated with update_cc_test_checks.py?
Do the tests need to depend on LLVM optimizations? In general this is 
undesirable as it  makes them more fragile if things change on the LLVM side.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-16 Thread Peter Waller via Phabricator via cfe-commits
peterwaller-arm added a comment.

Some comments.




Comment at: clang/include/clang/AST/ASTContext.h:1117
   CanQualType BFloat16Ty;
-  CanQualType Float16Ty; // C11 extension ISO/IEC TS 18661-3
+  CanQualType Float16Ty, Float16ComplexTy; // C11 extension ISO/IEC TS 18661-3
   CanQualType VoidPtrTy, NullPtrTy;

Is this necessary?



Comment at: clang/lib/AST/ASTContext.cpp:1330
   InitBuiltinType(Float16Ty,   BuiltinType::Float16);
+  InitBuiltinType(Float16ComplexTy,BuiltinType::Float16);
 

Is this necessary?



Comment at: clang/lib/AST/ASTContext.cpp:6811-6812
 switch (EltRank) {
-case BFloat16Rank: llvm_unreachable("Complex bfloat16 is not supported");
-case Float16Rank:
+case BFloat16Rank:
+  llvm_unreachable("Complex bfloat16 is not supported");
 case HalfRank: llvm_unreachable("Complex half is not supported");

This can be left unmodified.



Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:1
+// RUN: %clang_cc1 %s -O1 -emit-llvm -triple aarch64-unknown-unknown 
-ffast-math -o - | FileCheck %s --check-prefix=AARCH64
+

Can these test outputs be autogenerated with update_cc_test_checks.py?



Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:2
+// RUN: %clang_cc1 %s -O1 -emit-llvm -triple aarch64-unknown-unknown 
-ffast-math -o - | FileCheck %s --check-prefix=AARCH64
+
+_Float16 _Complex add_float_rr(_Float16 a, _Float16 b) {

I think this test needs a `// REQUIRES: aarch64-registered-target` to protect 
builds which don't have a LLVM_TARGETS_TO_BUILD which implies AArch64 is 
available.



Comment at: clang/test/CodeGen/aarch64-complex-half-math.c:5
+  // AARCH64-LABEL: @add_float_rr(
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fadd

My read is that this appears to be testing both -ffast-math and _Float16. Do we 
want to be testing both these things at once like this, can anyone comment?

My preference would be to have these test only the operators, and not the 
flags, and then maybe have a single test which does
https://clang.llvm.org/docs/LanguageExtensions.html#extensions-to-specify-floating-point-flags
```
#pragma clang fp contract(fast)
```

and verifies that the flags are present.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-16 Thread Paul Walker via Phabricator via cfe-commits
paulwalker-arm added inline comments.



Comment at: clang/include/clang/AST/ASTContext.h:1117
   CanQualType BFloat16Ty;
-  CanQualType Float16Ty; // C11 extension ISO/IEC TS 18661-3
+  CanQualType Float16Ty, Float16ComplexTy; // C11 extension ISO/IEC TS 18661-3
   CanQualType VoidPtrTy, NullPtrTy;

Is this necessary? I don't see any other `*ComplexTy` types in this file (i.e. 
there is no `DoubleComplexTy`).



Comment at: clang/lib/AST/ASTContext.cpp:1330
   InitBuiltinType(Float16Ty,   BuiltinType::Float16);
+  InitBuiltinType(Float16ComplexTy,BuiltinType::Float16);
 

As above.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119926/new/

https://reviews.llvm.org/D119926

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119926: [Clang][AArch64] Enable _Float16 _Complex type

2022-02-16 Thread Matt Devereau via Phabricator via cfe-commits
MattDevereau created this revision.
MattDevereau added reviewers: georges, peterwaller-arm, paulwalker-arm, 
DavidTruby, bsmith, teemperor, rjmccall, qiucf.
Herald added a subscriber: kristof.beyls.
MattDevereau requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119926

Files:
  clang/include/clang/AST/ASTContext.h
  clang/lib/AST/ASTContext.cpp
  clang/test/CodeGen/aarch64-complex-half-math.c

Index: clang/test/CodeGen/aarch64-complex-half-math.c
===
--- /dev/null
+++ clang/test/CodeGen/aarch64-complex-half-math.c
@@ -0,0 +1,145 @@
+// RUN: %clang_cc1 %s -O1 -emit-llvm -triple aarch64-unknown-unknown -ffast-math -o - | FileCheck %s --check-prefix=AARCH64
+
+_Float16 _Complex add_float_rr(_Float16 a, _Float16 b) {
+  // AARCH64-LABEL: @add_float_rr(
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fadd
+  // AARCH64: ret { half, half }
+  return a + b;
+}
+_Float16 _Complex add_float_cr(_Float16 _Complex a, _Float16 b) {
+  // AARCH64-LABEL: @add_float_cr(
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fadd
+  // AARCH64: ret { half, half }
+  return a + b;
+}
+_Float16 _Complex add_float_rc(_Float16 a, _Float16 _Complex b) {
+  // AARCH64-LABEL: @add_float_rc(
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fadd
+  // AARCH64: ret { half, half }
+  return a + b;
+}
+_Float16 _Complex add_float_cc(_Float16 _Complex a, _Float16 _Complex b) {
+  // AARCH64-LABEL: @add_float_cc(
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fadd
+  // AARCH64: ret { half, half }
+  return a + b;
+}
+
+_Float16 _Complex sub_float_rr(_Float16 a, _Float16 b) {
+  // AARCH64-LABEL: @sub_float_rr(
+  // AARCH64: fsub reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fsub
+  // AARCH64: ret { half, half }
+  return a - b;
+}
+_Float16 _Complex sub_float_cr(_Float16 _Complex a, _Float16 b) {
+  // AARCH64-LABEL: @sub_float_cr(
+  // AARCH64: fsub reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fsub
+  // AARCH64: ret { half, half }
+  return a - b;
+}
+_Float16 _Complex sub_float_rc(_Float16 a, _Float16 _Complex b) {
+  // AARCH64-LABEL: @sub_float_rc(
+  // AARCH64: fsub reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fneg reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fsub
+  // AARCH64: ret { half, half }
+  return a - b;
+}
+_Float16 _Complex sub_float_cc(_Float16 _Complex a, _Float16 _Complex b) {
+  // AARCH64-LABEL: @sub_float_cc(
+  // AARCH64: fsub reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fsub reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fsub
+  // AARCH64: ret { half, half }
+  return a - b;
+}
+
+_Float16 _Complex mul_float_rr(_Float16 a, _Float16 b) {
+  // AARCH64-LABEL: @mul_float_rr(
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fmul
+  // AARCH64: ret { half, half }
+  return a * b;
+}
+_Float16 _Complex mul_float_cr(_Float16 _Complex a, _Float16 b) {
+  // AARCH64-LABEL: @mul_float_cr(
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fmul
+  // AARCH64: ret { half, half }
+  return a * b;
+}
+_Float16 _Complex mul_float_rc(_Float16 a, _Float16 _Complex b) {
+  // AARCH64-LABEL: @mul_float_rc(
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fmul
+  // AARCH64: ret { half, half }
+  return a * b;
+}
+_Float16 _Complex mul_float_cc(_Float16 _Complex a, _Float16 _Complex b) {
+  // AARCH64-LABEL: @mul_float_cc(
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fadd reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fmul reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fsub reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fmul
+  // AARCH64: ret { half, half }
+  return a * b;
+}
+
+_Float16 _Complex div_float_rr(_Float16 a, _Float16 b) {
+  // AARCH64-LABEL: @div_float_rr(
+  // AARCH64: fdiv reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fdiv reassoc nnan ninf nsz arcp afn half
+  // AARCH64: ret { half, half }
+  return a / b;
+}
+_Float16 _Complex div_float_cr(_Float16 _Complex a, _Float16 b) {
+  // AARCH64-LABEL: @div_float_cr(
+  // AARCH64: fdiv reassoc nnan ninf nsz arcp afn half
+  // AARCH64: fdiv reassoc nnan ninf nsz arcp afn half
+  // AARCH64-NOT: fdiv reassoc nnan ninf nsz arcp afn half
+  // AARCH64: ret { half, half }
+  return a / b;
+}
+_Float16 _Complex div_float_rc(_Float16 a, _Float16 _Complex b) {
+  // AARCH64-LABEL: @div_float_rc(
+  // AARCH64: fmul reassoc nnan ninf nsz