add rdrand

This commit is contained in:
MITSUNARI Shigeo 2013-05-22 23:06:49 +09:00
parent 56ffc71898
commit 936ff0ff76
3 changed files with 6 additions and 1 deletions

View file

@ -1583,5 +1583,4 @@ void put()
int main()
{
put();
return 0;
}

View file

@ -1893,6 +1893,10 @@ public:
#endif
}
}
void putRdrand()
{
put("rdrand", REG16 | REG32e);
}
void put()
{
#ifdef USE_AVX
@ -1901,6 +1905,7 @@ public:
putGprR_R_RM();
putGprR_RM_R();
putGprR_RM();
putRdrand();
#else
putAVX1();
putAVX2();

View file

@ -1689,6 +1689,7 @@ public:
db(0xF2);
opModRM(reg, op, op.isREG(), op.isMEM(), 0x0F, 0x38, 0xF0 | (op.isBit(8) ? 0 : 1));
}
void rdrand(const Reg& r) { if (r.isBit(8)) throw ERR_BAD_SIZE_OF_REGISTER; opModR(Reg(6, Operand::REG, r.getBit()), r, 0x0f, 0xc7); }
enum { NONE = 256 };
CodeGenerator(size_t maxSize = DEFAULT_MAX_CODE_SIZE, void *userPtr = 0, Allocator *allocator = 0)
: CodeArray(maxSize, userPtr, allocator)