Math Processor Unit Library

libmpu – library of arithmetic functions for integer, real, and complex numbers of increased digit capacity

16 Commits   0 Branches   2 Tags
868b2b66 (kx 2024-12-20 16:11:07 +0300   1) 
868b2b66 (kx 2024-12-20 16:11:07 +0300   2) /***************************************************************
868b2b66 (kx 2024-12-20 16:11:07 +0300   3)   __MPU_INTEGER.H
868b2b66 (kx 2024-12-20 16:11:07 +0300   4) 
868b2b66 (kx 2024-12-20 16:11:07 +0300   5)        This file contains declarations of functions for
868b2b66 (kx 2024-12-20 16:11:07 +0300   6)        INTEGER arithmetic operations.
868b2b66 (kx 2024-12-20 16:11:07 +0300   7) 
868b2b66 (kx 2024-12-20 16:11:07 +0300   8)        PART OF : MPU - library .
868b2b66 (kx 2024-12-20 16:11:07 +0300   9) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  10)        USAGE   : Internal only .
868b2b66 (kx 2024-12-20 16:11:07 +0300  11) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  12)        NOTE    : Include "libmpu.h" before this FILE .
868b2b66 (kx 2024-12-20 16:11:07 +0300  13) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  14)        Copyright (C) 2000 - 2024  by Andrew V.Kosteltsev.
868b2b66 (kx 2024-12-20 16:11:07 +0300  15)        All Rights Reserved.
868b2b66 (kx 2024-12-20 16:11:07 +0300  16)  ***************************************************************/
868b2b66 (kx 2024-12-20 16:11:07 +0300  17) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  18) #ifndef   __MPU_INTEGER_H
868b2b66 (kx 2024-12-20 16:11:07 +0300  19) #define   __MPU_INTEGER_H
868b2b66 (kx 2024-12-20 16:11:07 +0300  20) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  21) #ifdef  __cplusplus
868b2b66 (kx 2024-12-20 16:11:07 +0300  22) extern "C" {
868b2b66 (kx 2024-12-20 16:11:07 +0300  23) #endif
868b2b66 (kx 2024-12-20 16:11:07 +0300  24) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  25) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  26) extern void iadd_8( __mpu_uint8_t *c, __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  27) extern void iadc_8( __mpu_uint8_t *c, __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  28) extern void isub_8( __mpu_uint8_t *c, __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  29) extern void isbb_8( __mpu_uint8_t *c, __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  30) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  31) extern void iadd_16( __mpu_uint16_t *c, __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  32) extern void iadc_16( __mpu_uint16_t *c, __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  33) extern void isub_16( __mpu_uint16_t *c, __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  34) extern void isbb_16( __mpu_uint16_t *c, __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  35) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  36) extern void iadd_32( __mpu_uint32_t *c, __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  37) extern void iadc_32( __mpu_uint32_t *c, __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  38) extern void isub_32( __mpu_uint32_t *c, __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  39) extern void isbb_32( __mpu_uint32_t *c, __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  40) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  41) extern void iadd_np( EMUSHORT *c, EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  42) extern void iadc_np( EMUSHORT *c, EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  43) extern void isub_np( EMUSHORT *c, EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  44) extern void isbb_np( EMUSHORT *c, EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  45) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  46) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  47) extern void ishl_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  48) extern void ishr_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  49) extern void isal_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  50) extern void isar_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  51) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  52) extern void ishl_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  53) extern void ishr_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  54) extern void isal_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  55) extern void isar_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  56) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  57) extern void ishl_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  58) extern void ishr_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  59) extern void isal_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  60) extern void isar_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  61) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  62) extern void ishl_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  63) extern void ishr_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  64) extern void isal_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  65) extern void isar_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  66) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  67) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  68) extern void irol_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  69) extern void iror_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  70) extern void ircl_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  71) extern void ircr_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  72) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  73) extern void irol_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  74) extern void iror_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  75) extern void ircl_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  76) extern void ircr_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  77) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  78) extern void irol_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  79) extern void iror_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  80) extern void ircl_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  81) extern void ircr_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300  82) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  83) extern void irol_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  84) extern void iror_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  85) extern void ircl_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  86) extern void ircr_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300  87) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  88) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  89) extern void ishln_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  90) extern void ishrn_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  91) extern void isaln_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  92) extern void isarn_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  93) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  94) extern void ishln_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  95) extern void ishrn_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  96) extern void isaln_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  97) extern void isarn_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300  98) 
868b2b66 (kx 2024-12-20 16:11:07 +0300  99) extern void ishln_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 100) extern void ishrn_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 101) extern void isaln_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 102) extern void isarn_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 103) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 104) extern void ishln_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 105) extern void ishrn_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 106) extern void isaln_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 107) extern void isarn_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 108) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 109) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 110) extern void iroln_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 111) extern void irorn_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 112) extern void ircln_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 113) extern void ircrn_8( __mpu_uint8_t *c, __mpu_uint8_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 114) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 115) extern void iroln_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 116) extern void irorn_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 117) extern void ircln_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 118) extern void ircrn_16( __mpu_uint16_t *c, __mpu_uint16_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 119) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 120) extern void iroln_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 121) extern void irorn_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 122) extern void ircln_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 123) extern void ircrn_32( __mpu_uint32_t *c, __mpu_uint32_t *a, unsigned int b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 124) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 125) extern void iroln_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 126) extern void irorn_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 127) extern void ircln_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 128) extern void ircrn_np( EMUSHORT *c, EMUSHORT *a, unsigned int b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 129) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 130) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 131) extern void inot_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 132) extern void inot_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 133) extern void inot_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 134) extern void inot_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 135) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 136) extern void ineg_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 137) extern void ineg_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 138) extern void ineg_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 139) extern void ineg_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 140) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 141) extern void iand_8( __mpu_uint8_t *c, __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 142) extern void iand_16( __mpu_uint16_t *c, __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 143) extern void iand_32( __mpu_uint32_t *c, __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 144) extern void iand_np( EMUSHORT *c, EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 145) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 146) extern void itest_8( __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 147) extern void itest_16( __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 148) extern void itest_32( __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 149) extern void itest_np( EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 150) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 151) extern void icmp_8( __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 152) extern void icmp_16( __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 153) extern void icmp_32( __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 154) extern void icmp_np( EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 155) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 156) extern void ior_8( __mpu_uint8_t *c, __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 157) extern void ior_16( __mpu_uint16_t *c, __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 158) extern void ior_32( __mpu_uint32_t *c, __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 159) extern void ior_np( EMUSHORT *c, EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 160) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 161) extern void ixor_8( __mpu_uint8_t *c, __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 162) extern void ixor_16( __mpu_uint16_t *c, __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 163) extern void ixor_32( __mpu_uint32_t *c, __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 164) extern void ixor_np( EMUSHORT *c, EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 165) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 166) extern void iinc_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 167) extern void iinc_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 168) extern void iinc_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 169) extern void iinc_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 170) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 171) extern void idec_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 172) extern void idec_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 173) extern void idec_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 174) extern void idec_np( EMUSHORT *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 175) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 176) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 177) extern void icpy_8( __mpu_uint8_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 178) extern void icpy_16( __mpu_uint16_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 179) extern void icpy_32( __mpu_uint32_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 180) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 181) extern void icpy_s2l_8to16( __mpu_uint16_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 182) extern void icpy_s2l_8to32( __mpu_uint32_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 183) extern void icpy_s2l_8to_np( EMUSHORT *c, __mpu_uint8_t *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 184) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 185) extern void icpy_s2l_16to32( __mpu_uint32_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 186) extern void icpy_s2l_16to_np( EMUSHORT *c, __mpu_uint16_t *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 187) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 188) #if BITS_PER_EMUSHORT > 32
868b2b66 (kx 2024-12-20 16:11:07 +0300 189) extern void icpy_s2l_32to_np( EMUSHORT *c, __mpu_uint32_t *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 190) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 191) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 192) extern void icpy_l2s_16to8( __mpu_uint8_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 193) extern void icpy_l2s_32to8( __mpu_uint8_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 194) extern void icpy_l2s_np_to8( __mpu_uint8_t *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 195) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 196) extern void icpy_l2s_32to16( __mpu_uint16_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 197) extern void icpy_l2s_np_to16( __mpu_uint16_t *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 198) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 199) #if BITS_PER_EMUSHORT > 32
868b2b66 (kx 2024-12-20 16:11:07 +0300 200) extern void icpy_l2s_np_to32( __mpu_uint32_t *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 201) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 202) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 203) extern void icpy_np( EMUSHORT *c, EMUSHORT *a, int np_c, int np_a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 204) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 205) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 206) extern void icvt_s2l_8to16( __mpu_uint16_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 207) extern void icvt_s2l_8to32( __mpu_uint32_t *c, __mpu_uint8_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 208) extern void icvt_s2l_8to_np( EMUSHORT *c, __mpu_uint8_t *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 209) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 210) extern void icvt_s2l_16to32( __mpu_uint32_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 211) extern void icvt_s2l_16to_np( EMUSHORT *c, __mpu_uint16_t *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 212) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 213) #if BITS_PER_EMUSHORT > 32
868b2b66 (kx 2024-12-20 16:11:07 +0300 214) extern void icvt_s2l_32to_np( EMUSHORT *c, __mpu_uint32_t *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 215) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 216) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 217) extern void icvt_l2s_16to8( __mpu_uint8_t *c, __mpu_uint16_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 218) extern void icvt_l2s_32to8( __mpu_uint8_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 219) extern void icvt_l2s_np_to8( __mpu_uint8_t *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 220) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 221) extern void icvt_l2s_32to16( __mpu_uint16_t *c, __mpu_uint32_t *a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 222) extern void icvt_l2s_np_to16( __mpu_uint16_t *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 223) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 224) #if BITS_PER_EMUSHORT > 32
868b2b66 (kx 2024-12-20 16:11:07 +0300 225) extern void icvt_l2s_np_to32( __mpu_uint32_t *c, EMUSHORT *a, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 226) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 227) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 228) extern void icvt_np( EMUSHORT *c, EMUSHORT *a, int np_c, int np_a );
868b2b66 (kx 2024-12-20 16:11:07 +0300 229) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 230) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 231) extern void ixchg_8( __mpu_uint8_t *a, __mpu_uint8_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 232) extern void ixchg_16( __mpu_uint16_t *a, __mpu_uint16_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 233) extern void ixchg_32( __mpu_uint32_t *a, __mpu_uint32_t *b );
868b2b66 (kx 2024-12-20 16:11:07 +0300 234) extern void ixchg_np( EMUSHORT *a, EMUSHORT *b, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 235) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 236) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 237) extern void imul_8( __mpu_uint16_t *prod, __mpu_uint8_t *num, __mpu_uint8_t *mul );
868b2b66 (kx 2024-12-20 16:11:07 +0300 238) extern void imul_16( __mpu_uint32_t *prod, __mpu_uint16_t *num, __mpu_uint16_t *mul );
868b2b66 (kx 2024-12-20 16:11:07 +0300 239) #if BITS_PER_EMUSHORT > 32 /* 64 bits only */
868b2b66 (kx 2024-12-20 16:11:07 +0300 240) extern void imul_32( __mpu_uint64_t *prod, __mpu_uint32_t *num, __mpu_uint32_t *mul );
868b2b66 (kx 2024-12-20 16:11:07 +0300 241) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 242) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 243) extern void ismul_8( __mpu_uint16_t *prod, __mpu_uint8_t *num, __mpu_uint8_t *mul );
868b2b66 (kx 2024-12-20 16:11:07 +0300 244) extern void ismul_16( __mpu_uint32_t *prod, __mpu_uint16_t *num, __mpu_uint16_t *mul );
868b2b66 (kx 2024-12-20 16:11:07 +0300 245) #if BITS_PER_EMUSHORT > 32 /* 64 bits only */
868b2b66 (kx 2024-12-20 16:11:07 +0300 246) extern void ismul_32( __mpu_uint64_t *prod, __mpu_uint32_t *num, __mpu_uint32_t *mul );
868b2b66 (kx 2024-12-20 16:11:07 +0300 247) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 248) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 249) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 250) extern void idiv_8( __mpu_uint8_t *quot, __mpu_uint8_t *rem, __mpu_uint8_t *num, __mpu_uint8_t *den );
868b2b66 (kx 2024-12-20 16:11:07 +0300 251) extern void idiv_16( __mpu_uint16_t *quot, __mpu_uint16_t *rem, __mpu_uint16_t *num, __mpu_uint16_t *den );
868b2b66 (kx 2024-12-20 16:11:07 +0300 252) #if BITS_PER_EMUSHORT > 32 /* 64 bits only */
868b2b66 (kx 2024-12-20 16:11:07 +0300 253) extern void idiv_32( __mpu_uint32_t *quot, __mpu_uint32_t *rem, __mpu_uint32_t *num, __mpu_uint32_t *den );
868b2b66 (kx 2024-12-20 16:11:07 +0300 254) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 255) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 256) extern void isdiv_8( __mpu_uint8_t *quot, __mpu_uint8_t *rem, __mpu_uint8_t *num, __mpu_uint8_t *den );
868b2b66 (kx 2024-12-20 16:11:07 +0300 257) extern void isdiv_16( __mpu_uint16_t *quot, __mpu_uint16_t *rem, __mpu_uint16_t *num, __mpu_uint16_t *den );
868b2b66 (kx 2024-12-20 16:11:07 +0300 258) #if BITS_PER_EMUSHORT > 32 /* 64 bits only */
868b2b66 (kx 2024-12-20 16:11:07 +0300 259) extern void isdiv_32( __mpu_uint32_t *quot, __mpu_uint32_t *rem, __mpu_uint32_t *num, __mpu_uint32_t *den );
868b2b66 (kx 2024-12-20 16:11:07 +0300 260) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 261) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 262) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 263) extern void imul_np( EMUSHORT *prod, EMUSHORT *num, EMUSHORT *mul, int np_prod, int np_num );
868b2b66 (kx 2024-12-20 16:11:07 +0300 264) extern void ismul_np( EMUSHORT *prod, EMUSHORT *num, EMUSHORT *mul, int np_prod, int np_num );
868b2b66 (kx 2024-12-20 16:11:07 +0300 265) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 266) extern void idiv_np( EMUSHORT *quot, EMUSHORT *rem, EMUSHORT *num, EMUSHORT *den, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 267) extern void isdiv_np( EMUSHORT *quot, EMUSHORT *rem, EMUSHORT *num, EMUSHORT *den, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 268) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 269) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 270) extern void iatoi_8( __mpu_uint8_t *c, __mpu_char8_t *str );
868b2b66 (kx 2024-12-20 16:11:07 +0300 271) extern void iatoui_8( __mpu_uint8_t *c, __mpu_char8_t *str );
868b2b66 (kx 2024-12-20 16:11:07 +0300 272) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 273) extern void iatoi_16( __mpu_uint16_t *c, __mpu_char8_t *str );
868b2b66 (kx 2024-12-20 16:11:07 +0300 274) extern void iatoui_16( __mpu_uint16_t *c, __mpu_char8_t *str );
868b2b66 (kx 2024-12-20 16:11:07 +0300 275) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 276) #if BITS_PER_EMUSHORT > 32 /* 64 bits only */
868b2b66 (kx 2024-12-20 16:11:07 +0300 277) extern void iatoi_32( __mpu_uint32_t *c, __mpu_char8_t *str );
868b2b66 (kx 2024-12-20 16:11:07 +0300 278) extern void iatoui_32( __mpu_uint32_t *c, __mpu_char8_t *str );
868b2b66 (kx 2024-12-20 16:11:07 +0300 279) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 280) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 281) extern void iatoi_np( EMUSHORT *c, __mpu_char8_t *str, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 282) extern void iatoui_np( EMUSHORT *c, __mpu_char8_t *str, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 283) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 284) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 285) extern void iitoa_8( __mpu_char8_t *str, __mpu_uint8_t *a, int radix, int uf );
868b2b66 (kx 2024-12-20 16:11:07 +0300 286) extern void iuitoa_8( __mpu_char8_t *str, __mpu_uint8_t *a, int radix, int uf );
868b2b66 (kx 2024-12-20 16:11:07 +0300 287) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 288) extern void iitoa_16( __mpu_char8_t *str, __mpu_uint16_t *a, int radix, int uf );
868b2b66 (kx 2024-12-20 16:11:07 +0300 289) extern void iuitoa_16( __mpu_char8_t *str, __mpu_uint16_t *a, int radix, int uf );
868b2b66 (kx 2024-12-20 16:11:07 +0300 290) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 291) #if BITS_PER_EMUSHORT > 32 /* 64 bits only */
868b2b66 (kx 2024-12-20 16:11:07 +0300 292) extern void iitoa_32( __mpu_char8_t *str, __mpu_uint32_t *a, int radix, int uf );
868b2b66 (kx 2024-12-20 16:11:07 +0300 293) extern void iuitoa_32( __mpu_char8_t *str, __mpu_uint32_t *a, int radix, int uf );
868b2b66 (kx 2024-12-20 16:11:07 +0300 294) #endif /* BITS_PER_EMUSHORT > 32 */
868b2b66 (kx 2024-12-20 16:11:07 +0300 295) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 296) extern void iitoa_np( __mpu_char8_t *str, EMUSHORT *a, int radix, int uf, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 297) extern void iuitoa_np( __mpu_char8_t *str, EMUSHORT *a, int radix, int uf, int np );
868b2b66 (kx 2024-12-20 16:11:07 +0300 298) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 299) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 300) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 301) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 302) #ifdef  __cplusplus
868b2b66 (kx 2024-12-20 16:11:07 +0300 303) }   /* ... extern "C" */
868b2b66 (kx 2024-12-20 16:11:07 +0300 304) #endif
868b2b66 (kx 2024-12-20 16:11:07 +0300 305) 
868b2b66 (kx 2024-12-20 16:11:07 +0300 306) #endif /* __MPU_INTEGER_H */