Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
rip-label-imm.cpp
Go to the documentation of this file.
1#define XBYAK_NO_OP_NAMES
2#include <xbyak/xbyak.h>
3/*
4dump of vc
5
600000000003A0000 F3 0F C2 05 F1 00 00 00 00 cmpeqss xmm0,dword ptr [3A00FAh]
700000000003A0009 F7 05 E7 00 00 00 21 00 00 00 test dword ptr [3A00FAh],21h
800000000003A0013 0F BA 25 DF 00 00 00 03 bt dword ptr [3A00FAh],3
900000000003A001B C4 E3 79 0D 05 D5 00 00 00 03 vblendpd xmm0,xmm0,xmmword ptr [3A00FAh],3
1000000000003A0025 C4 E3 79 0F 05 CB 00 00 00 04 vpalignr xmm0,xmm0,xmmword ptr [3A00FAh],4
1100000000003A002F C4 E3 7D 19 1D C1 00 00 00 0C vextractf128 xmmword ptr [3A00FAh],ymm3,0Ch
1200000000003A0039 C4 E3 75 46 05 B7 00 00 00 0D vperm2i128 ymm0,ymm1,ymmword ptr [3A00FAh],0Dh
1300000000003A0043 C4 E3 79 1D 15 AD 00 00 00 2C vcvtps2ph mmword ptr [3A00FAh],xmm2,2Ch
1400000000003A004D C7 05 A3 00 00 00 34 12 00 00 mov dword ptr [3A00FAh],1234h
1500000000003A0057 C1 25 9C 00 00 00 03 shl dword ptr [3A00FAh],3
1600000000003A005E D1 2D 96 00 00 00 shr dword ptr [3A00FAh],1
1700000000003A0064 48 0F A4 05 8D 00 00 00 03 shld qword ptr [3A00FAh],rax,3
1800000000003A006D 48 6B 05 85 00 00 00 15 imul rax,qword ptr [3A00FAh],15h
1900000000003A0075 C4 E3 FB F0 05 7B 00 00 00 15 rorx rax,qword ptr [3A00FAh],15h
2000000000003A007F F7 05 71 00 00 00 05 00 00 00 test dword ptr [3A00FAh],5
2100000000003A0089 66 48 0F 3A 16 05 66 00 00 00 03 pextrq qword ptr [3A00FAh],xmm0,3
2200000000003A0094 66 48 0F 3A 22 15 5B 00 00 00 05 pinsrq xmm2,qword ptr [3A00FAh],5
2300000000003A009F 66 0F 3A 15 0D 51 00 00 00 04 pextrw word ptr [3A00FAh],xmm1,4
2400000000003A00A9 81 15 47 00 00 00 45 23 01 00 adc dword ptr [3A00FAh],12345h
2500000000003A00B3 0F BA 25 3F 00 00 00 34 bt dword ptr [3A00FAh],34h
2600000000003A00BB 66 0F BA 3D 36 00 00 00 34 btc word ptr [3A00FAh],34h
2700000000003A00C4 0F BA 35 2E 00 00 00 34 btr dword ptr [3A00FAh],34h
2800000000003A00CC C1 15 27 00 00 00 04 rcl dword ptr [3A00FAh],4
2900000000003A00D3 48 0F A4 05 1E 00 00 00 04 shld qword ptr [3A00FAh],rax,4
3000000000003A00DC 0F 3A 0F 05 15 00 00 00 04 palignr mm0,mmword ptr [3A00FAh],4
3100000000003A00E5 66 0F 3A DF 1D 0B 00 00 00 04 aeskeygenassist xmm3,xmmword ptr [3A00FAh],4
3200000000003A00EF C4 E3 79 60 15 01 00 00 00 07 vpcmpestrm xmm2,xmmword ptr [3A00FAh],7
3300000000003A00F9 C3 ret
3400000000003A00FA F0 DE BC 9A 78 56 34 12
35*/
38 {
40 cmpss(xmm0, ptr[rip + label], 0);
41 test(dword[rip + label], 33);
42 bt(dword[rip + label ], 3);
43 vblendpd(xmm0, dword[rip + label], 3);
44 vpalignr(xmm0, qword[rip + label], 4);
45 vextractf128(dword[rip + label], ymm3, 12);
46 vperm2i128(ymm0, ymm1, qword[rip + label], 13);
47 vcvtps2ph(ptr[rip + label], xmm2, 44);
48 mov(dword[rip + label], 0x1234);
49 shl(dword[rip + label], 3);
50 shr(dword[rip + label], 1);
51 shld(qword[rip + label], rax, 3);
52 imul(rax, qword[rip + label], 21);
53 rorx(rax, qword[rip + label], 21);
54 test(dword[rip + label], 5);
55 pextrq(ptr[rip + label], xmm0, 3);
56 pinsrq(xmm2, ptr[rip + label], 5);
57 pextrw(ptr[rip + label], xmm1, 4);
58 adc(dword[rip + label], 0x12345);
59 bt(byte[rip + label], 0x34);
60 btc(word[rip + label], 0x34);
61 btr(dword[rip + label], 0x34);
62 rcl(dword[rip + label], 4);
63 shld(qword[rip + label], rax, 4);
64 palignr(mm0, ptr[rip + label], 4);
65 aeskeygenassist(xmm3, ptr[rip + label], 4);
66 vpcmpestrm(xmm2, ptr[rip + label], 7);
67 ret();
68 L(label);
69 dq(0x123456789abcdef0ull);
70 };
71};
72
73void dump(const unsigned char *p, size_t n)
74{
75 for (int i = 0; i < n; i++) {
76 printf("%02x ", p[i]);
77 if ((i % 16) == 15) putchar('\n');
78 }
79 putchar('\n');
80}
81
82int main()
83{
84 Code code;
85 void (*f)() = code.getCode<void (*)()>();
86 dump(code.getCode(), code.getSize());
87 f();
88}
const mie::Vuint & p
Definition bn.cpp:27
const uint8 * getCode() const
Definition xbyak.h:905
void dq(uint64 code)
Definition xbyak.h:904
void shr(const Operand &op, const Reg8 &_cl)
Definition xbyak.h:730
void aeskeygenassist(const Xmm &xmm, const Operand &op, uint8 imm)
Definition xbyak.h:20
void shl(const Operand &op, const Reg8 &_cl)
Definition xbyak.h:725
void vblendpd(const Xmm &x1, const Xmm &x2, const Operand &op, uint8 imm)
Definition xbyak.h:776
void pextrw(const Operand &op, const Mmx &xmm, uint8 imm)
Definition xbyak.h:554
void vperm2i128(const Ymm &y1, const Ymm &y2, const Operand &op, uint8 imm)
Definition xbyak.h:1124
void btc(const Operand &op, const Reg &reg)
Definition xbyak.h:50
void btr(const Operand &op, const Reg &reg)
Definition xbyak.h:52
void imul(const Reg &reg, const Operand &op)
Definition xbyak.h:2178
const AddressFrame dword
Definition xbyak.h:2090
void bt(const Operand &op, const Reg &reg)
Definition xbyak.h:48
void vcvtps2ph(const Operand &op, const Xmm &x, uint8 imm)
Definition xbyak.h:925
void vpalignr(const Xmm &x1, const Xmm &x2, const Operand &op, uint8 imm)
Definition xbyak.h:1098
void test(const Operand &op, const Reg &reg)
Definition xbyak.h:2162
void shld(const Operand &op, const Reg &reg, const Reg8 &_cl)
Definition xbyak.h:727
void adc(const Operand &op, uint32 imm)
Definition xbyak.h:3
const AddressFrame qword
Definition xbyak.h:2090
const AddressFrame word
Definition xbyak.h:2090
void vpcmpestrm(const Xmm &xm, const Operand &op, uint8 imm)
Definition xbyak.h:1116
void mov(const Operand &reg1, const Operand &reg2)
Definition xbyak.h:2210
void L(const std::string &label)
Definition xbyak.h:2126
void cmpss(const Xmm &xmm, const Operand &op, uint8 imm8)
Definition xbyak.h:127
void palignr(const Mmx &mmx, const Operand &op, int imm)
Definition xbyak.h:525
void vextractf128(const Operand &op, const Ymm &y, uint8 imm)
Definition xbyak.h:942
void rcl(const Operand &op, const Reg8 &_cl)
Definition xbyak.h:654
void rorx(const Reg32e &r, const Operand &op, uint8 imm)
Definition xbyak.h:672
const AddressFrame ptr
Definition xbyak.h:2090
void dump(const unsigned char *p, size_t n)
int main()
Definition bench.cpp:18
Xbyak ; JIT assembler for x86(IA32)/x64 by C++.
char * label
CK_RV ret