+ case Intrinsic::readcyclecounter:
+ Assert1(FT->getNumParams() == 0,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == Type::ULongTy,
+ "Return type is not ulong!", IF);
+ NumArgs = 0;
+ break;
+
+ case Intrinsic::bswap_i16:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getReturnType() == Type::UShortTy,
+ "Return type is not ushort!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::bswap_i32:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getReturnType() == Type::UIntTy,
+ "Return type is not uint!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::bswap_i64:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getReturnType() == Type::ULongTy,
+ "Return type is not ulong!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::ctpop_i8:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UByteTy,
+ "Argument is not ubyte!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::ctpop_i16:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UShortTy,
+ "Argument is not ushort!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::ctpop_i32:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UIntTy, "Argument is not uint!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::ctpop_i64:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::ULongTy, "Argument is not ulong!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::ctlz_i8:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UByteTy, "Argument is not ubyte!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::ctlz_i16:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UShortTy,
+ "Argument is not ushort!", IF);
+ NumArgs = 1;
+ break;
+ case Intrinsic::ctlz_i32:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UIntTy, "Argument is not uint!", IF);
+ NumArgs = 1;
+ break;
+ case Intrinsic::ctlz_i64:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::ULongTy, "Argument is not ulong!", IF);
+ NumArgs = 1;
+ break;
+ case Intrinsic::cttz_i8:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UByteTy, "Argument is not ubyte!", IF);
+ NumArgs = 1;
+ break;
+ case Intrinsic::cttz_i16:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UShortTy,
+ "Argument is not ushort!", IF);
+ NumArgs = 1;
+ break;
+ case Intrinsic::cttz_i32:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::UIntTy, "Argument is not uint!", IF);
+ NumArgs = 1;
+ break;
+ case Intrinsic::cttz_i64:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type does not match source type", IF);
+ Assert1(FT->getParamType(0) == Type::ULongTy, "Argument Is not ulong!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::sqrt_f32:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getParamType(0) == Type::FloatTy,
+ "Argument is not a 32-bit floating point type!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type is not the same as argument type!", IF);
+ NumArgs = 1;
+ break;
+
+ case Intrinsic::sqrt_f64:
+ Assert1(FT->getNumParams() == 1,
+ "Illegal # arguments for intrinsic function!", IF);
+ Assert1(FT->getParamType(0) == Type::DoubleTy,
+ "Argument is not a 64-bit floating point type!", IF);
+ Assert1(FT->getReturnType() == FT->getParamType(0),
+ "Return type is not the same as argument type!", IF);
+ NumArgs = 1;
+ break;
+