throw exception if not supported amx sibmem 2

This commit is contained in:
MITSUNARI Shigeo 2020-06-30 19:53:44 +09:00
parent c6737d14bf
commit 6208e3ae8a
2 changed files with 8 additions and 2 deletions

View File

@ -797,6 +797,10 @@ CYBOZU_TEST_AUTO(tileloadd)
{
tileloadd(tmm1, ptr[r8]);
}
void notSupported2()
{
tileloadd(tmm1, ptr[r8*2]);
}
} c;
const uint8_t tbl[] = {
0xC4, 0x82, 0x7B, 0x4B, 0x0C, 0x00,
@ -809,5 +813,6 @@ CYBOZU_TEST_AUTO(tileloadd)
// current version does not support this sibmem format
CYBOZU_TEST_EXCEPTION(c.notSupported(), std::exception);
CYBOZU_TEST_EXCEPTION(c.notSupported2(), std::exception);
}
#endif

View File

@ -2269,8 +2269,9 @@ private:
#ifdef XBYAK64
void opAMX(const Tmm& t1, const Address& addr, int type, int code0)
{
// addressing without index such as ptr[r8]
if (addr.getRegExp().getIndex().getBit() == 0) throw Error(ERR_NOT_SUPPORTED);
// require both base and index
const RegExp exp = addr.getRegExp(false);
if (exp.getBase().getBit() == 0 || exp.getIndex().getBit() == 0) throw Error(ERR_NOT_SUPPORTED);
opVex(t1, &tmm0, addr, type, code0);
}
#endif