1//===-- AArch64MemoryHints.h - AArch64 Memory Hint Attributes ---*- 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#ifndef LLVM_SUPPORT_AARCH64MEMORYHINTS_H
10#define LLVM_SUPPORT_AARCH64MEMORYHINTS_H
11
12namespace llvm {
13enum class AArch64MemoryHint {
14 NONE = 0,
15 STSHH_KEEP = 1,
16 STSHH_STRM = 2,
17 STCPH = 3,
18 SHUH = 4,
19 SHUH_PH = 5,
20};
21
22template <typename Int> inline AArch64MemoryHint toAArch64MemoryHint(Int I) {
23 switch (I) {
24 case 0:
25 return AArch64MemoryHint::STSHH_KEEP;
26 case 1:
27 return AArch64MemoryHint::STSHH_STRM;
28 case 2:
29 return AArch64MemoryHint::STCPH;
30 case 3:
31 return AArch64MemoryHint::SHUH;
32 case 4:
33 return AArch64MemoryHint::SHUH_PH;
34 default:
35 return AArch64MemoryHint::NONE;
36 }
37}
38} // namespace llvm
39#endif // LLVM_SUPPORT_AARCH64MEMORYHINTS_H
40