diff options
| author | 2026-03-02 17:52:57 +0100 | |
|---|---|---|
| committer | 2026-03-02 17:52:57 +0100 | |
| commit | f2285400e65dafe730a073b3ca92494d72c7295b (patch) | |
| tree | d5a96f09fbd0402ada3c39165a9d2d8202ee8e5d /x86_64/isel.c | |
| parent | a498f851ef2f50c9b8ac47e238137af52b54057d (diff) | |
add bswap16/32/64
- frontend: __builtin_bswapX intrinsics
- backend: ObswapX instructions
Diffstat (limited to 'x86_64/isel.c')
| -rw-r--r-- | x86_64/isel.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |