+CreateSETUWLabel(const TargetMachine& target, Value* val,
+ Instruction* dest, vector<MachineInstr*>& mvec)
+{
+ MachineInstr* MI;
+
+ // Set the high 22 bits in dest
+ MI = Create2OperandInstr(SETHI, val, dest);
+ MI->setOperandHi32(0);
+ mvec.push_back(MI);
+
+ // Set the low 10 bits in dest
+ MI = Create3OperandInstr(OR, dest, val, dest);
+ MI->setOperandLo32(1);
+ mvec.push_back(MI);
+}
+
+
+//----------------------------------------------------------------------------
+// Function: CreateSETXLabel
+//
+// Set a 64-bit constant (given by a symbolic label) in the register `dest'.
+//----------------------------------------------------------------------------
+
+static inline void
+CreateSETXLabel(const TargetMachine& target,
+ Value* val, Instruction* tmpReg, Instruction* dest,
+ vector<MachineInstr*>& mvec)
+{
+ assert(isa<Constant>(val) || isa<GlobalValue>(val) &&
+ "I only know about constant values and global addresses");
+
+ MachineInstr* MI;
+
+ MI = Create2OperandInstr_Addr(SETHI, val, tmpReg);
+ MI->setOperandHi64(0);
+ mvec.push_back(MI);
+
+ MI = Create3OperandInstr_Addr(OR, tmpReg, val, tmpReg);
+ MI->setOperandLo64(1);
+ mvec.push_back(MI);
+
+ MI = Create3OperandInstr_UImmed(SLLX, tmpReg, 32, tmpReg);
+ mvec.push_back(MI);
+
+ MI = Create2OperandInstr_Addr(SETHI, val, dest);
+ MI->setOperandHi32(0);
+ mvec.push_back(MI);
+
+ MI = Create3OperandInstr(OR, dest, tmpReg, dest);
+ mvec.push_back(MI);
+
+ MI = Create3OperandInstr_Addr(OR, dest, val, dest);
+ MI->setOperandLo32(1);
+ mvec.push_back(MI);
+}
+
+
+//----------------------------------------------------------------------------
+// Function: CreateUIntSetInstruction
+//
+// Create code to Set an unsigned constant in the register `dest'.
+// Uses CreateSETUWConst, CreateSETSWConst or CreateSETXConst as needed.
+// CreateSETSWConst is an optimization for the case that the unsigned value
+// has all ones in the 33 high bits (so that sign-extension sets them all).
+//----------------------------------------------------------------------------
+
+static inline void
+CreateUIntSetInstruction(const TargetMachine& target,