summaryrefslogtreecommitdiff
path: root/wsaa.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-08 21:15:01 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-08 21:15:01 -0700
commitc735d1a6b2110b738ed1c3f01f10b5a2aaf45e6c (patch)
tree9beb8f096003a278e971dbd834427f6098c9a3dc /wsaa.h
parent2f0f9ea286e2e37681608e7d4b4ebd4253848478 (diff)
downloadnasm-c735d1a6b2110b738ed1c3f01f10b5a2aaf45e6c.tar.gz
nasm-c735d1a6b2110b738ed1c3f01f10b5a2aaf45e6c.tar.bz2
nasm-c735d1a6b2110b738ed1c3f01f10b5a2aaf45e6c.zip
Replace the WSAA macros with functions
Change the WSAA macros into functions; reducing the icache footprint.
Diffstat (limited to 'wsaa.h')
-rw-r--r--wsaa.h76
1 files changed, 5 insertions, 71 deletions
diff --git a/wsaa.h b/wsaa.h
index d70b64a..0980174 100644
--- a/wsaa.h
+++ b/wsaa.h
@@ -4,75 +4,9 @@
#include "compiler.h"
#include "nasmlib.h"
-#ifdef WORDS_LITTEENDIAN
+void saa_write8(struct SAA *s, uint8_t v);
+void saa_write16(struct SAA *s, uint16_t v);
+void saa_write32(struct SAA *s, uint32_t v);
+void saa_write64(struct SAA *s, uint64_t v);
-#define WSAACHAR(s,v) \
- do { \
- uint8_t _wsb_v = (v); \
- saa_wbytes(s, &_wsb_v, 1); \
- } while (0)
-
-#define WSAASHORT(s,v) \
- do { \
- uint16_t _wss_v = (v); \
- saa_wbytes(s, &_wss_v, 2); \
- } while (0)
-
-#define WSAALONG(s,v) \
- do { \
- uint32_t _wsl_v = (v); \
- saa_wbytes(s, &_wsl_v, 4); \
- } while (0)
-
-#define WSAADLONG(s,v) \
- do { \
- uint64_t _wsq_v = (v); \
- saa_wbytes(s, &_wsq_v, 8); \
- } while (0)
-
-#else /* !X86_MEMORY */
-
-#define WSAACHAR(s,v) \
- do { \
- uint8_t _wsb_v = (v); \
- saa_wbytes(s, &_wsb_v, 1); \
- } while (0)
-
-#define WSAASHORT(s,v) \
- do { \
- uint16_t _wss_v = (v); \
- uint8_t _wss_p[2]; \
- _wss_p[0] = _wss_v; \
- _wss_p[1] = _wss_v >> 8; \
- saa_wbytes(s, _wss_p, 2); \
- } while (0)
-
-#define WSAALONG(s,v) \
- do { \
- uint32_t _wsl_v = (v); \
- uint8_t _wsl_p[4]; \
- _wsl_p[0] = _wsl_v; \
- _wsl_p[1] = _wsl_v >> 8; \
- _wsl_p[2] = _wsl_v >> 16; \
- _wsl_p[3] = _wsl_v >> 24; \
- saa_wbytes(s, _wsl_p, 4); \
- } while (0)
-
-#define WSAADLONG(s,v) \
- do { \
- uint64_t _wsq_v = (v); \
- uint8_t _wsq_p[8]; \
- _wsq_p[0] = _wsq_v; \
- _wsq_p[1] = _wsq_v >> 8; \
- _wsq_p[2] = _wsq_v >> 16; \
- _wsq_p[3] = _wsq_v >> 24; \
- _wsq_p[4] = _wsq_v >> 32; \
- _wsq_p[5] = _wsq_v >> 40; \
- _wsq_p[6] = _wsq_v >> 48; \
- _wsq_p[7] = _wsq_v >> 56; \
- saa_wbytes(s, _wsq_p, 8); \
- } while (0)
-
-#endif
-
-#endif /* NASM_WSAA_H */
+#endif /* wsaa.h */