1 //===-- SPU.h - Top-level interface for Cell SPU Target ----------*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by a team from the Computer Systems Research
6 // Department at The Aerospace Corporation.
8 // See README.txt for details.
10 //===----------------------------------------------------------------------===//
12 // This file contains the entry points for global functions defined in the LLVM
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_TARGET_IBMCELLSPU_H
18 #define LLVM_TARGET_IBMCELLSPU_H
23 class SPUTargetMachine;
26 FunctionPass *createSPUISelDag(SPUTargetMachine &TM);
27 FunctionPass *createSPUAsmPrinterPass(std::ostream &o, SPUTargetMachine &tm);
29 /* Utility functions/predicates/etc used all over the place: */
30 //! Predicate test for a signed 10-bit value
32 \param Value The input value to be tested
34 This predicate tests for a signed 10-bit value, returning the 10-bit value
37 inline bool isS10Constant(short Value) {
38 int SExtValue = ((int) Value << (32 - 10)) >> (32 - 10);
39 return ((Value > 0 && Value <= (1 << 9) - 1)
40 || (Value < 0 && (short) SExtValue == Value));
43 inline bool isS10Constant(int Value) {
44 return (Value >= -(1 << 9) && Value <= (1 << 9) - 1);
47 inline bool isS10Constant(uint32_t Value) {
48 return (Value <= ((1 << 9) - 1));
51 inline bool isS10Constant(int64_t Value) {
52 return (Value >= -(1 << 9) && Value <= (1 << 9) - 1);
55 inline bool isS10Constant(uint64_t Value) {
56 return (Value <= ((1 << 9) - 1));
60 // Defines symbolic names for the SPU instructions.
62 #include "SPUGenInstrNames.inc"
64 #endif /* LLVM_TARGET_IBMCELLSPU_H */