Implement bswap

This commit is contained in:
Theodore Dubois 2018-06-03 08:33:59 -07:00
parent 83c130030e
commit 509fb7a2df
2 changed files with 10 additions and 1 deletions

View File

@ -76,3 +76,12 @@
.each_reg x
.purgem x
.gadget_array bt
.macro x name reg
.gadget bswap_\name
bswap %\reg
gret
.endm
.each_reg x
.purgem x
.gadget_list bswap, REG_LIST

View File

@ -286,7 +286,7 @@ static inline bool gen_op(struct gen_state *state, gadget_t *gadgets, enum arg a
#define BSF(src, dst,z) los(bsf, src, dst, z)
#define BSR(src, dst,z) los(bsr, src, dst, z)
#define BSWAP(dst) UNDEFINED
#define BSWAP(dst) ga(bswap, arg_##dst)
#define strop(op, rep, z) gag(op, sz(z) * size_count + rep_##rep, saved_ip)
#define STR(op, z) strop(op, once, z)