2020-04-22 21:25:57 +02:00
|
|
|
#include <stdio.h>
|
2018-07-18 03:57:43 +02:00
|
|
|
#define XBYAK_NO_OP_NAMES
|
2020-04-22 21:25:57 +02:00
|
|
|
#define XBYAK_ENABLE_OMITTED_OPERAND
|
|
|
|
#include "xbyak/xbyak.h"
|
|
|
|
|
|
|
|
using namespace Xbyak;
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(disable : 4245)
|
Squashed 'externals/xbyak/' changes from d512551e..2794cde7
2794cde7 add xword, yword, etc. in Xbyak::util
fb9c04e4 fix document for vfpclassps
a51be78b fix test dependency
04fdfb1e update version
e6354f8b add vgf2p8mulb
09a12642 add gf2p8affineqb
d171ba0e add gf2p8affineinvqb
457f4fd0 add vpshufbitqmb
5af0ba39 add vpexpand{b,w}
e450f965 vpopcnt{d,q} supports ptr_b
48499eb1 add vpdpbusd(s), vpdpwssd(s)
9c745109 add vpdpbusd, vpdpbusds
0e1a11b4 add vpopcnt{b,w,d,q}
9acfc132 add vpshrd(v){w,d,q}
ac8de850 add vpshld(v){w,d,q}
f181c259 add vcompressb, vcompressw
5a402477 vpclmulqdq supports AVX-512
9e16b40b vaes* supports AVX-512
7fde08e0 add flags for intel's manual 319433-030.pdf
c5da3778 add test of v4fmaddps, vp4dpwssd, etc.
e4fc9d8a fix mpx encoding
d0b2fb62 add bnd(0xf2) prefix for MPX
f12b5678 use db for array
cd74ab44 remove bat file
git-subtree-dir: externals/xbyak
git-subtree-split: 2794cde79eb71e86490061cac9622ad0067b8d15
2020-04-22 21:45:52 +02:00
|
|
|
#pragma warning(disable : 4312)
|
2020-04-22 21:25:57 +02:00
|
|
|
#endif
|
|
|
|
class Sample : public CodeGenerator {
|
|
|
|
void operator=(const Sample&);
|
|
|
|
public:
|
|
|
|
#include "nm.cpp"
|
|
|
|
};
|
|
|
|
|
|
|
|
#define _STR(x) #x
|
|
|
|
#define TEST(syntax) err = true; try { syntax; err = false; } catch (Xbyak::Error) { } catch (...) { } if (!err) printf("should be err:%s;\n", _STR(syntax))
|
|
|
|
|
|
|
|
class ErrorSample : public CodeGenerator {
|
|
|
|
void operator=(const ErrorSample&);
|
|
|
|
public:
|
|
|
|
void gen()
|
|
|
|
{
|
|
|
|
bool err;
|
|
|
|
TEST(mov(ptr[eax],1));
|
|
|
|
TEST(test(ptr[eax],1));
|
|
|
|
TEST(adc(ptr[eax],1));
|
|
|
|
TEST(setz(eax));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
int main()
|
|
|
|
try
|
|
|
|
{
|
|
|
|
size_t size = sizeof(Xbyak::Operand);
|
|
|
|
if (size != 4) {
|
|
|
|
printf("sizeof Operand %d\n", (int)size);
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
Sample s;
|
|
|
|
s.gen();
|
|
|
|
} catch (std::exception& e) {
|
|
|
|
printf("ERR:%s\n", e.what());
|
|
|
|
} catch (...) {
|
|
|
|
printf("unknown error\n");
|
|
|
|
}
|
|
|
|
ErrorSample es;
|
|
|
|
es.gen();
|
|
|
|
} catch (std::exception& e) {
|
|
|
|
printf("err %s\n", e.what());
|
|
|
|
return 1;
|
|
|
|
}
|