~ubuntu-branches/ubuntu/quantal/llvm-3.1/quantal

« back to all changes in this revision

Viewing changes to lib/Target/Hexagon/HexagonSubtarget.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-03-29 19:09:51 UTC
  • Revision ID: package-import@ubuntu.com-20120329190951-aq83ivog4cg8bxun
Tags: upstream-3.1~svn153643
ImportĀ upstreamĀ versionĀ 3.1~svn153643

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===-- HexagonSubtarget.cpp - Hexagon Subtarget Information --------------===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is distributed under the University of Illinois Open Source
 
6
// License. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
//
 
10
// This file implements the Hexagon specific subclass of TargetSubtarget.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#include "HexagonSubtarget.h"
 
15
#include "Hexagon.h"
 
16
#include "llvm/Support/CommandLine.h"
 
17
#include "llvm/Support/ErrorHandling.h"
 
18
using namespace llvm;
 
19
 
 
20
#define GET_SUBTARGETINFO_CTOR
 
21
#define GET_SUBTARGETINFO_TARGET_DESC
 
22
#include "HexagonGenSubtargetInfo.inc"
 
23
 
 
24
static cl::opt<bool>
 
25
EnableV3("enable-hexagon-v3", cl::Hidden,
 
26
         cl::desc("Enable Hexagon V3 instructions."));
 
27
 
 
28
static cl::opt<bool>
 
29
EnableMemOps(
 
30
    "enable-hexagon-memops",
 
31
    cl::Hidden, cl::ZeroOrMore, cl::ValueDisallowed,
 
32
    cl::desc("Generate V4 MEMOP in code generation for Hexagon target"));
 
33
 
 
34
HexagonSubtarget::HexagonSubtarget(StringRef TT, StringRef CPU, StringRef FS):
 
35
  HexagonGenSubtargetInfo(TT, CPU, FS),
 
36
  HexagonArchVersion(V1),
 
37
  CPUString(CPU.str()) {
 
38
  ParseSubtargetFeatures(CPU, FS);
 
39
 
 
40
  switch(HexagonArchVersion) {
 
41
  case HexagonSubtarget::V2:
 
42
    break;
 
43
  case HexagonSubtarget::V3:
 
44
    EnableV3 = true;
 
45
    break;
 
46
  case HexagonSubtarget::V4:
 
47
    break;
 
48
  default:
 
49
    llvm_unreachable("Unknown Architecture Version.");
 
50
  }
 
51
 
 
52
  // Initialize scheduling itinerary for the specified CPU.
 
53
  InstrItins = getInstrItineraryForCPU(CPUString);
 
54
 
 
55
  // Max issue per cycle == bundle width.
 
56
  InstrItins.IssueWidth = 4;
 
57
 
 
58
  if (EnableMemOps)
 
59
    UseMemOps = true;
 
60
  else
 
61
    UseMemOps = false;
 
62
}