From f2285400e65dafe730a073b3ca92494d72c7295b Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 2 Mar 2026 17:52:57 +0100 Subject: add bswap16/32/64 - frontend: __builtin_bswapX intrinsics - backend: ObswapX instructions --- x86_64/isel.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'x86_64/isel.c') diff --git a/x86_64/isel.c b/x86_64/isel.c index fffc4c9..19e8d0c 100644 --- a/x86_64/isel.c +++ b/x86_64/isel.c @@ -560,6 +560,14 @@ sel(struct function *fn, struct instr *ins, struct block *blk, int *curi) case Ocopy: fixarg(&ins->l, ins, blk, curi); break; + case Obswap16: case Obswap32: case Obswap64: + ins->inplace = 1; + if (ins->l.t != RTMP) { + ins->l = insertinstr(blk, *curi, mkinstr(Ocopy, ins->cls, ins->l)); + fixarg(&instrtab[ins->l.i].l, ins, blk, curi); + ++*curi; + } + break; case Oxvaprologue: fuseaddr(&ins->l, blk, curi); assert(ins->l.t == RADDR); -- cgit v1.2.3