2 //***************************************************************************
4 // SparcInstrSelectionSupport.h
9 // 10/17/01 - Vikram Adve - Created
10 //**************************************************************************/
12 #ifndef SPARC_INSTR_SELECTION_SUPPORT_h
13 #define SPARC_INSTR_SELECTION_SUPPORT_h
17 ChooseLoadInstruction(const Type *DestTy)
19 switch (DestTy->getPrimitiveID()) {
21 case Type::UByteTyID: return LDUB;
22 case Type::SByteTyID: return LDSB;
23 case Type::UShortTyID: return LDUH;
24 case Type::ShortTyID: return LDSH;
25 case Type::UIntTyID: return LDUW;
26 case Type::IntTyID: return LDSW;
27 case Type::PointerTyID:
29 case Type::LongTyID: return LDX;
30 case Type::FloatTyID: return LD;
31 case Type::DoubleTyID: return LDD;
32 default: assert(0 && "Invalid type for Load instruction");
40 ChooseStoreInstruction(const Type *DestTy)
42 switch (DestTy->getPrimitiveID()) {
45 case Type::SByteTyID: return STB;
46 case Type::UShortTyID:
47 case Type::ShortTyID: return STH;
49 case Type::IntTyID: return STW;
50 case Type::PointerTyID:
52 case Type::LongTyID: return STX;
53 case Type::FloatTyID: return ST;
54 case Type::DoubleTyID: return STD;
55 default: assert(0 && "Invalid type for Store instruction");