- case ISD::LOAD:
- case ISD::SEXTLOAD:
- case ISD::ZEXTLOAD:
- case ISD::EXTLOAD:
- {
- SDOperand Chain = Op.getOperand(0);
- SDOperand Address = Op.getOperand(1);
-
- unsigned Opc;
- unsigned opcode = Op.getOpcode();
-
- if (opcode == ISD::LOAD)
- switch (Op.Val->getValueType(0)) {
- default: Op.Val->dump(); assert(0 && "Bad load!");
- case MVT::i64: Opc = AlphaISD::LDQ_; break;
- case MVT::f64: Opc = AlphaISD::LDT_; break;
- case MVT::f32: Opc = AlphaISD::LDS_; break;
- }
- else
- switch (cast<VTSDNode>(Op.getOperand(3))->getVT()) {
- default: Op.Val->dump(); assert(0 && "Bad sign extend!");
- case MVT::i32: Opc = AlphaISD::LDL_;
- assert(opcode != ISD::ZEXTLOAD && "Not sext"); break;
- case MVT::i16: Opc = AlphaISD::LDWU_;
- assert(opcode != ISD::SEXTLOAD && "Not zext"); break;
- case MVT::i1: //FIXME: Treat i1 as i8 since there are problems otherwise
- case MVT::i8: Opc = AlphaISD::LDBU_;
- assert(opcode != ISD::SEXTLOAD && "Not zext"); break;
- }
-
- int i, j, k;
- getValueInfo(dyn_cast<SrcValueSDNode>(Op.getOperand(2))->getValue(), i, j, k);
-
- SDOperand Zero = DAG.getConstant(0, MVT::i64);
- std::vector<MVT::ValueType> VTS;
- VTS.push_back(Op.Val->getValueType(0));
- VTS.push_back(MVT::Other);
- std::vector<SDOperand> ARGS;
- ARGS.push_back(Chain);
- ARGS.push_back(Zero);
- ARGS.push_back(Address);
- ARGS.push_back(DAG.getConstant(i, MVT::i64));
- ARGS.push_back(DAG.getConstant(j, MVT::i64));
- ARGS.push_back(DAG.getConstant(k, MVT::i64));
- ARGS.push_back(DAG.getConstant(getUID(), MVT::i64));
- return DAG.getNode(Opc, VTS, ARGS);
- }
-
- case ISD::TRUNCSTORE:
- case ISD::STORE:
- {
- SDOperand Chain = Op.getOperand(0);
- SDOperand Value = Op.getOperand(1);
- SDOperand Address = Op.getOperand(2);
-
- unsigned Opc;
- unsigned opcode = Op.getOpcode();
-
- if (opcode == ISD::STORE) {
- switch(Value.getValueType()) {
- default: assert(0 && "unknown Type in store");
- case MVT::i64: Opc = AlphaISD::STQ_; break;
- case MVT::f64: Opc = AlphaISD::STT_; break;
- case MVT::f32: Opc = AlphaISD::STS_; break;
- }
- } else { //ISD::TRUNCSTORE
- switch(cast<VTSDNode>(Op.getOperand(4))->getVT()) {
- default: assert(0 && "unknown Type in store");
- case MVT::i8: Opc = AlphaISD::STB_; break;
- case MVT::i16: Opc = AlphaISD::STW_; break;
- case MVT::i32: Opc = AlphaISD::STL_; break;
- }
- }
-
- int i, j, k;
- getValueInfo(cast<SrcValueSDNode>(Op.getOperand(3))->getValue(), i, j, k);
-
- SDOperand Zero = DAG.getConstant(0, MVT::i64);
- std::vector<MVT::ValueType> VTS;
- VTS.push_back(MVT::Other);
- std::vector<SDOperand> ARGS;
- ARGS.push_back(Chain);
- ARGS.push_back(Value);
- ARGS.push_back(Zero);
- ARGS.push_back(Address);
- ARGS.push_back(DAG.getConstant(i, MVT::i64));
- ARGS.push_back(DAG.getConstant(j, MVT::i64));
- ARGS.push_back(DAG.getConstant(k, MVT::i64));
- ARGS.push_back(DAG.getConstant(getUID(), MVT::i64));
- return DAG.getNode(Opc, VTS, ARGS);
- }