diff options
Diffstat (limited to 'sse.h')
-rw-r--r-- | sse.h | 42 |
1 files changed, 25 insertions, 17 deletions
@@ -15,15 +15,33 @@ #define rX5 5 #define rX6 6 +#define VEX_m_0F (1) +#define VEX_m_0F38 (2) +#define VEX_m_0F3A (3) +#define VEX_L_128 (0) +#define VEX_L_256 (1) +#define VEX_p_NO (0) +#define VEX_p_66 (1) +#define VEX_p_F3 (2) +#define VEX_p_F2 (3) + #define OP(o, m, ro, rm) WORD $0x0F66; BYTE $(o); \ BYTE $(((m)<<6)|((ro)<<3)|(rm)) #define OPi(o, m, ro, rm, i) OP((o), (m), (ro), (rm)); \ BYTE $(i) -#define OP4(o, m, ro, rm) LONG $0x(o)0F66; \ +#define OP4(o, m, ro, rm) WORD $0x0F66; WORD $(o); \ BYTE $(((m)<<6)|((ro)<<3)|(rm)) #define OP4i(o, m, ro, rm, i) OP4((o), (m), (ro), (rm)); \ BYTE $(i) +#define VEX3(r, x, b, m, w, v, l, p) BYTE $0xC4; \ + BYTE $(((~r)<<7)|((~x)<<6)|((~b)<<5)|(m)); \ + BYTE $(((w)<<7)|((~v)<<3)|((l)<<2)|(p)) +#define VEX2(r, b, l, p) BYTE $0xC5; \ + BYTE $(((~r)<<7)|((~v)<<3)|((l)<<2)|(p)) +#define VOP(o, m, ro, rm) BYTE $(o); \ + BYTE $(((m)<<6)|((ro)<<3)|(rm)) + /* MOVLPD */ //opcode = 660F12 //modrm = 01 000 000 [AX → X0] / 01 001 000 [AX → X1] @@ -47,20 +65,10 @@ //imm8 = 0011 0001 #define DPPD(s, d) OP4i(0x413A, 0x3, (d), (s), 0x31) +/* VFMADD231SD (128 bit) */ +#define VFMADD231SD(s0, s1, d) VEX3(0,0,0,VEX_m_0F38,1,(s0),VEX_L_128,VEX_p_66); \ + VOP(0xB9, 0x3, (d), (s1)) -#define VEX_m_0F (1) -#define VEX_m_0F38 (2) -#define VEX_m_0F3A (3) -#define VEX_L_128 (0) -#define VEX_L_256 (1) -#define VEX_p_NO (0) -#define VEX_p_66 (1) -#define VEX_p_F3 (2) -#define VEX_p_F2 (3) - -#define VEX2(r, x, b, m, w, v, l, p) BYTE $0xC5; \ - BYTE $(((~r)<<7)|((~x)<<6)|((~b)<<5)|(m)); \ - BYTE $(((w)<<7)|((~v)<<3)|((l)<<2)|(p)); - -#define VEX3(r, b, l, p) BYTE $0xC4; \ - BYTE $(((~r)<<7)|((~v)<<3)|((l)<<2)|(p)); +/* VFMADD231PD (128 bit) */ +#define VFMADD231PD(s0, s1, d) VEX3(0,0,0,VEX_m_0F38,1,(s0),VEX_L_128,VEX_p_66); \ + VOP(0xB8, 0x3, (d), (s1)) |