Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 6a8aceb

Browse files
committed
Use new neon_vector_type and neon_polyvector_type attributes for Neon vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119406 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 4fbf638 commit 6a8aceb

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

utils/TableGen/NeonEmitter.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -844,21 +844,25 @@ void NeonEmitter::run(raw_ostream &OS) {
844844

845845
// Emit vector typedefs.
846846
for (unsigned i = 0, e = TDTypeVec.size(); i != e; ++i) {
847-
bool dummy, quad = false;
848-
(void) ClassifyType(TDTypeVec[i], quad, dummy, dummy);
849-
OS << "typedef __attribute__(( __vector_size__(";
847+
bool dummy, quad = false, poly = false;
848+
(void) ClassifyType(TDTypeVec[i], quad, poly, dummy);
849+
if (poly)
850+
OS << "typedef __attribute__((neon_polyvector_type(";
851+
else
852+
OS << "typedef __attribute__((neon_vector_type(";
850853

851-
OS << utostr(8*(quad ? 2 : 1)) << ") )) ";
852-
if (!quad)
854+
unsigned nElts = GetNumElements(TDTypeVec[i], quad);
855+
OS << utostr(nElts) << "))) ";
856+
if (nElts < 10)
853857
OS << " ";
854858

855859
OS << TypeString('s', TDTypeVec[i]);
856860
OS << " " << TypeString('d', TDTypeVec[i]) << ";\n";
857861
}
858862
OS << "\n";
859-
OS << "typedef __attribute__(( __vector_size__(8) )) "
863+
OS << "typedef __attribute__((__vector_size__(8))) "
860864
"double float64x1_t;\n";
861-
OS << "typedef __attribute__(( __vector_size__(16) )) "
865+
OS << "typedef __attribute__((__vector_size__(16))) "
862866
"double float64x2_t;\n";
863867
OS << "\n";
864868

0 commit comments

Comments
 (0)