llvm/llvm/lib/Target/SystemZ/SystemZ.h

//==- SystemZ.h - Top-Level Interface for SystemZ representation -*- 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
//
//===----------------------------------------------------------------------===//
//
// This file contains the entry points for global functions defined in
// the LLVM SystemZ backend.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZ_H
#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZ_H

#include "MCTargetDesc/SystemZMCTargetDesc.h"
#include "llvm/Support/CodeGen.h"

namespace llvm {
class FunctionPass;
class PassRegistry;
class SystemZTargetMachine;

namespace SystemZ {
// Condition-code mask values.
const unsigned CCMASK_0 =;
const unsigned CCMASK_1 =;
const unsigned CCMASK_2 =;
const unsigned CCMASK_3 =;
const unsigned CCMASK_ANY =;

// Condition-code mask assignments for integer and floating-point
// comparisons.
const unsigned CCMASK_CMP_EQ =;
const unsigned CCMASK_CMP_LT =;
const unsigned CCMASK_CMP_GT =;
const unsigned CCMASK_CMP_NE =;
const unsigned CCMASK_CMP_LE =;
const unsigned CCMASK_CMP_GE =;

// Condition-code mask assignments for floating-point comparisons only.
const unsigned CCMASK_CMP_UO =;
const unsigned CCMASK_CMP_O  =;

// All condition-code values produced by comparisons.
const unsigned CCMASK_ICMP =;
const unsigned CCMASK_FCMP =;

// Condition-code mask assignments for arithmetical operations.
const unsigned CCMASK_ARITH_EQ       =;
const unsigned CCMASK_ARITH_LT       =;
const unsigned CCMASK_ARITH_GT       =;
const unsigned CCMASK_ARITH_OVERFLOW =;
const unsigned CCMASK_ARITH          =;

// Condition-code mask assignments for logical operations.
const unsigned CCMASK_LOGICAL_ZERO     =;
const unsigned CCMASK_LOGICAL_NONZERO  =;
const unsigned CCMASK_LOGICAL_CARRY    =;
const unsigned CCMASK_LOGICAL_NOCARRY  =;
const unsigned CCMASK_LOGICAL_BORROW   =;
const unsigned CCMASK_LOGICAL_NOBORROW =;
const unsigned CCMASK_LOGICAL          =;

// Condition-code mask assignments for CS.
const unsigned CCMASK_CS_EQ =;
const unsigned CCMASK_CS_NE =;
const unsigned CCMASK_CS    =;

// Condition-code mask assignments for a completed SRST loop.
const unsigned CCMASK_SRST_FOUND    =;
const unsigned CCMASK_SRST_NOTFOUND =;
const unsigned CCMASK_SRST          =;

// Condition-code mask assignments for TEST UNDER MASK.
const unsigned CCMASK_TM_ALL_0       =;
const unsigned CCMASK_TM_MIXED_MSB_0 =;
const unsigned CCMASK_TM_MIXED_MSB_1 =;
const unsigned CCMASK_TM_ALL_1       =;
const unsigned CCMASK_TM_SOME_0      =;
const unsigned CCMASK_TM_SOME_1      =;
const unsigned CCMASK_TM_MSB_0       =;
const unsigned CCMASK_TM_MSB_1       =;
const unsigned CCMASK_TM             =;

// Condition-code mask assignments for TRANSACTION_BEGIN.
const unsigned CCMASK_TBEGIN_STARTED       =;
const unsigned CCMASK_TBEGIN_INDETERMINATE =;
const unsigned CCMASK_TBEGIN_TRANSIENT     =;
const unsigned CCMASK_TBEGIN_PERSISTENT    =;
const unsigned CCMASK_TBEGIN               =;

// Condition-code mask assignments for TRANSACTION_END.
const unsigned CCMASK_TEND_TX   =;
const unsigned CCMASK_TEND_NOTX =;
const unsigned CCMASK_TEND      =;

// Condition-code mask assignments for vector comparisons (and similar
// operations).
const unsigned CCMASK_VCMP_ALL       =;
const unsigned CCMASK_VCMP_MIXED     =;
const unsigned CCMASK_VCMP_NONE      =;
const unsigned CCMASK_VCMP           =;

// Condition-code mask assignments for Test Data Class.
const unsigned CCMASK_TDC_NOMATCH   =;
const unsigned CCMASK_TDC_MATCH     =;
const unsigned CCMASK_TDC           =;

// The position of the low CC bit in an IPM result.
const unsigned IPM_CC =;

// Mask assignments for PFD.
const unsigned PFD_READ  =;
const unsigned PFD_WRITE =;

// Mask assignments for TDC
const unsigned TDCMASK_ZERO_PLUS       =;
const unsigned TDCMASK_ZERO_MINUS      =;
const unsigned TDCMASK_NORMAL_PLUS     =;
const unsigned TDCMASK_NORMAL_MINUS    =;
const unsigned TDCMASK_SUBNORMAL_PLUS  =;
const unsigned TDCMASK_SUBNORMAL_MINUS =;
const unsigned TDCMASK_INFINITY_PLUS   =;
const unsigned TDCMASK_INFINITY_MINUS  =;
const unsigned TDCMASK_QNAN_PLUS       =;
const unsigned TDCMASK_QNAN_MINUS      =;
const unsigned TDCMASK_SNAN_PLUS       =;
const unsigned TDCMASK_SNAN_MINUS      =;

const unsigned TDCMASK_ZERO            =;
const unsigned TDCMASK_POSITIVE        =;
const unsigned TDCMASK_NEGATIVE        =;
const unsigned TDCMASK_NAN             =;
const unsigned TDCMASK_PLUS            =;
const unsigned TDCMASK_MINUS           =;
const unsigned TDCMASK_ALL             =;

// Number of bits in a vector register.
const unsigned VectorBits =;

// Number of bytes in a vector register (and consequently the number of
// bytes in a general permute vector).
const unsigned VectorBytes =;

// Return true if Val fits an LLILL operand.
static inline bool isImmLL(uint64_t Val) {}

// Return true if Val fits an LLILH operand.
static inline bool isImmLH(uint64_t Val) {}

// Return true if Val fits an LLIHL operand.
static inline bool isImmHL(uint64_t Val) {}

// Return true if Val fits an LLIHH operand.
static inline bool isImmHH(uint64_t Val) {}

// Return true if Val fits an LLILF operand.
static inline bool isImmLF(uint64_t Val) {}

// Return true if Val fits an LLIHF operand.
static inline bool isImmHF(uint64_t Val) {}
} // end namespace SystemZ

FunctionPass *createSystemZISelDag(SystemZTargetMachine &TM,
                                   CodeGenOptLevel OptLevel);
FunctionPass *createSystemZElimComparePass(SystemZTargetMachine &TM);
FunctionPass *createSystemZShortenInstPass(SystemZTargetMachine &TM);
FunctionPass *createSystemZLongBranchPass(SystemZTargetMachine &TM);
FunctionPass *createSystemZLDCleanupPass(SystemZTargetMachine &TM);
FunctionPass *createSystemZCopyPhysRegsPass(SystemZTargetMachine &TM);
FunctionPass *createSystemZPostRewritePass(SystemZTargetMachine &TM);
FunctionPass *createSystemZTDCPass();

void initializeSystemZCopyPhysRegsPass(PassRegistry &);
void initializeSystemZDAGToDAGISelLegacyPass(PassRegistry &);
void initializeSystemZElimComparePass(PassRegistry &);
void initializeSystemZLDCleanupPass(PassRegistry &);
void initializeSystemZLongBranchPass(PassRegistry &);
void initializeSystemZPostRewritePass(PassRegistry &);
void initializeSystemZShortenInstPass(PassRegistry &);
void initializeSystemZTDCPassPass(PassRegistry &);

namespace SYSTEMZAS {
enum : unsigned {};
} // namespace SYSTEMZAS

} // end namespace llvm

#endif