[PATCH] D81721: [SVE] Ensure proper mangling of ACLE tuple types

2020-06-15 Thread Sander de Smalen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG98100353d784: [SVE] Ensure proper mangling of ACLE tuple 
types (authored by sdesmalen).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81721

Files:
  clang/include/clang/Basic/AArch64SVEACLETypes.def
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/ItaniumMangle.cpp
  clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
  clang/utils/TableGen/SveEmitter.cpp

Index: clang/utils/TableGen/SveEmitter.cpp
===
--- clang/utils/TableGen/SveEmitter.cpp
+++ clang/utils/TableGen/SveEmitter.cpp
@@ -1069,39 +1069,39 @@
   OS << "typedef __SVFloat16_t svfloat16_t;\n";
   OS << "typedef __SVFloat32_t svfloat32_t;\n";
   OS << "typedef __SVFloat64_t svfloat64_t;\n";
-  OS << "typedef __SVInt8x2_t svint8x2_t;\n";
-  OS << "typedef __SVInt16x2_t svint16x2_t;\n";
-  OS << "typedef __SVInt32x2_t svint32x2_t;\n";
-  OS << "typedef __SVInt64x2_t svint64x2_t;\n";
-  OS << "typedef __SVUint8x2_t svuint8x2_t;\n";
-  OS << "typedef __SVUint16x2_t svuint16x2_t;\n";
-  OS << "typedef __SVUint32x2_t svuint32x2_t;\n";
-  OS << "typedef __SVUint64x2_t svuint64x2_t;\n";
-  OS << "typedef __SVFloat16x2_t svfloat16x2_t;\n";
-  OS << "typedef __SVFloat32x2_t svfloat32x2_t;\n";
-  OS << "typedef __SVFloat64x2_t svfloat64x2_t;\n";
-  OS << "typedef __SVInt8x3_t svint8x3_t;\n";
-  OS << "typedef __SVInt16x3_t svint16x3_t;\n";
-  OS << "typedef __SVInt32x3_t svint32x3_t;\n";
-  OS << "typedef __SVInt64x3_t svint64x3_t;\n";
-  OS << "typedef __SVUint8x3_t svuint8x3_t;\n";
-  OS << "typedef __SVUint16x3_t svuint16x3_t;\n";
-  OS << "typedef __SVUint32x3_t svuint32x3_t;\n";
-  OS << "typedef __SVUint64x3_t svuint64x3_t;\n";
-  OS << "typedef __SVFloat16x3_t svfloat16x3_t;\n";
-  OS << "typedef __SVFloat32x3_t svfloat32x3_t;\n";
-  OS << "typedef __SVFloat64x3_t svfloat64x3_t;\n";
-  OS << "typedef __SVInt8x4_t svint8x4_t;\n";
-  OS << "typedef __SVInt16x4_t svint16x4_t;\n";
-  OS << "typedef __SVInt32x4_t svint32x4_t;\n";
-  OS << "typedef __SVInt64x4_t svint64x4_t;\n";
-  OS << "typedef __SVUint8x4_t svuint8x4_t;\n";
-  OS << "typedef __SVUint16x4_t svuint16x4_t;\n";
-  OS << "typedef __SVUint32x4_t svuint32x4_t;\n";
-  OS << "typedef __SVUint64x4_t svuint64x4_t;\n";
-  OS << "typedef __SVFloat16x4_t svfloat16x4_t;\n";
-  OS << "typedef __SVFloat32x4_t svfloat32x4_t;\n";
-  OS << "typedef __SVFloat64x4_t svfloat64x4_t;\n";
+  OS << "typedef __clang_svint8x2_t svint8x2_t;\n";
+  OS << "typedef __clang_svint16x2_t svint16x2_t;\n";
+  OS << "typedef __clang_svint32x2_t svint32x2_t;\n";
+  OS << "typedef __clang_svint64x2_t svint64x2_t;\n";
+  OS << "typedef __clang_svuint8x2_t svuint8x2_t;\n";
+  OS << "typedef __clang_svuint16x2_t svuint16x2_t;\n";
+  OS << "typedef __clang_svuint32x2_t svuint32x2_t;\n";
+  OS << "typedef __clang_svuint64x2_t svuint64x2_t;\n";
+  OS << "typedef __clang_svfloat16x2_t svfloat16x2_t;\n";
+  OS << "typedef __clang_svfloat32x2_t svfloat32x2_t;\n";
+  OS << "typedef __clang_svfloat64x2_t svfloat64x2_t;\n";
+  OS << "typedef __clang_svint8x3_t svint8x3_t;\n";
+  OS << "typedef __clang_svint16x3_t svint16x3_t;\n";
+  OS << "typedef __clang_svint32x3_t svint32x3_t;\n";
+  OS << "typedef __clang_svint64x3_t svint64x3_t;\n";
+  OS << "typedef __clang_svuint8x3_t svuint8x3_t;\n";
+  OS << "typedef __clang_svuint16x3_t svuint16x3_t;\n";
+  OS << "typedef __clang_svuint32x3_t svuint32x3_t;\n";
+  OS << "typedef __clang_svuint64x3_t svuint64x3_t;\n";
+  OS << "typedef __clang_svfloat16x3_t svfloat16x3_t;\n";
+  OS << "typedef __clang_svfloat32x3_t svfloat32x3_t;\n";
+  OS << "typedef __clang_svfloat64x3_t svfloat64x3_t;\n";
+  OS << "typedef __clang_svint8x4_t svint8x4_t;\n";
+  OS << "typedef __clang_svint16x4_t svint16x4_t;\n";
+  OS << "typedef __clang_svint32x4_t svint32x4_t;\n";
+  OS << "typedef __clang_svint64x4_t svint64x4_t;\n";
+  OS << "typedef __clang_svuint8x4_t svuint8x4_t;\n";
+  OS << "typedef __clang_svuint16x4_t svuint16x4_t;\n";
+  OS << "typedef __clang_svuint32x4_t svuint32x4_t;\n";
+  OS << "typedef __clang_svuint64x4_t svuint64x4_t;\n";
+  OS << "typedef __clang_svfloat16x4_t svfloat16x4_t;\n";
+  OS << "typedef __clang_svfloat32x4_t svfloat32x4_t;\n";
+  OS << "typedef __clang_svfloat64x4_t svfloat64x4_t;\n";
   OS << "typedef __SVBool_t  svbool_t;\n\n";
 
   OS << "typedef enum\n";
