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() int main()
{ {
put(); put();
return 0;
} }

View file

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

View file

@ -1689,6 +1689,7 @@ public:
db(0xF2); db(0xF2);
opModRM(reg, op, op.isREG(), op.isMEM(), 0x0F, 0x38, 0xF0 | (op.isBit(8) ? 0 : 1)); 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 }; enum { NONE = 256 };
CodeGenerator(size_t maxSize = DEFAULT_MAX_CODE_SIZE, void *userPtr = 0, Allocator *allocator = 0) CodeGenerator(size_t maxSize = DEFAULT_MAX_CODE_SIZE, void *userPtr = 0, Allocator *allocator = 0)
: CodeArray(maxSize, userPtr, allocator) : CodeArray(maxSize, userPtr, allocator)