aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/include/llvm/Support/X86FoldTablesUtils.h
blob: 77d32cc7fb37ed39e8c4765035bae3689ec549de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//===-- X86FoldTablesUtils.h ------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SUPPORT_X86FOLDTABLESUTILS_H
#define LLVM_SUPPORT_X86FOLDTABLESUTILS_H

namespace llvm {
enum {
  // Select which memory operand is being unfolded.
  // (stored in bits 0 - 2)
  TB_INDEX_0 = 0,
  TB_INDEX_1 = 1,
  TB_INDEX_2 = 2,
  TB_INDEX_3 = 3,
  TB_INDEX_4 = 4,
  TB_INDEX_MASK = 0x7,

  // Do not insert the reverse map (MemOp -> RegOp) into the table.
  // This may be needed because there is a many -> one mapping.
  TB_NO_REVERSE = 1 << 3,

  // Do not insert the forward map (RegOp -> MemOp) into the table.
  // This is needed for Native Client, which prohibits branch
  // instructions from using a memory operand.
  TB_NO_FORWARD = 1 << 4,

  TB_FOLDED_LOAD = 1 << 5,
  TB_FOLDED_STORE = 1 << 6,
  TB_FOLDED_BCAST = 1 << 7,

  // Minimum alignment required for load/store.
  // Used for RegOp->MemOp conversion. Encoded as Log2(Align)
  // (stored in bits 9 - 11)
  TB_ALIGN_SHIFT = 8,
  TB_ALIGN_1 = 0 << TB_ALIGN_SHIFT,
  TB_ALIGN_16 = 4 << TB_ALIGN_SHIFT,
  TB_ALIGN_32 = 5 << TB_ALIGN_SHIFT,
  TB_ALIGN_64 = 6 << TB_ALIGN_SHIFT,
  TB_ALIGN_MASK = 0x7 << TB_ALIGN_SHIFT,

  // Broadcast type.
  // (stored in bits 12 - 14)
  TB_BCAST_TYPE_SHIFT = TB_ALIGN_SHIFT + 3,
  TB_BCAST_W = 0 << TB_BCAST_TYPE_SHIFT,
  TB_BCAST_D = 1 << TB_BCAST_TYPE_SHIFT,
  TB_BCAST_Q = 2 << TB_BCAST_TYPE_SHIFT,
  TB_BCAST_SS = 3 << TB_BCAST_TYPE_SHIFT,
  TB_BCAST_SD = 4 << TB_BCAST_TYPE_SHIFT,
  TB_BCAST_SH = 5 << TB_BCAST_TYPE_SHIFT,
  TB_BCAST_MASK = 0x7 << TB_BCAST_TYPE_SHIFT,

  // Unused bits 15-16
};
} // namespace llvm
#endif // LLVM_SUPPORT_X86FOLDTABLESUTILS_H