| 1 | //===- MachineValueType.cpp - Machine-Level types ---------------*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "llvm/CodeGenTypes/MachineValueType.h" |
| 10 | |
| 11 | using namespace llvm; |
| 12 | |
| 13 | static constexpr MVT::VecVTTable buildVecVTTable() { |
| 14 | MVT::VecVTTable T{}; |
| 15 | uint8_t NextSlot = 1; |
| 16 | #define GET_VT_ATTR(Ty, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \ |
| 17 | if (Vec && !Tup && !T.Slots[NElem]) \ |
| 18 | T.Slots[NElem] = NextSlot++; |
| 19 | #include "llvm/CodeGen/GenVT.inc" |
| 20 | #undef GET_VT_ATTR |
| 21 | #define GET_VT_ATTR(Ty, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \ |
| 22 | if (Vec && !Tup) \ |
| 23 | T.Tys[Sc][MVT::EltTy][T.Slots[NElem]] = MVT::Ty; |
| 24 | #include "llvm/CodeGen/GenVT.inc" |
| 25 | #undef GET_VT_ATTR |
| 26 | return T; |
| 27 | } |
| 28 | |
| 29 | const MVT::VecVTTable MVT::VecVTs = buildVecVTTable(); |
| 30 | |