mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-30 22:37:28 +00:00
Move Blackfin intrinsics into the Target/Blackfin directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
11ee508d7b
commit
6ad8c84d70
@ -474,4 +474,3 @@ include "llvm/IntrinsicsARM.td"
|
|||||||
include "llvm/IntrinsicsCellSPU.td"
|
include "llvm/IntrinsicsCellSPU.td"
|
||||||
include "llvm/IntrinsicsAlpha.td"
|
include "llvm/IntrinsicsAlpha.td"
|
||||||
include "llvm/IntrinsicsXCore.td"
|
include "llvm/IntrinsicsXCore.td"
|
||||||
include "llvm/IntrinsicsBlackfin.td"
|
|
||||||
|
@ -74,6 +74,7 @@ def WA_IND_CALL : SubtargetFeature<"ind-call-anomaly", "wa_ind_call", "true",
|
|||||||
|
|
||||||
include "BlackfinRegisterInfo.td"
|
include "BlackfinRegisterInfo.td"
|
||||||
include "BlackfinCallingConv.td"
|
include "BlackfinCallingConv.td"
|
||||||
|
include "BlackfinIntrinsics.td"
|
||||||
include "BlackfinInstrInfo.td"
|
include "BlackfinInstrInfo.td"
|
||||||
|
|
||||||
def BlackfinInstrInfo : InstrInfo {}
|
def BlackfinInstrInfo : InstrInfo {}
|
||||||
|
53
lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
Normal file
53
lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
//===- BlackfinIntrinsicInfo.cpp - Intrinsic Information --------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// This file contains the Blackfin implementation of TargetIntrinsicInfo.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "BlackfinIntrinsicInfo.h"
|
||||||
|
#include "llvm/Intrinsics.h"
|
||||||
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
using namespace llvm;
|
||||||
|
|
||||||
|
namespace bfinIntrinsic {
|
||||||
|
|
||||||
|
enum ID {
|
||||||
|
last_non_bfin_intrinsic = Intrinsic::num_intrinsics-1,
|
||||||
|
#define GET_INTRINSIC_ENUM_VALUES
|
||||||
|
#include "BlackfinGenIntrinsics.inc"
|
||||||
|
#undef GET_INTRINSIC_ENUM_VALUES
|
||||||
|
, num_bfin_intrinsics
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *BlackfinIntrinsicInfo::getName(unsigned IntrID) const {
|
||||||
|
static const char *const names[] = {
|
||||||
|
#define GET_INTRINSIC_NAME_TABLE
|
||||||
|
#include "BlackfinGenIntrinsics.inc"
|
||||||
|
#undef GET_INTRINSIC_NAME_TABLE
|
||||||
|
};
|
||||||
|
|
||||||
|
if (IntrID < Intrinsic::num_intrinsics)
|
||||||
|
return 0;
|
||||||
|
assert(IntrID < bfinIntrinsic::num_bfin_intrinsics && "Invalid intrinsic ID");
|
||||||
|
|
||||||
|
return names[IntrID - Intrinsic::num_intrinsics];
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned
|
||||||
|
BlackfinIntrinsicInfo::lookupName(const char *Name, unsigned Len) const {
|
||||||
|
#define GET_FUNCTION_RECOGNIZER
|
||||||
|
#include "BlackfinGenIntrinsics.inc"
|
||||||
|
#undef GET_FUNCTION_RECOGNIZER
|
||||||
|
return 0;
|
||||||
|
}
|
28
lib/Target/Blackfin/BlackfinIntrinsicInfo.h
Normal file
28
lib/Target/Blackfin/BlackfinIntrinsicInfo.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
//===- BlackfinIntrinsicInfo.h - Blackfin Intrinsic Information -*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// This file contains the Blackfin implementation of TargetIntrinsicInfo.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
#ifndef BLACKFININTRINSICS_H
|
||||||
|
#define BLACKFININTRINSICS_H
|
||||||
|
|
||||||
|
#include "llvm/Target/TargetIntrinsicInfo.h"
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
|
|
||||||
|
class BlackfinIntrinsicInfo : public TargetIntrinsicInfo {
|
||||||
|
public:
|
||||||
|
const char *getName(unsigned IntrID) const;
|
||||||
|
unsigned lookupName(const char *Name, unsigned Len) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,4 +1,4 @@
|
|||||||
//===- IntrinsicsBlackfin.td - Defines Blackfin intrinsics -*- tablegen -*-===//
|
//===- BlackfinIntrinsics.td - Defines Blackfin intrinsics -*- tablegen -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -11,24 +11,24 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
let TargetPrefix = "bfin", isTarget = 1 in {
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Core synchronisation etc.
|
// Core synchronisation etc.
|
||||||
//
|
//
|
||||||
// These intrinsics have sideeffects. Each represent a single instruction, but
|
// These intrinsics have sideeffects. Each represent a single instruction, but
|
||||||
// workarounds are sometimes required depending on the cpu.
|
// workarounds are sometimes required depending on the cpu.
|
||||||
|
|
||||||
let TargetPrefix = "bfin" in {
|
// Execute csync instruction with workarounds
|
||||||
|
def int_bfin_csync : GCCBuiltin<"__builtin_bfin_csync">,
|
||||||
|
Intrinsic<[llvm_void_ty]>;
|
||||||
|
|
||||||
// Execute csync instruction with workarounds
|
// Execute ssync instruction with workarounds
|
||||||
def int_bfin_csync : GCCBuiltin<"__builtin_bfin_csync">,
|
def int_bfin_ssync : GCCBuiltin<"__builtin_bfin_ssync">,
|
||||||
Intrinsic<[llvm_void_ty]>;
|
Intrinsic<[llvm_void_ty]>;
|
||||||
|
|
||||||
// Execute ssync instruction with workarounds
|
// Execute idle instruction with workarounds
|
||||||
def int_bfin_ssync : GCCBuiltin<"__builtin_bfin_ssync">,
|
def int_bfin_idle : GCCBuiltin<"__builtin_bfin_idle">,
|
||||||
Intrinsic<[llvm_void_ty]>;
|
Intrinsic<[llvm_void_ty]>;
|
||||||
|
|
||||||
// Execute idle instruction with workarounds
|
|
||||||
def int_bfin_idle : GCCBuiltin<"__builtin_bfin_idle">,
|
|
||||||
Intrinsic<[llvm_void_ty]>;
|
|
||||||
|
|
||||||
}
|
}
|
@ -20,6 +20,7 @@
|
|||||||
#include "BlackfinInstrInfo.h"
|
#include "BlackfinInstrInfo.h"
|
||||||
#include "BlackfinSubtarget.h"
|
#include "BlackfinSubtarget.h"
|
||||||
#include "BlackfinISelLowering.h"
|
#include "BlackfinISelLowering.h"
|
||||||
|
#include "BlackfinIntrinsicInfo.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ namespace llvm {
|
|||||||
BlackfinTargetLowering TLInfo;
|
BlackfinTargetLowering TLInfo;
|
||||||
BlackfinInstrInfo InstrInfo;
|
BlackfinInstrInfo InstrInfo;
|
||||||
TargetFrameInfo FrameInfo;
|
TargetFrameInfo FrameInfo;
|
||||||
|
BlackfinIntrinsicInfo IntrinsicInfo;
|
||||||
public:
|
public:
|
||||||
BlackfinTargetMachine(const Target &T, const std::string &TT,
|
BlackfinTargetMachine(const Target &T, const std::string &TT,
|
||||||
const std::string &FS);
|
const std::string &FS);
|
||||||
@ -47,6 +49,9 @@ namespace llvm {
|
|||||||
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
||||||
virtual bool addInstSelector(PassManagerBase &PM,
|
virtual bool addInstSelector(PassManagerBase &PM,
|
||||||
CodeGenOpt::Level OptLevel);
|
CodeGenOpt::Level OptLevel);
|
||||||
|
const TargetIntrinsicInfo *getIntrinsicInfo() const {
|
||||||
|
return &IntrinsicInfo;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
@ -9,9 +9,11 @@ tablegen(BlackfinGenAsmWriter.inc -gen-asm-writer)
|
|||||||
tablegen(BlackfinGenDAGISel.inc -gen-dag-isel)
|
tablegen(BlackfinGenDAGISel.inc -gen-dag-isel)
|
||||||
tablegen(BlackfinGenSubtarget.inc -gen-subtarget)
|
tablegen(BlackfinGenSubtarget.inc -gen-subtarget)
|
||||||
tablegen(BlackfinGenCallingConv.inc -gen-callingconv)
|
tablegen(BlackfinGenCallingConv.inc -gen-callingconv)
|
||||||
|
tablegen(BlackfinGenIntrinsics.inc -gen-tgt-intrinsic)
|
||||||
|
|
||||||
add_llvm_target(BlackfinCodeGen
|
add_llvm_target(BlackfinCodeGen
|
||||||
BlackfinInstrInfo.cpp
|
BlackfinInstrInfo.cpp
|
||||||
|
BlackfinIntrinsicInfo.cpp
|
||||||
BlackfinISelDAGToDAG.cpp
|
BlackfinISelDAGToDAG.cpp
|
||||||
BlackfinISelLowering.cpp
|
BlackfinISelLowering.cpp
|
||||||
BlackfinMCAsmInfo.cpp
|
BlackfinMCAsmInfo.cpp
|
||||||
|
@ -15,7 +15,7 @@ BUILT_SOURCES = BlackfinGenRegisterInfo.h.inc BlackfinGenRegisterNames.inc \
|
|||||||
BlackfinGenRegisterInfo.inc BlackfinGenInstrNames.inc \
|
BlackfinGenRegisterInfo.inc BlackfinGenInstrNames.inc \
|
||||||
BlackfinGenInstrInfo.inc BlackfinGenAsmWriter.inc \
|
BlackfinGenInstrInfo.inc BlackfinGenAsmWriter.inc \
|
||||||
BlackfinGenDAGISel.inc BlackfinGenSubtarget.inc \
|
BlackfinGenDAGISel.inc BlackfinGenSubtarget.inc \
|
||||||
BlackfinGenCallingConv.inc
|
BlackfinGenCallingConv.inc BlackfinGenIntrinsics.inc
|
||||||
|
|
||||||
DIRS = AsmPrinter TargetInfo
|
DIRS = AsmPrinter TargetInfo
|
||||||
|
|
||||||
|
@ -2,8 +2,11 @@
|
|||||||
|
|
||||||
define void @f() nounwind {
|
define void @f() nounwind {
|
||||||
entry:
|
entry:
|
||||||
|
; CHECK-NOT: llvm.bfin
|
||||||
; CHECK: csync;
|
; CHECK: csync;
|
||||||
call void @llvm.bfin.csync()
|
call void @llvm.bfin.csync()
|
||||||
|
|
||||||
|
; CHECK-NOT: llvm.bfin
|
||||||
; CHECK: ssync;
|
; CHECK: ssync;
|
||||||
call void @llvm.bfin.ssync()
|
call void @llvm.bfin.ssync()
|
||||||
ret void
|
ret void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user