123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- #include <host_endian.h>
- #define op_t unsigned long int
- #define OPSIZ (sizeof(op_t))
- typedef unsigned char byte;
- #define reg_char char
- #if BYTE_ORDER == LITTLE_ENDIAN
- #define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
- #endif
- #if BYTE_ORDER == BIG_ENDIAN
- #define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
- #endif
- #define BYTE_COPY_FWD(dst_bp, src_bp, nbytes) \
- do \
- { \
- int __nbytes = (nbytes); \
- while (__nbytes > 0) \
- { \
- byte __x = ((byte *) src_bp)[0]; \
- src_bp += 1; \
- __nbytes -= 1; \
- ((byte *) dst_bp)[0] = __x; \
- dst_bp += 1; \
- } \
- } while (0)
- #define BYTE_COPY_BWD(dst_ep, src_ep, nbytes) \
- do \
- { \
- int __nbytes = (nbytes); \
- while (__nbytes > 0) \
- { \
- byte __x; \
- src_ep -= 1; \
- __x = ((byte *) src_ep)[0]; \
- dst_ep -= 1; \
- __nbytes -= 1; \
- ((byte *) dst_ep)[0] = __x; \
- } \
- } while (0)
- extern void _wordcopy_fwd_aligned (long int, long int, int);
- extern void _wordcopy_fwd_dest_aligned (long int, long int, int);
- #define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \
- do \
- { \
- if (src_bp % OPSIZ == 0) \
- _wordcopy_fwd_aligned (dst_bp, src_bp, (nbytes) / OPSIZ); \
- else \
- _wordcopy_fwd_dest_aligned (dst_bp, src_bp, (nbytes) / OPSIZ); \
- src_bp += (nbytes) & -OPSIZ; \
- dst_bp += (nbytes) & -OPSIZ; \
- (nbytes_left) = (nbytes) % OPSIZ; \
- } while (0)
- extern void _wordcopy_bwd_aligned (long int, long int, int);
- extern void _wordcopy_bwd_dest_aligned (long int, long int, int);
- #define WORD_COPY_BWD(dst_ep, src_ep, nbytes_left, nbytes) \
- do \
- { \
- if (src_ep % OPSIZ == 0) \
- _wordcopy_bwd_aligned (dst_ep, src_ep, (nbytes) / OPSIZ); \
- else \
- _wordcopy_bwd_dest_aligned (dst_ep, src_ep, (nbytes) / OPSIZ); \
- src_ep -= (nbytes) & -OPSIZ; \
- dst_ep -= (nbytes) & -OPSIZ; \
- (nbytes_left) = (nbytes) % OPSIZ; \
- } while (0)
- #define OP_T_THRES 16
|