From 4f979636327bb1acb371d3094554da6cc4672973 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 18 Jun 2023 22:26:53 +0200 Subject: add endian.h for endian dependent stuff --- amd64/all.h | 20 -------------------- amd64/emit.c | 1 + amd64/isel.c | 1 + 3 files changed, 2 insertions(+), 20 deletions(-) (limited to 'amd64') diff --git a/amd64/all.h b/amd64/all.h index a038ffd..42f4d23 100644 --- a/amd64/all.h +++ b/amd64/all.h @@ -12,26 +12,6 @@ enum reg { #undef R }; -static inline void -wr16le(uchar *p, ushort x) -{ - p[0] = x >> 0; p[1] = x >> 8; -} - -static inline void -wr32le(uchar *p, uint x) -{ - p[0] = x >> 0; p[1] = x >> 8; - p[2] = x >> 16; p[3] = x >> 24; -} - -static inline void -wr64le(uchar *p, uvlong x) -{ - wr32le(p+0, x>>00); - wr32le(p+4, x>>32); -} - void amd64_isel(struct function *); void amd64_emit(struct function *); diff --git a/amd64/emit.c b/amd64/emit.c index ec04de7..a02cba2 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -1,5 +1,6 @@ #include "all.h" #include "../obj.h" +#include "../endian.h" /** Instruction operands ** * diff --git a/amd64/isel.c b/amd64/isel.c index 4c0656a..942e962 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -1,4 +1,5 @@ #include "all.h" +#include "../endian.h" static void fixarg(struct function *fn, union ref *r, struct instr *ins, struct block *blk, int *curi) -- cgit v1.2.3