Index: clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
===
--- clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
+++ clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
@@ -29,3 +29,72 @@
 void f11(S<__SVFloat64_t>) {}
 // CHECK: _Z3f121SIu10__SVBool_tE
 void f12(S<__SVBool_t>) {}
+
+// The tuple types don't use the internal name for mangling.
+
+// CHECK: _Z3f131SI10svint8x2_tE
+void f13(S<__clang_svint8x2_t>) {}
+// 

[PATCH] D81721: [SVE] Ensure proper mangling of ACLE tuple types

2020-06-12 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81721



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


[PATCH] D81721: [SVE] Ensure proper mangling of ACLE tuple types

2020-06-12 Thread Sander de Smalen via Phabricator via cfe-commits
sdesmalen added a comment.

See 
https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst#appendix-c-mangling
 for details on the mangling rules.

I thought it would be easier to review if I kept these changes separate from 
D81459 .


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81721



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


[PATCH] D81721: [SVE] Ensure proper mangling of ACLE tuple types

2020-06-12 Thread Sander de Smalen via Phabricator via cfe-commits
sdesmalen created this revision.
sdesmalen added reviewers: rsandifo-arm, c-rhodes, efriedma.
Herald added subscribers: cfe-commits, psnobl, rkruppe, kristof.beyls, tschuett.
Herald added a reviewer: rengolin.
Herald added a project: clang.
sdesmalen added a parent revision: D81459: [SveEmitter] Add SVE tuple types and 
builtins for svundef..

The AAPCS specifies that the tuple types such as `svint32x2_t`
should use their `arm_sve.h` names when mangled instead of their
builtin names.

  

This patch also renames the internal types for the tuples to
be prefixed with `__clang_`, so they are not misinterpreted as
specified internal types like the non-tuple types which *are* defined
in the AAPCS. Using a builtin type for the tuples is a purely
a choice of the Clang implementation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81721

Files:
  clang/include/clang/Basic/AArch64SVEACLETypes.def
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/ItaniumMangle.cpp
  clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
  clang/utils/TableGen/SveEmitter.cpp

Index: clang/utils/TableGen/SveEmitter.cpp
===
--- clang/utils/TableGen/SveEmitter.cpp
+++ clang/utils/TableGen/SveEmitter.cpp
@@ -1069,39 +1069,39 @@
   OS << "typedef __SVFloat16_t svfloat16_t;\n";
   OS << "typedef __SVFloat32_t svfloat32_t;\n";
   OS << "typedef __SVFloat64_t svfloat64_t;\n";
