94 lines · c
1//===-- SystemZSelectionDAGInfo.h - SystemZ SelectionDAG Info ---*- 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-exception6//7//===----------------------------------------------------------------------===//8//9// This file defines the SystemZ subclass for SelectionDAGTargetInfo.10//11//===----------------------------------------------------------------------===//12 13#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSELECTIONDAGINFO_H14#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSELECTIONDAGINFO_H15 16#include "llvm/CodeGen/SelectionDAGTargetInfo.h"17 18#define GET_SDNODE_ENUM19#include "SystemZGenSDNodeInfo.inc"20 21namespace llvm {22namespace SystemZISD {23 24enum NodeType : unsigned {25 // Set the condition code from a boolean value in operand 0.26 // Operand 1 is a mask of all condition-code values that may result of this27 // operation, operand 2 is a mask of condition-code values that may result28 // if the boolean is true.29 // Note that this operation is always optimized away, we will never30 // generate any code for it.31 GET_CCMASK = GENERATED_OPCODE_END,32};33 34// Return true if OPCODE is some kind of PC-relative address.35inline bool isPCREL(unsigned Opcode) {36 return Opcode == PCREL_WRAPPER || Opcode == PCREL_OFFSET;37}38 39} // namespace SystemZISD40 41class SystemZSelectionDAGInfo : public SelectionDAGGenTargetInfo {42public:43 SystemZSelectionDAGInfo();44 45 const char *getTargetNodeName(unsigned Opcode) const override;46 47 SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, const SDLoc &DL,48 SDValue Chain, SDValue Dst, SDValue Src,49 SDValue Size, Align Alignment,50 bool IsVolatile, bool AlwaysInline,51 MachinePointerInfo DstPtrInfo,52 MachinePointerInfo SrcPtrInfo) const override;53 54 SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &DL,55 SDValue Chain, SDValue Dst, SDValue Byte,56 SDValue Size, Align Alignment,57 bool IsVolatile, bool AlwaysInline,58 MachinePointerInfo DstPtrInfo) const override;59 60 std::pair<SDValue, SDValue>61 EmitTargetCodeForMemcmp(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain,62 SDValue Src1, SDValue Src2, SDValue Size,63 const CallInst *CI) const override;64 65 std::pair<SDValue, SDValue>66 EmitTargetCodeForMemchr(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain,67 SDValue Src, SDValue Char, SDValue Length,68 MachinePointerInfo SrcPtrInfo) const override;69 70 std::pair<SDValue, SDValue> EmitTargetCodeForStrcpy(71 SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dest,72 SDValue Src, MachinePointerInfo DestPtrInfo,73 MachinePointerInfo SrcPtrInfo, bool isStpcpy) const override;74 75 std::pair<SDValue, SDValue>76 EmitTargetCodeForStrcmp(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain,77 SDValue Src1, SDValue Src2,78 MachinePointerInfo Op1PtrInfo,79 MachinePointerInfo Op2PtrInfo) const override;80 81 std::pair<SDValue, SDValue>82 EmitTargetCodeForStrlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain,83 SDValue Src, const CallInst *CI) const override;84 85 std::pair<SDValue, SDValue>86 EmitTargetCodeForStrnlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain,87 SDValue Src, SDValue MaxLength,88 MachinePointerInfo SrcPtrInfo) const override;89};90 91} // end namespace llvm92 93#endif94