diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-02-22 10:33:18 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-02-22 10:33:18 +1100 |
commit | 7add7a0a9f5fa2afa244f686f7e99e26aa112de8 (patch) | |
tree | 1327ea3e40b5ba36505508d11f8661f6c3a6a6f8 /slof/prim.code | |
parent | 0dfcbc133666b3d6d738644e958fea169de1cc3a (diff) | |
download | SLOF-7add7a0a9f5fa2afa244f686f7e99e26aa112de8.zip SLOF-7add7a0a9f5fa2afa244f686f7e99e26aa112de8.tar.gz SLOF-7add7a0a9f5fa2afa244f686f7e99e26aa112de8.tar.bz2 |
Move _FASTRMOVE implementation into headers & support new hcall
This moves _FASTREMOVE to the cache.h header, 970 uses the
existing code, p7 now uses the new memop hcall.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'slof/prim.code')
-rw-r--r-- | slof/prim.code | 60 |
1 files changed, 6 insertions, 54 deletions
diff --git a/slof/prim.code b/slof/prim.code index 9a4d0e2..9fbed71 100644 --- a/slof/prim.code +++ b/slof/prim.code @@ -445,30 +445,6 @@ code_EXECUTE: // don't need this as prim } - - -// 3.1 -#define _FWMOVE(s, d, size, t) \ - { t *s1=(t *)s, *d1=(t *)d; \ - while (size > 0) { *d1++ = *s1++; size -= sizeof(t); } } - -#define _BWMOVE(s, d, size, t) { \ - t *s1=(t *)((char *)s+size), *d1=(t *)((char *)d+size); \ - while (size > 0) { *--d1 = *--s1; size -= sizeof(t); } \ -} - -#define _FWOVERLAP(s, d, size) ((d >= s) && ((type_u)d < ((type_u)s + size))) - -#define _MOVE(s, d, size, t) if _FWOVERLAP(s, d, size) _BWMOVE(s, d, size, t) else _FWMOVE(s, d, size, t) - -#define _FASTMOVE(s, d, size) \ - switch (((type_u)s | (type_u)d | size) & (sizeof(type_u)-1)) { \ - case 0: _MOVE(s, d, size, type_u); break; \ - case sizeof(type_l): _MOVE(s, d, size, type_l); break; \ - case sizeof(type_w): _MOVE(s, d, size, type_w); break; \ - default: _MOVE(s, d, size, type_c); break; \ - } - PRIM(MOVE) type_u n = TOS.u; POP; unsigned char *q = TOS.a; POP; @@ -535,38 +511,14 @@ code_COMP: NEXT; } -// Device IO block data helpers -#define _FWRMOVE(s, d, size, t) \ - { t *s1=(t *)s, *d1=(t *)d; SET_CI; \ - while (size > 0) { *d1++ = *s1++; size -= sizeof(t); } \ - CLR_CI; \ -} - -#define _BWRMOVE(s, d, size, t) { \ - t *s1=(t *)((char *)s+size), *d1=(t *)((char *)d+size); SET_CI; \ - while (size > 0) { *--d1 = *--s1; size -= sizeof(t); } \ - CLR_CI; \ -} -#define _RMOVE(s, d, size, t) if _FWOVERLAP(s, d, size) _BWRMOVE(s, d, size, t) else _FWRMOVE(s, d, size, t) - -#define _FASTRMOVE(s, d, size) \ - switch (((type_u)s | (type_u)d | size) & (sizeof(type_u)-1)) { \ - case 0: _RMOVE(s, d, size, type_u); break; \ - case sizeof(type_l): _RMOVE(s, d, size, type_l); break; \ - case sizeof(type_w): _RMOVE(s, d, size, type_w); break; \ - default: _RMOVE(s, d, size, type_c); break; \ - } +PRIM(RMOVE) + type_u size = ((dp--)->u); + type_u *d = (type_u *)((dp--)->u); + type_u *s = (type_u *)((dp--)->u); + _FASTRMOVE(s, d, size); -code_RMOVE: - { - type_u size = ((dp--)->u); - type_u *d = (type_u *)((dp--)->u); - type_u *s = (type_u *)((dp--)->u); - - _FASTRMOVE(s, d, size); - NEXT; - } + MIRP // String compare, case insensitive: |