-  OS << "typedef __SVInt8x2_t svint8x2_t;\n";
-  OS << "typedef __SVInt16x2_t svint16x2_t;\n";
-  OS << "typedef __SVInt32x2_t svint32x2_t;\n";
-  OS << "typedef __SVInt64x2_t svint64x2_t;\n";
-  OS << "typedef __SVUint8x2_t svuint8x2_t;\n";
-  OS << "typedef __SVUint16x2_t svuint16x2_t;\n";
-  OS << "typedef __SVUint32x2_t svuint32x2_t;\n";
-  OS << "typedef __SVUint64x2_t svuint64x2_t;\n";
-  OS << "typedef __SVFloat16x2_t svfloat16x2_t;\n";
-  OS << "typedef __SVFloat32x2_t svfloat32x2_t;\n";
-  OS << "typedef __SVFloat64x2_t svfloat64x2_t;\n";
-  OS << "typedef __SVInt8x3_t svint8x3_t;\n";
-  OS << "typedef __SVInt16x3_t svint16x3_t;\n";
-  OS << "typedef __SVInt32x3_t svint32x3_t;\n";
-  OS << "typedef __SVInt64x3_t svint64x3_t;\n";
-  OS << "typedef __SVUint8x3_t svuint8x3_t;\n";
-  OS << "typedef __SVUint16x3_t svuint16x3_t;\n";
-  OS << "typedef __SVUint32x3_t svuint32x3_t;\n";
-  OS << "typedef __SVUint64x3_t svuint64x3_t;\n";
-  OS << "typedef __SVFloat16x3_t svfloat16x3_t;\n";
-  OS << "typedef __SVFloat32x3_t svfloat32x3_t;\n";
-  OS << "typedef __SVFloat64x3_t svfloat64x3_t;\n";
-  OS << "typedef __SVInt8x4_t svint8x4_t;\n";
-  OS << "typedef __SVInt16x4_t svint16x4_t;\n";
-  OS << "typedef __SVInt32x4_t svint32x4_t;\n";
-  OS << "typedef __SVInt64x4_t svint64x4_t;\n";
-  OS << "typedef __SVUint8x4_t svuint8x4_t;\n";
-  OS << "typedef __SVUint16x4_t svuint16x4_t;\n";
-  OS << "typedef __SVUint32x4_t svuint32x4_t;\n";
-  OS << "typedef __SVUint64x4_t svuint64x4_t;\n";
-  OS << "typedef __SVFloat16x4_t svfloat16x4_t;\n";
-  OS << "typedef __SVFloat32x4_t svfloat32x4_t;\n";
-  OS << "typedef __SVFloat64x4_t svfloat64x4_t;\n";
+  OS << "typedef __clang_svint8x2_t svint8x2_t;\n";
+  OS << "typedef __clang_svint16x2_t svint16x2_t;\n";
+  OS << "typedef __clang_svint32x2_t svint32x2_t;\n";
+  OS << "typedef __clang_svint64x2_t svint64x2_t;\n";
+  OS << "typedef __clang_svuint8x2_t svuint8x2_t;\n";
+  OS << "typedef __clang_svuint16x2_t svuint16x2_t;\n";
+  OS << "typedef __clang_svuint32x2_t svuint32x2_t;\n";
+  OS << "typedef __clang_svuint64x2_t svuint64x2_t;\n";
+  OS << "typedef __clang_svfloat16x2_t svfloat16x2_t;\n";
+  OS << "typedef __clang_svfloat32x2_t svfloat32x2_t;\n";
+  OS << "typedef __clang_svfloat64x2_t svfloat64x2_t;\n";
+  OS << "typedef __clang_svint8x3_t svint8x3_t;\n";
+  OS << "typedef __clang_svint16x3_t svint16x3_t;\n";
+  OS << "typedef __clang_svint32x3_t svint32x3_t;\n";
+  OS << "typedef __clang_svint64x3_t svint64x3_t;\n";
+  OS << "typedef __clang_svuint8x3_t svuint8x3_t;\n";
+  OS << "typedef __clang_svuint16x3_t svuint16x3_t;\n";
+  OS << "typedef __clang_svuint32x3_t svuint32x3_t;\n";
+  OS << "typedef __clang_svuint64x3_t svuint64x3_t;\n";
+  OS << "typedef __clang_svfloat16x3_t svfloat16x3_t;\n";
+  OS << "typedef __clang_svfloat32x3_t svfloat32x3_t;\n";
+  OS << "typedef __clang_svfloat64x3_t svfloat64x3_t;\n";
+  OS << "typedef __clang_svint8x4_t svint8x4_t;\n";
+  OS << "typedef __clang_svint16x4_t svint16x4_t;\n";
+  OS << "typedef __clang_svint32x4_t svint32x4_t;\n";
+  OS << "typedef __clang_svint64x4_t svint64x4_t;\n";
+  OS << "typedef __clang_svuint8x4_t svuint8x4_t;\n";
+  OS << "typedef __clang_svuint16x4_t svuint16x4_t;\n";
+  OS << "typedef __clang_svuint32x4_t svuint32x4_t;\n";
+  OS << "typedef __clang_svuint64x4_t svuint64x4_t;\n";
+  OS << "typedef __clang_svfloat16x4_t svfloat16x4_t;\n";
+  OS << "typedef __clang_svfloat32x4_t svfloat32x4_t;\n";
+  OS << "typedef __clang_svfloat64x4_t svfloat64x4_t;\n";
   OS << "typedef