2005-09-03 02:46:02 +08:00
|
|
|
//===-- AlphaISelLowering.cpp - Alpha DAG Lowering Implementation ---------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Andrew Lenharth and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the AlphaISelLowering class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "AlphaISelLowering.h"
|
|
|
|
#include "AlphaTargetMachine.h"
|
|
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
|
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
|
|
|
#include "llvm/CodeGen/SelectionDAG.h"
|
|
|
|
#include "llvm/CodeGen/SSARegMap.h"
|
|
|
|
#include "llvm/Constants.h"
|
|
|
|
#include "llvm/Function.h"
|
2006-01-24 04:59:50 +08:00
|
|
|
#include "llvm/Module.h"
|
2005-09-03 02:46:02 +08:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
/// AddLiveIn - This helper function adds the specified physical register to the
|
|
|
|
/// MachineFunction as a live in value. It also creates a corresponding virtual
|
|
|
|
/// register for it.
|
|
|
|
static unsigned AddLiveIn(MachineFunction &MF, unsigned PReg,
|
|
|
|
TargetRegisterClass *RC) {
|
|
|
|
assert(RC->contains(PReg) && "Not the correct regclass!");
|
|
|
|
unsigned VReg = MF.getSSARegMap()->createVirtualRegister(RC);
|
|
|
|
MF.addLiveIn(PReg, VReg);
|
|
|
|
return VReg;
|
|
|
|
}
|
|
|
|
|
|
|
|
AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM) {
|
|
|
|
// Set up the TargetLowering object.
|
|
|
|
//I am having problems with shr n ubyte 1
|
|
|
|
setShiftAmountType(MVT::i64);
|
|
|
|
setSetCCResultType(MVT::i64);
|
|
|
|
setSetCCResultContents(ZeroOrOneSetCCResult);
|
|
|
|
|
2006-10-07 06:46:51 +08:00
|
|
|
setUsesGlobalOffsetTable(true);
|
|
|
|
|
2005-09-03 02:46:02 +08:00
|
|
|
addRegisterClass(MVT::i64, Alpha::GPRCRegisterClass);
|
2005-11-10 03:17:08 +08:00
|
|
|
addRegisterClass(MVT::f64, Alpha::F8RCRegisterClass);
|
|
|
|
addRegisterClass(MVT::f32, Alpha::F4RCRegisterClass);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2006-10-04 08:56:09 +08:00
|
|
|
setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote);
|
|
|
|
setLoadXAction(ISD::EXTLOAD, MVT::f32, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2006-10-04 08:56:09 +08:00
|
|
|
setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote);
|
|
|
|
setLoadXAction(ISD::ZEXTLOAD, MVT::i32, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2006-10-04 08:56:09 +08:00
|
|
|
setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
|
|
|
|
setLoadXAction(ISD::SEXTLOAD, MVT::i8, Expand);
|
|
|
|
setLoadXAction(ISD::SEXTLOAD, MVT::i16, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2006-10-04 08:56:09 +08:00
|
|
|
// setOperationAction(ISD::BRIND, MVT::i64, Expand);
|
|
|
|
setOperationAction(ISD::BR_CC, MVT::Other, Expand);
|
|
|
|
setOperationAction(ISD::SELECT_CC, MVT::Other, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2005-10-07 00:54:29 +08:00
|
|
|
setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote);
|
|
|
|
|
2006-06-28 07:19:14 +08:00
|
|
|
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
|
|
|
|
|
2005-09-29 06:29:17 +08:00
|
|
|
setOperationAction(ISD::FREM, MVT::f32, Expand);
|
|
|
|
setOperationAction(ISD::FREM, MVT::f64, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
|
|
|
setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand);
|
2005-11-30 15:19:56 +08:00
|
|
|
setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom);
|
2005-12-01 00:10:29 +08:00
|
|
|
setOperationAction(ISD::FP_TO_UINT, MVT::i64, Expand);
|
|
|
|
setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom);
|
|
|
|
|
2005-09-30 06:54:56 +08:00
|
|
|
if (!TM.getSubtarget<AlphaSubtarget>().hasCT()) {
|
2005-09-03 02:46:02 +08:00
|
|
|
setOperationAction(ISD::CTPOP , MVT::i64 , Expand);
|
|
|
|
setOperationAction(ISD::CTTZ , MVT::i64 , Expand);
|
|
|
|
setOperationAction(ISD::CTLZ , MVT::i64 , Expand);
|
|
|
|
}
|
2006-01-14 11:14:10 +08:00
|
|
|
setOperationAction(ISD::BSWAP , MVT::i64, Expand);
|
2006-01-12 05:21:00 +08:00
|
|
|
setOperationAction(ISD::ROTL , MVT::i64, Expand);
|
|
|
|
setOperationAction(ISD::ROTR , MVT::i64, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2005-12-25 09:34:27 +08:00
|
|
|
setOperationAction(ISD::SREM , MVT::i64, Custom);
|
|
|
|
setOperationAction(ISD::UREM , MVT::i64, Custom);
|
|
|
|
setOperationAction(ISD::SDIV , MVT::i64, Custom);
|
|
|
|
setOperationAction(ISD::UDIV , MVT::i64, Custom);
|
2006-04-03 11:18:59 +08:00
|
|
|
|
2005-09-03 02:46:02 +08:00
|
|
|
setOperationAction(ISD::MEMMOVE , MVT::Other, Expand);
|
|
|
|
setOperationAction(ISD::MEMSET , MVT::Other, Expand);
|
|
|
|
setOperationAction(ISD::MEMCPY , MVT::Other, Expand);
|
|
|
|
|
|
|
|
// We don't support sin/cos/sqrt
|
|
|
|
setOperationAction(ISD::FSIN , MVT::f64, Expand);
|
|
|
|
setOperationAction(ISD::FCOS , MVT::f64, Expand);
|
|
|
|
setOperationAction(ISD::FSIN , MVT::f32, Expand);
|
|
|
|
setOperationAction(ISD::FCOS , MVT::f32, Expand);
|
2006-01-20 05:10:38 +08:00
|
|
|
|
|
|
|
setOperationAction(ISD::FSQRT, MVT::f64, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
setOperationAction(ISD::FSQRT, MVT::f32, Expand);
|
2006-03-05 13:08:37 +08:00
|
|
|
|
2005-12-01 01:11:20 +08:00
|
|
|
setOperationAction(ISD::SETCC, MVT::f32, Promote);
|
2005-11-29 14:16:21 +08:00
|
|
|
|
|
|
|
// We don't have line number support yet.
|
|
|
|
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
|
2006-01-05 09:47:43 +08:00
|
|
|
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
|
|
|
|
setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand);
|
2006-01-13 10:42:53 +08:00
|
|
|
|
|
|
|
// Not implemented yet.
|
|
|
|
setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
|
|
|
|
setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
|
2006-01-17 05:22:38 +08:00
|
|
|
setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Expand);
|
|
|
|
|
2005-12-25 09:34:27 +08:00
|
|
|
// We want to legalize GlobalAddress and ConstantPool and
|
|
|
|
// ExternalSymbols nodes into the appropriate instructions to
|
|
|
|
// materialize the address.
|
|
|
|
setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);
|
|
|
|
setOperationAction(ISD::ConstantPool, MVT::i64, Custom);
|
|
|
|
setOperationAction(ISD::ExternalSymbol, MVT::i64, Custom);
|
2005-12-24 13:36:33 +08:00
|
|
|
|
2006-01-26 05:54:38 +08:00
|
|
|
setOperationAction(ISD::VASTART, MVT::Other, Custom);
|
2006-01-26 07:33:32 +08:00
|
|
|
setOperationAction(ISD::VAEND, MVT::Other, Expand);
|
2006-01-26 05:54:38 +08:00
|
|
|
setOperationAction(ISD::VACOPY, MVT::Other, Custom);
|
2006-01-26 06:28:07 +08:00
|
|
|
setOperationAction(ISD::VAARG, MVT::Other, Custom);
|
2006-01-28 11:14:31 +08:00
|
|
|
setOperationAction(ISD::VAARG, MVT::i32, Custom);
|
2006-01-26 05:54:38 +08:00
|
|
|
|
2006-06-13 02:09:24 +08:00
|
|
|
setOperationAction(ISD::RET, MVT::Other, Custom);
|
|
|
|
|
2006-09-19 02:01:03 +08:00
|
|
|
setOperationAction(ISD::JumpTable, MVT::i64, Custom);
|
2006-09-25 03:46:56 +08:00
|
|
|
setOperationAction(ISD::JumpTable, MVT::i32, Custom);
|
|
|
|
setOperationAction(ISD::JumpTableRelocBase, MVT::i64, Custom);
|
2006-09-19 02:01:03 +08:00
|
|
|
|
2006-01-17 05:22:38 +08:00
|
|
|
setStackPointerRegisterToSaveRestore(Alpha::R30);
|
|
|
|
|
2006-01-29 14:25:22 +08:00
|
|
|
setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
|
|
|
|
setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
|
2005-09-03 02:46:02 +08:00
|
|
|
addLegalFPImmediate(+0.0); //F31
|
|
|
|
addLegalFPImmediate(-0.0); //-F31
|
2005-11-30 15:19:56 +08:00
|
|
|
|
2006-09-05 08:22:25 +08:00
|
|
|
setJumpBufSize(272);
|
|
|
|
setJumpBufAlignment(16);
|
|
|
|
|
2005-11-30 15:19:56 +08:00
|
|
|
computeRegisterProperties();
|
|
|
|
|
|
|
|
useITOF = TM.getSubtarget<AlphaSubtarget>().hasF2I();
|
2005-09-03 02:46:02 +08:00
|
|
|
}
|
|
|
|
|
2006-01-17 03:53:25 +08:00
|
|
|
const char *AlphaTargetLowering::getTargetNodeName(unsigned Opcode) const {
|
|
|
|
switch (Opcode) {
|
|
|
|
default: return 0;
|
|
|
|
case AlphaISD::ITOFT_: return "Alpha::ITOFT_";
|
|
|
|
case AlphaISD::FTOIT_: return "Alpha::FTOIT_";
|
|
|
|
case AlphaISD::CVTQT_: return "Alpha::CVTQT_";
|
|
|
|
case AlphaISD::CVTQS_: return "Alpha::CVTQS_";
|
|
|
|
case AlphaISD::CVTTQ_: return "Alpha::CVTTQ_";
|
|
|
|
case AlphaISD::GPRelHi: return "Alpha::GPRelHi";
|
|
|
|
case AlphaISD::GPRelLo: return "Alpha::GPRelLo";
|
|
|
|
case AlphaISD::RelLit: return "Alpha::RelLit";
|
|
|
|
case AlphaISD::GlobalBaseReg: return "Alpha::GlobalBaseReg";
|
2006-06-14 02:27:39 +08:00
|
|
|
case AlphaISD::GlobalRetAddr: return "Alpha::GlobalRetAddr";
|
2006-01-28 07:39:00 +08:00
|
|
|
case AlphaISD::CALL: return "Alpha::CALL";
|
2006-01-17 03:53:25 +08:00
|
|
|
case AlphaISD::DivCall: return "Alpha::DivCall";
|
2006-06-13 02:09:24 +08:00
|
|
|
case AlphaISD::RET_FLAG: return "Alpha::RET_FLAG";
|
2006-01-17 03:53:25 +08:00
|
|
|
}
|
|
|
|
}
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2006-09-19 02:01:03 +08:00
|
|
|
static SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG) {
|
|
|
|
MVT::ValueType PtrVT = Op.getValueType();
|
|
|
|
JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
|
|
|
|
SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
|
|
|
|
SDOperand Zero = DAG.getConstant(0, PtrVT);
|
|
|
|
|
|
|
|
const TargetMachine &TM = DAG.getTarget();
|
|
|
|
|
|
|
|
SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, JTI,
|
|
|
|
DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64));
|
|
|
|
SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, JTI, Hi);
|
|
|
|
return Lo;
|
|
|
|
}
|
|
|
|
|
2006-08-12 01:19:54 +08:00
|
|
|
//http://www.cs.arizona.edu/computer.help/policy/DIGITAL_unix/
|
|
|
|
//AA-PY8AC-TET1_html/callCH3.html#BLOCK21
|
2005-09-03 02:46:02 +08:00
|
|
|
|
|
|
|
//For now, just use variable size stack frame format
|
|
|
|
|
|
|
|
//In a standard call, the first six items are passed in registers $16
|
|
|
|
//- $21 and/or registers $f16 - $f21. (See Section 4.1.2 for details
|
|
|
|
//of argument-to-register correspondence.) The remaining items are
|
|
|
|
//collected in a memory argument list that is a naturally aligned
|
|
|
|
//array of quadwords. In a standard call, this list, if present, must
|
|
|
|
//be passed at 0(SP).
|
|
|
|
//7 ... n 0(SP) ... (n-7)*8(SP)
|
|
|
|
|
|
|
|
// //#define FP $15
|
|
|
|
// //#define RA $26
|
|
|
|
// //#define PV $27
|
|
|
|
// //#define GP $29
|
|
|
|
// //#define SP $30
|
|
|
|
|
2006-06-13 02:09:24 +08:00
|
|
|
static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG,
|
|
|
|
int &VarArgsBase,
|
|
|
|
int &VarArgsOffset,
|
|
|
|
unsigned int &GP,
|
|
|
|
unsigned int &RA) {
|
2005-09-03 02:46:02 +08:00
|
|
|
MachineFunction &MF = DAG.getMachineFunction();
|
|
|
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
2006-06-13 02:09:24 +08:00
|
|
|
SSARegMap *RegMap = MF.getSSARegMap();
|
2005-09-03 02:46:02 +08:00
|
|
|
std::vector<SDOperand> ArgValues;
|
2006-06-13 02:09:24 +08:00
|
|
|
SDOperand Root = Op.getOperand(0);
|
|
|
|
|
|
|
|
GP = AddLiveIn(MF, Alpha::R29, &Alpha::GPRCRegClass);
|
|
|
|
RA = AddLiveIn(MF, Alpha::R26, &Alpha::GPRCRegClass);
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2005-09-04 14:12:19 +08:00
|
|
|
unsigned args_int[] = {
|
2005-09-03 02:46:02 +08:00
|
|
|
Alpha::R16, Alpha::R17, Alpha::R18, Alpha::R19, Alpha::R20, Alpha::R21};
|
2005-09-04 14:12:19 +08:00
|
|
|
unsigned args_float[] = {
|
2005-09-03 02:46:02 +08:00
|
|
|
Alpha::F16, Alpha::F17, Alpha::F18, Alpha::F19, Alpha::F20, Alpha::F21};
|
2006-06-13 02:09:24 +08:00
|
|
|
|
|
|
|
for (unsigned ArgNo = 0, e = Op.Val->getNumValues()-1; ArgNo != e; ++ArgNo) {
|
2005-09-03 02:46:02 +08:00
|
|
|
SDOperand argt;
|
2006-06-13 02:09:24 +08:00
|
|
|
MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
|
|
|
|
SDOperand ArgVal;
|
|
|
|
|
|
|
|
if (ArgNo < 6) {
|
2005-09-03 02:46:02 +08:00
|
|
|
unsigned Vreg;
|
2006-06-13 02:09:24 +08:00
|
|
|
switch (ObjectVT) {
|
2005-09-03 02:46:02 +08:00
|
|
|
default:
|
2006-06-13 02:09:24 +08:00
|
|
|
std::cerr << "Unknown Type " << ObjectVT << "\n";
|
2005-09-03 02:46:02 +08:00
|
|
|
abort();
|
|
|
|
case MVT::f64:
|
2006-06-13 02:09:24 +08:00
|
|
|
args_float[ArgNo] = AddLiveIn(MF, args_float[ArgNo],
|
|
|
|
&Alpha::F8RCRegClass);
|
|
|
|
ArgVal = DAG.getCopyFromReg(Root, args_float[ArgNo], ObjectVT);
|
2005-09-03 02:46:02 +08:00
|
|
|
break;
|
2006-06-21 09:00:43 +08:00
|
|
|
case MVT::f32:
|
|
|
|
args_float[ArgNo] = AddLiveIn(MF, args_float[ArgNo],
|
|
|
|
&Alpha::F4RCRegClass);
|
|
|
|
ArgVal = DAG.getCopyFromReg(Root, args_float[ArgNo], ObjectVT);
|
|
|
|
break;
|
2005-09-03 02:46:02 +08:00
|
|
|
case MVT::i64:
|
2006-06-13 02:09:24 +08:00
|
|
|
args_int[ArgNo] = AddLiveIn(MF, args_int[ArgNo],
|
|
|
|
&Alpha::GPRCRegClass);
|
|
|
|
ArgVal = DAG.getCopyFromReg(Root, args_int[ArgNo], MVT::i64);
|
2005-09-03 02:46:02 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else { //more args
|
|
|
|
// Create the frame index object for this incoming parameter...
|
2006-06-13 02:09:24 +08:00
|
|
|
int FI = MFI->CreateFixedObject(8, 8 * (ArgNo - 6));
|
2005-09-03 02:46:02 +08:00
|
|
|
|
|
|
|
// Create the SelectionDAG nodes corresponding to a load
|
|
|
|
//from this parameter
|
|
|
|
SDOperand FIN = DAG.getFrameIndex(FI, MVT::i64);
|
2006-06-13 02:09:24 +08:00
|
|
|
ArgVal = DAG.getLoad(ObjectVT, Root, FIN, DAG.getSrcValue(NULL));
|
2005-09-03 02:46:02 +08:00
|
|
|
}
|
2006-06-13 02:09:24 +08:00
|
|
|
ArgValues.push_back(ArgVal);
|
2005-09-03 02:46:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// If the functions takes variable number of arguments, copy all regs to stack
|
2006-06-13 02:09:24 +08:00
|
|
|
bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
|
|
|
|
if (isVarArg) {
|
|
|
|
VarArgsOffset = (Op.Val->getNumValues()-1) * 8;
|
2005-09-03 02:46:02 +08:00
|
|
|
std::vector<SDOperand> LS;
|
|
|
|
for (int i = 0; i < 6; ++i) {
|
2005-09-14 03:03:13 +08:00
|
|
|
if (MRegisterInfo::isPhysicalRegister(args_int[i]))
|
2006-06-13 02:09:24 +08:00
|
|
|
args_int[i] = AddLiveIn(MF, args_int[i], &Alpha::GPRCRegClass);
|
|
|
|
SDOperand argt = DAG.getCopyFromReg(Root, args_int[i], MVT::i64);
|
2005-09-03 02:46:02 +08:00
|
|
|
int FI = MFI->CreateFixedObject(8, -8 * (6 - i));
|
|
|
|
if (i == 0) VarArgsBase = FI;
|
|
|
|
SDOperand SDFI = DAG.getFrameIndex(FI, MVT::i64);
|
2006-10-06 07:01:46 +08:00
|
|
|
LS.push_back(DAG.getStore(Root, argt, SDFI, DAG.getSrcValue(NULL)));
|
2005-09-03 02:46:02 +08:00
|
|
|
|
2005-09-14 03:03:13 +08:00
|
|
|
if (MRegisterInfo::isPhysicalRegister(args_float[i]))
|
2006-06-13 02:09:24 +08:00
|
|
|
args_float[i] = AddLiveIn(MF, args_float[i], &Alpha::F8RCRegClass);
|
|
|
|
argt = DAG.getCopyFromReg(Root, args_float[i], MVT::f64);
|
2005-09-03 02:46:02 +08:00
|
|
|
FI = MFI->CreateFixedObject(8, - 8 * (12 - i));
|
|
|
|
SDFI = DAG.getFrameIndex(FI, MVT::i64);
|
2006-10-06 07:01:46 +08:00
|
|
|
LS.push_back(DAG.getStore(Root, argt, SDFI, DAG.getSrcValue(NULL)));
|
2005-09-03 02:46:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//Set up a token factor with all the stack traffic
|
2006-08-12 01:38:39 +08:00
|
|
|
Root = DAG.getNode(ISD::TokenFactor, MVT::Other, &LS[0], LS.size());
|
2005-09-03 02:46:02 +08:00
|
|
|
}
|
|
|
|
|
2006-06-13 02:09:24 +08:00
|
|
|
ArgValues.push_back(Root);
|
|
|
|
|
|
|
|
// Return the new list of results.
|
|
|
|
std::vector<MVT::ValueType> RetVT(Op.Val->value_begin(),
|
|
|
|
Op.Val->value_end());
|
2006-08-12 01:19:54 +08:00
|
|
|
return DAG.getNode(ISD::MERGE_VALUES, RetVT, &ArgValues[0], ArgValues.size());
|
2006-06-13 02:09:24 +08:00
|
|
|
}
|
|
|
|
|
2006-06-14 02:27:39 +08:00
|
|
|
static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG, unsigned int RA) {
|
|
|
|
SDOperand Copy = DAG.getCopyToReg(Op.getOperand(0), Alpha::R26,
|
2006-08-12 01:19:54 +08:00
|
|
|
DAG.getNode(AlphaISD::GlobalRetAddr,
|
|
|
|
MVT::i64),
|
2006-06-14 02:27:39 +08:00
|
|
|
SDOperand());
|
2006-06-13 02:09:24 +08:00
|
|
|
switch (Op.getNumOperands()) {
|
|
|
|
default:
|
|
|
|
assert(0 && "Do not know how to return this many arguments!");
|
|
|
|
abort();
|
|
|
|
case 1:
|
2006-06-14 02:27:39 +08:00
|
|
|
break;
|
|
|
|
//return SDOperand(); // ret void is legal
|
2006-06-13 02:09:24 +08:00
|
|
|
case 3: {
|
|
|
|
MVT::ValueType ArgVT = Op.getOperand(1).getValueType();
|
|
|
|
unsigned ArgReg;
|
|
|
|
if (MVT::isInteger(ArgVT))
|
|
|
|
ArgReg = Alpha::R0;
|
|
|
|
else {
|
|
|
|
assert(MVT::isFloatingPoint(ArgVT));
|
|
|
|
ArgReg = Alpha::F0;
|
|
|
|
}
|
2006-06-14 02:27:39 +08:00
|
|
|
Copy = DAG.getCopyToReg(Copy, ArgReg, Op.getOperand(1), Copy.getValue(1));
|
2006-06-13 02:09:24 +08:00
|
|
|
if(DAG.getMachineFunction().liveout_empty())
|
|
|
|
DAG.getMachineFunction().addLiveOut(ArgReg);
|
2005-09-03 02:46:02 +08:00
|
|
|
break;
|
|
|
|
}
|
2006-06-13 02:09:24 +08:00
|
|
|
}
|
|
|
|
return DAG.getNode(AlphaISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1));
|
2005-09-03 02:46:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
std::pair<SDOperand, SDOperand>
|
|
|
|
AlphaTargetLowering::LowerCallTo(SDOperand Chain,
|
|
|
|
const Type *RetTy, bool isVarArg,
|
|
|
|
unsigned CallingConv, bool isTailCall,
|
|
|
|
SDOperand Callee, ArgListTy &Args,
|
|
|
|
SelectionDAG &DAG) {
|
|
|
|
int NumBytes = 0;
|
|
|
|
if (Args.size() > 6)
|
|
|
|
NumBytes = (Args.size() - 6) * 8;
|
|
|
|
|
2006-02-13 17:00:43 +08:00
|
|
|
Chain = DAG.getCALLSEQ_START(Chain,
|
|
|
|
DAG.getConstant(NumBytes, getPointerTy()));
|
2005-09-03 02:46:02 +08:00
|
|
|
std::vector<SDOperand> args_to_use;
|
|
|
|
for (unsigned i = 0, e = Args.size(); i != e; ++i)
|
|
|
|
{
|
|
|
|
switch (getValueType(Args[i].second)) {
|
|
|
|
default: assert(0 && "Unexpected ValueType for argument!");
|
|
|
|
case MVT::i1:
|
|
|
|
case MVT::i8:
|
|
|
|
case MVT::i16:
|
|
|
|
case MVT::i32:
|
|
|
|
// Promote the integer to 64 bits. If the input type is signed use a
|
|
|
|
// sign extend, otherwise use a zero extend.
|
|
|
|
if (Args[i].second->isSigned())
|
|
|
|
Args[i].first = DAG.getNode(ISD::SIGN_EXTEND, MVT::i64, Args[i].first);
|
|
|
|
else
|
|
|
|
Args[i].first = DAG.getNode(ISD::ZERO_EXTEND, MVT::i64, Args[i].first);
|
|
|
|
break;
|
|
|
|
case MVT::i64:
|
|
|
|
case MVT::f64:
|
|
|
|
case MVT::f32:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
args_to_use.push_back(Args[i].first);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<MVT::ValueType> RetVals;
|
|
|
|
MVT::ValueType RetTyVT = getValueType(RetTy);
|
2005-09-07 01:00:23 +08:00
|
|
|
MVT::ValueType ActualRetTyVT = RetTyVT;
|
|
|
|
if (RetTyVT >= MVT::i1 && RetTyVT <= MVT::i32)
|
|
|
|
ActualRetTyVT = MVT::i64;
|
|
|
|
|
2005-09-03 02:46:02 +08:00
|
|
|
if (RetTyVT != MVT::isVoid)
|
2005-09-07 01:00:23 +08:00
|
|
|
RetVals.push_back(ActualRetTyVT);
|
2005-09-03 02:46:02 +08:00
|
|
|
RetVals.push_back(MVT::Other);
|
|
|
|
|
2006-01-28 07:39:00 +08:00
|
|
|
std::vector<SDOperand> Ops;
|
|
|
|
Ops.push_back(Chain);
|
|
|
|
Ops.push_back(Callee);
|
|
|
|
Ops.insert(Ops.end(), args_to_use.begin(), args_to_use.end());
|
2006-08-12 01:19:54 +08:00
|
|
|
SDOperand TheCall = DAG.getNode(AlphaISD::CALL, RetVals, &Ops[0], Ops.size());
|
2005-09-03 02:46:02 +08:00
|
|
|
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
|
|
|
|
Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
|
|
|
|
DAG.getConstant(NumBytes, getPointerTy()));
|
2005-09-07 01:00:23 +08:00
|
|
|
SDOperand RetVal = TheCall;
|
|
|
|
|
|
|
|
if (RetTyVT != ActualRetTyVT) {
|
|
|
|
RetVal = DAG.getNode(RetTy->isSigned() ? ISD::AssertSext : ISD::AssertZext,
|
|
|
|
MVT::i64, RetVal, DAG.getValueType(RetTyVT));
|
|
|
|
RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal);
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::make_pair(RetVal, Chain);
|
2005-09-03 02:46:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AlphaTargetLowering::restoreGP(MachineBasicBlock* BB)
|
|
|
|
{
|
|
|
|
BuildMI(BB, Alpha::BIS, 2, Alpha::R29).addReg(GP).addReg(GP);
|
|
|
|
}
|
|
|
|
void AlphaTargetLowering::restoreRA(MachineBasicBlock* BB)
|
|
|
|
{
|
|
|
|
BuildMI(BB, Alpha::BIS, 2, Alpha::R26).addReg(RA).addReg(RA);
|
|
|
|
}
|
|
|
|
|
2006-01-24 04:59:50 +08:00
|
|
|
static int getUID()
|
|
|
|
{
|
|
|
|
static int id = 0;
|
|
|
|
return ++id;
|
|
|
|
}
|
|
|
|
|
2005-11-30 15:19:56 +08:00
|
|
|
/// LowerOperation - Provide custom lowering hooks for some operations.
|
|
|
|
///
|
|
|
|
SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
|
|
|
switch (Op.getOpcode()) {
|
2006-06-13 02:09:24 +08:00
|
|
|
default: assert(0 && "Wasn't expecting to be able to lower this!");
|
|
|
|
case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG,
|
|
|
|
VarArgsBase,
|
|
|
|
VarArgsOffset,
|
|
|
|
GP, RA);
|
2006-06-14 02:27:39 +08:00
|
|
|
case ISD::RET: return LowerRET(Op,DAG, getVRegRA());
|
2006-09-19 02:01:03 +08:00
|
|
|
case ISD::JumpTable: return LowerJumpTable(Op, DAG);
|
2006-09-25 03:46:56 +08:00
|
|
|
case ISD::JumpTableRelocBase:
|
|
|
|
return DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64);
|
2006-09-19 02:01:03 +08:00
|
|
|
|
2005-11-30 15:19:56 +08:00
|
|
|
case ISD::SINT_TO_FP: {
|
|
|
|
assert(MVT::i64 == Op.getOperand(0).getValueType() &&
|
|
|
|
"Unhandled SINT_TO_FP type in custom expander!");
|
|
|
|
SDOperand LD;
|
|
|
|
bool isDouble = MVT::f64 == Op.getValueType();
|
|
|
|
if (useITOF) {
|
|
|
|
LD = DAG.getNode(AlphaISD::ITOFT_, MVT::f64, Op.getOperand(0));
|
|
|
|
} else {
|
|
|
|
int FrameIdx =
|
|
|
|
DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8);
|
|
|
|
SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64);
|
2006-10-06 07:01:46 +08:00
|
|
|
SDOperand ST = DAG.getStore(DAG.getEntryNode(),
|
|
|
|
Op.getOperand(0), FI, DAG.getSrcValue(0));
|
2005-11-30 15:19:56 +08:00
|
|
|
LD = DAG.getLoad(MVT::f64, ST, FI, DAG.getSrcValue(0));
|
|
|
|
}
|
|
|
|
SDOperand FP = DAG.getNode(isDouble?AlphaISD::CVTQT_:AlphaISD::CVTQS_,
|
|
|
|
isDouble?MVT::f64:MVT::f32, LD);
|
|
|
|
return FP;
|
|
|
|
}
|
2005-12-01 00:10:29 +08:00
|
|
|
case ISD::FP_TO_SINT: {
|
|
|
|
bool isDouble = MVT::f64 == Op.getOperand(0).getValueType();
|
|
|
|
SDOperand src = Op.getOperand(0);
|
|
|
|
|
|
|
|
if (!isDouble) //Promote
|
|
|
|
src = DAG.getNode(ISD::FP_EXTEND, MVT::f64, src);
|
|
|
|
|
|
|
|
src = DAG.getNode(AlphaISD::CVTTQ_, MVT::f64, src);
|
|
|
|
|
|
|
|
if (useITOF) {
|
|
|
|
return DAG.getNode(AlphaISD::FTOIT_, MVT::i64, src);
|
|
|
|
} else {
|
|
|
|
int FrameIdx =
|
|
|
|
DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8);
|
|
|
|
SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64);
|
2006-10-06 07:01:46 +08:00
|
|
|
SDOperand ST = DAG.getStore(DAG.getEntryNode(),
|
|
|
|
src, FI, DAG.getSrcValue(0));
|
2005-12-01 00:10:29 +08:00
|
|
|
return DAG.getLoad(MVT::i64, ST, FI, DAG.getSrcValue(0));
|
|
|
|
}
|
2005-11-30 15:19:56 +08:00
|
|
|
}
|
2005-12-24 13:36:33 +08:00
|
|
|
case ISD::ConstantPool: {
|
2006-02-01 06:23:14 +08:00
|
|
|
ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
|
2006-09-13 05:04:05 +08:00
|
|
|
Constant *C = CP->getConstVal();
|
2006-02-01 06:23:14 +08:00
|
|
|
SDOperand CPI = DAG.getTargetConstantPool(C, MVT::i64, CP->getAlignment());
|
2005-12-24 13:36:33 +08:00
|
|
|
|
|
|
|
SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, CPI,
|
|
|
|
DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64));
|
|
|
|
SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, CPI, Hi);
|
|
|
|
return Lo;
|
|
|
|
}
|
|
|
|
case ISD::GlobalAddress: {
|
|
|
|
GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
|
|
|
|
GlobalValue *GV = GSDN->getGlobal();
|
|
|
|
SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i64, GSDN->getOffset());
|
|
|
|
|
2006-04-07 07:18:45 +08:00
|
|
|
// if (!GV->hasWeakLinkage() && !GV->isExternal() && !GV->hasLinkOnceLinkage()) {
|
|
|
|
if (GV->hasInternalLinkage()) {
|
2005-12-24 13:36:33 +08:00
|
|
|
SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, GA,
|
|
|
|
DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64));
|
|
|
|
SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, GA, Hi);
|
|
|
|
return Lo;
|
|
|
|
} else
|
2005-12-24 16:29:32 +08:00
|
|
|
return DAG.getNode(AlphaISD::RelLit, MVT::i64, GA, DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64));
|
2005-12-24 13:36:33 +08:00
|
|
|
}
|
2005-12-25 09:34:27 +08:00
|
|
|
case ISD::ExternalSymbol: {
|
|
|
|
return DAG.getNode(AlphaISD::RelLit, MVT::i64,
|
|
|
|
DAG.getTargetExternalSymbol(cast<ExternalSymbolSDNode>(Op)->getSymbol(), MVT::i64),
|
|
|
|
DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64));
|
|
|
|
}
|
|
|
|
|
|
|
|
case ISD::UREM:
|
|
|
|
case ISD::SREM:
|
2006-04-03 05:08:39 +08:00
|
|
|
//Expand only on constant case
|
|
|
|
if (Op.getOperand(1).getOpcode() == ISD::Constant) {
|
|
|
|
MVT::ValueType VT = Op.Val->getValueType(0);
|
|
|
|
unsigned Opc = Op.Val->getOpcode() == ISD::UREM ? ISD::UDIV : ISD::SDIV;
|
|
|
|
SDOperand Tmp1 = Op.Val->getOpcode() == ISD::UREM ?
|
2006-05-17 01:42:15 +08:00
|
|
|
BuildUDIV(Op.Val, DAG, NULL) :
|
|
|
|
BuildSDIV(Op.Val, DAG, NULL);
|
2006-04-03 05:08:39 +08:00
|
|
|
Tmp1 = DAG.getNode(ISD::MUL, VT, Tmp1, Op.getOperand(1));
|
|
|
|
Tmp1 = DAG.getNode(ISD::SUB, VT, Op.getOperand(0), Tmp1);
|
|
|
|
return Tmp1;
|
|
|
|
}
|
|
|
|
//fall through
|
|
|
|
case ISD::SDIV:
|
|
|
|
case ISD::UDIV:
|
2005-12-25 09:34:27 +08:00
|
|
|
if (MVT::isInteger(Op.getValueType())) {
|
2006-04-07 05:26:32 +08:00
|
|
|
if (Op.getOperand(1).getOpcode() == ISD::Constant)
|
2006-05-17 01:42:15 +08:00
|
|
|
return Op.getOpcode() == ISD::SDIV ? BuildSDIV(Op.Val, DAG, NULL)
|
|
|
|
: BuildUDIV(Op.Val, DAG, NULL);
|
2005-12-25 09:34:27 +08:00
|
|
|
const char* opstr = 0;
|
|
|
|
switch(Op.getOpcode()) {
|
|
|
|
case ISD::UREM: opstr = "__remqu"; break;
|
|
|
|
case ISD::SREM: opstr = "__remq"; break;
|
|
|
|
case ISD::UDIV: opstr = "__divqu"; break;
|
|
|
|
case ISD::SDIV: opstr = "__divq"; break;
|
|
|
|
}
|
|
|
|
SDOperand Tmp1 = Op.getOperand(0),
|
|
|
|
Tmp2 = Op.getOperand(1),
|
|
|
|
Addr = DAG.getExternalSymbol(opstr, MVT::i64);
|
|
|
|
return DAG.getNode(AlphaISD::DivCall, MVT::i64, Addr, Tmp1, Tmp2);
|
|
|
|
}
|
|
|
|
break;
|
2005-12-01 00:10:29 +08:00
|
|
|
|
2006-01-26 02:21:52 +08:00
|
|
|
case ISD::VAARG: {
|
|
|
|
SDOperand Chain = Op.getOperand(0);
|
|
|
|
SDOperand VAListP = Op.getOperand(1);
|
|
|
|
SDOperand VAListS = Op.getOperand(2);
|
|
|
|
|
|
|
|
SDOperand Base = DAG.getLoad(MVT::i64, Chain, VAListP, VAListS);
|
|
|
|
SDOperand Tmp = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
|
|
|
|
DAG.getConstant(8, MVT::i64));
|
|
|
|
SDOperand Offset = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Base.getValue(1),
|
|
|
|
Tmp, DAG.getSrcValue(0), MVT::i32);
|
|
|
|
SDOperand DataPtr = DAG.getNode(ISD::ADD, MVT::i64, Base, Offset);
|
|
|
|
if (MVT::isFloatingPoint(Op.getValueType()))
|
|
|
|
{
|
|
|
|
//if fp && Offset < 6*8, then subtract 6*8 from DataPtr
|
|
|
|
SDOperand FPDataPtr = DAG.getNode(ISD::SUB, MVT::i64, DataPtr,
|
|
|
|
DAG.getConstant(8*6, MVT::i64));
|
|
|
|
SDOperand CC = DAG.getSetCC(MVT::i64, Offset,
|
|
|
|
DAG.getConstant(8*6, MVT::i64), ISD::SETLT);
|
|
|
|
DataPtr = DAG.getNode(ISD::SELECT, MVT::i64, CC, FPDataPtr, DataPtr);
|
|
|
|
}
|
2006-01-24 05:51:33 +08:00
|
|
|
|
2006-01-26 02:21:52 +08:00
|
|
|
SDOperand NewOffset = DAG.getNode(ISD::ADD, MVT::i64, Offset,
|
|
|
|
DAG.getConstant(8, MVT::i64));
|
|
|
|
SDOperand Update = DAG.getNode(ISD::TRUNCSTORE, MVT::Other,
|
|
|
|
Offset.getValue(1), NewOffset,
|
|
|
|
Tmp, DAG.getSrcValue(0),
|
|
|
|
DAG.getValueType(MVT::i32));
|
|
|
|
|
|
|
|
SDOperand Result;
|
|
|
|
if (Op.getValueType() == MVT::i32)
|
|
|
|
Result = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Update, DataPtr,
|
|
|
|
DAG.getSrcValue(0), MVT::i32);
|
|
|
|
else
|
|
|
|
Result = DAG.getLoad(Op.getValueType(), Update, DataPtr,
|
|
|
|
DAG.getSrcValue(0));
|
|
|
|
return Result;
|
|
|
|
}
|
|
|
|
case ISD::VACOPY: {
|
|
|
|
SDOperand Chain = Op.getOperand(0);
|
|
|
|
SDOperand DestP = Op.getOperand(1);
|
|
|
|
SDOperand SrcP = Op.getOperand(2);
|
|
|
|
SDOperand DestS = Op.getOperand(3);
|
|
|
|
SDOperand SrcS = Op.getOperand(4);
|
|
|
|
|
|
|
|
SDOperand Val = DAG.getLoad(getPointerTy(), Chain, SrcP, SrcS);
|
2006-10-06 07:01:46 +08:00
|
|
|
SDOperand Result = DAG.getStore(Val.getValue(1), Val, DestP, DestS);
|
2006-01-26 02:21:52 +08:00
|
|
|
SDOperand NP = DAG.getNode(ISD::ADD, MVT::i64, SrcP,
|
|
|
|
DAG.getConstant(8, MVT::i64));
|
|
|
|
Val = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Result, NP,
|
|
|
|
DAG.getSrcValue(0), MVT::i32);
|
|
|
|
SDOperand NPD = DAG.getNode(ISD::ADD, MVT::i64, DestP,
|
|
|
|
DAG.getConstant(8, MVT::i64));
|
|
|
|
return DAG.getNode(ISD::TRUNCSTORE, MVT::Other, Val.getValue(1),
|
|
|
|
Val, NPD, DAG.getSrcValue(0),DAG.getValueType(MVT::i32));
|
|
|
|
}
|
|
|
|
case ISD::VASTART: {
|
|
|
|
SDOperand Chain = Op.getOperand(0);
|
|
|
|
SDOperand VAListP = Op.getOperand(1);
|
|
|
|
SDOperand VAListS = Op.getOperand(2);
|
|
|
|
|
|
|
|
// vastart stores the address of the VarArgsBase and VarArgsOffset
|
|
|
|
SDOperand FR = DAG.getFrameIndex(VarArgsBase, MVT::i64);
|
2006-10-06 07:01:46 +08:00
|
|
|
SDOperand S1 = DAG.getStore(Chain, FR, VAListP, VAListS);
|
2006-01-26 02:21:52 +08:00
|
|
|
SDOperand SA2 = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
|
|
|
|
DAG.getConstant(8, MVT::i64));
|
|
|
|
return DAG.getNode(ISD::TRUNCSTORE, MVT::Other, S1,
|
|
|
|
DAG.getConstant(VarArgsOffset, MVT::i64), SA2,
|
|
|
|
DAG.getSrcValue(0), DAG.getValueType(MVT::i32));
|
|
|
|
}
|
2005-12-01 00:10:29 +08:00
|
|
|
}
|
|
|
|
|
2005-11-30 15:19:56 +08:00
|
|
|
return SDOperand();
|
|
|
|
}
|
2006-01-28 11:14:31 +08:00
|
|
|
|
|
|
|
SDOperand AlphaTargetLowering::CustomPromoteOperation(SDOperand Op,
|
|
|
|
SelectionDAG &DAG) {
|
|
|
|
assert(Op.getValueType() == MVT::i32 &&
|
|
|
|
Op.getOpcode() == ISD::VAARG &&
|
|
|
|
"Unknown node to custom promote!");
|
|
|
|
|
|
|
|
// The code in LowerOperation already handles i32 vaarg
|
|
|
|
return LowerOperation(Op, DAG);
|
|
|
|
}
|
2006-06-21 21:37:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
//Inline Asm
|
|
|
|
|
|
|
|
/// getConstraintType - Given a constraint letter, return the type of
|
|
|
|
/// constraint it is for this target.
|
|
|
|
AlphaTargetLowering::ConstraintType
|
|
|
|
AlphaTargetLowering::getConstraintType(char ConstraintLetter) const {
|
|
|
|
switch (ConstraintLetter) {
|
|
|
|
default: break;
|
|
|
|
case 'f':
|
2006-06-21 23:42:36 +08:00
|
|
|
case 'r':
|
2006-06-21 21:37:27 +08:00
|
|
|
return C_RegisterClass;
|
|
|
|
}
|
|
|
|
return TargetLowering::getConstraintType(ConstraintLetter);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<unsigned> AlphaTargetLowering::
|
|
|
|
getRegClassForInlineAsmConstraint(const std::string &Constraint,
|
|
|
|
MVT::ValueType VT) const {
|
|
|
|
if (Constraint.size() == 1) {
|
|
|
|
switch (Constraint[0]) {
|
|
|
|
default: break; // Unknown constriant letter
|
|
|
|
case 'f':
|
|
|
|
return make_vector<unsigned>(Alpha::F0 , Alpha::F1 , Alpha::F2 ,
|
|
|
|
Alpha::F3 , Alpha::F4 , Alpha::F5 ,
|
|
|
|
Alpha::F6 , Alpha::F7 , Alpha::F8 ,
|
|
|
|
Alpha::F9 , Alpha::F10, Alpha::F11,
|
|
|
|
Alpha::F12, Alpha::F13, Alpha::F14,
|
|
|
|
Alpha::F15, Alpha::F16, Alpha::F17,
|
|
|
|
Alpha::F18, Alpha::F19, Alpha::F20,
|
|
|
|
Alpha::F21, Alpha::F22, Alpha::F23,
|
|
|
|
Alpha::F24, Alpha::F25, Alpha::F26,
|
|
|
|
Alpha::F27, Alpha::F28, Alpha::F29,
|
|
|
|
Alpha::F30, Alpha::F31, 0);
|
2006-06-21 23:42:36 +08:00
|
|
|
case 'r':
|
|
|
|
return make_vector<unsigned>(Alpha::R0 , Alpha::R1 , Alpha::R2 ,
|
|
|
|
Alpha::R3 , Alpha::R4 , Alpha::R5 ,
|
|
|
|
Alpha::R6 , Alpha::R7 , Alpha::R8 ,
|
|
|
|
Alpha::R9 , Alpha::R10, Alpha::R11,
|
|
|
|
Alpha::R12, Alpha::R13, Alpha::R14,
|
|
|
|
Alpha::R15, Alpha::R16, Alpha::R17,
|
|
|
|
Alpha::R18, Alpha::R19, Alpha::R20,
|
|
|
|
Alpha::R21, Alpha::R22, Alpha::R23,
|
|
|
|
Alpha::R24, Alpha::R25, Alpha::R26,
|
|
|
|
Alpha::R27, Alpha::R28, Alpha::R29,
|
|
|
|
Alpha::R30, Alpha::R31, 0);
|
|
|
|
|
2006-06-21 21:37:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::vector<unsigned>();
|
|
|
|
}
|