diff options
Diffstat (limited to 'zap')
-rw-r--r-- | zap/GNUmakefile | 6 | ||||
-rw-r--r-- | zap/include/zap/bs.h | 5 | ||||
-rw-r--r-- | zap/include/zap/math.h | 197 | ||||
-rw-r--r-- | zap/include/zap/mem.h | 13 | ||||
-rw-r--r-- | zap/source/amd64/mem/cp.s | 15 | ||||
-rw-r--r-- | zap/source/any/math/abs.cc | 18 | ||||
-rw-r--r-- | zap/source/any/math/divmod.cc | 10 | ||||
-rw-r--r-- | zap/source/any/math/exp.cc | 23 | ||||
-rw-r--r-- | zap/source/arm64/math/abs.s | 29 | ||||
-rw-r--r-- | zap/source/arm64/mem/cp.s | 40 |
10 files changed, 78 insertions, 278 deletions
diff --git a/zap/GNUmakefile b/zap/GNUmakefile index dc7bcf4..e162c98 100644 --- a/zap/GNUmakefile +++ b/zap/GNUmakefile @@ -19,9 +19,7 @@ stdcxx := c++14 endif OBJ_BS_TRAP := source/any/bs/trap.o -OBJ_MATH_ABS := source/any/math/abs.o OBJ_MATH_DIVMOD := source/any/math/divmod.o -OBJ_MATH_EXP := source/any/math/exp.o OBJ_MEM_CP := source/any/mem/cp.o OBJ_MEM_EQ := source/any/mem/eq.o OBJ_MEM_FILL := source/any/mem/fill.o @@ -39,19 +37,15 @@ OBJ_STR_WIN1252ENC := source/any/str/win1252enc.o ifeq "$(arch)" "amd64" OBJ_BS_TRAP := source/$(arch)/bs/trap.o -#OBJ_MATH_ABS := source/$(arch)/math/abs.o OBJ_MEM_CP := source/$(arch)/mem/cp.o OBJ_MEM_FILL := source/$(arch)/mem/fill.o else ifeq "$(arch)" "arm64" -OBJ_MATH_ABS := source/$(arch)/math/abs OBJ_MEM_CP := source/$(arch)/mem/cp.o endif OBJS := \ $(OBJ_BS_TRAP) \ - $(OBJ_MATH_ABS) \ $(OBJ_MATH_DIVMOD) \ - $(OBJ_MATH_EXP) \ $(OBJ_MEM_CP) \ $(OBJ_MEM_EQ) \ $(OBJ_MEM_FILL) \ diff --git a/zap/include/zap/bs.h b/zap/include/zap/bs.h index 3a1a1dd..982b355 100644 --- a/zap/include/zap/bs.h +++ b/zap/include/zap/bs.h @@ -96,8 +96,9 @@ zap_priv_cdecl -#define zap_ver ((unsigned long)+0x19u) -#define zap_compatver ((unsigned long)+0x19u) // Programs expecting this version will still compile with the current version. +#define zap_ver ((unsigned long)+0x1Au) // Programs expecting this version will still compile with the current extension version. +#define zap_extver ((unsigned long)+0x0u) // The extension versions adds functionality without breaking the existing ones. + // The patch version is not public as it only changes implementation details. #define zap_nopos zap_maxvalsz diff --git a/zap/include/zap/math.h b/zap/include/zap/math.h index c6f17c2..2530f4f 100644 --- a/zap/include/zap/math.h +++ b/zap/include/zap/math.h @@ -12,108 +12,40 @@ zap_priv_cdecl typedef struct { - signed char num; - signed char den; -} zap_fracsc; -typedef struct { - short num; - short den; -} zap_fracs; -typedef struct { - int num; - int den; -} zap_fraci; -typedef struct { - long num; - long den; -} zap_fracl; -typedef struct { - long long num; - long long den; -} zap_fracll; + signed char lval; + signed char rval; +} zap_pairsc; typedef struct { - signed char quot; - signed char rem; -} zap_quotremsc; -typedef struct { - short quot; - short rem; -} zap_quotrems; + short lval; + short rval; +} zap_pairs; + typedef struct { - int quot; - int rem; -} zap_quotremi; + int lval; + int rval; +} zap_pairi; + typedef struct { - long quot; - long rem; -} zap_quotreml; + long lval; + long rval; +} zap_pairl; + typedef struct { - long long quot; - long long rem; -} zap_quotremll; - -zap_priv_nothrw zap_priv_unseq unsigned char zap_abssc(signed char val); -zap_priv_nothrw zap_priv_unseq unsigned short zap_abss( short val); -zap_priv_nothrw zap_priv_unseq unsigned int zap_absi( int val); -zap_priv_nothrw zap_priv_unseq unsigned long zap_absl( long val); -zap_priv_nothrw zap_priv_unseq unsigned long long zap_absll(long long val); -zap_priv_nothrw zap_priv_unseq float zap_absf( float val); -zap_priv_nothrw zap_priv_unseq double zap_absd( double val); -zap_priv_nothrw zap_priv_unseq long double zap_absld(long double val); - -zap_priv_nothrw zap_priv_unseq zap_quotremsc zap_divmodsc(signed char num,signed char den); -zap_priv_nothrw zap_priv_unseq zap_quotrems zap_divmods( short num,short den); -zap_priv_nothrw zap_priv_unseq zap_quotremi zap_divmodi( int num,int den); -zap_priv_nothrw zap_priv_unseq zap_quotreml zap_divmodl( long num,long den); -zap_priv_nothrw zap_priv_unseq zap_quotremll zap_divmodll(long long num,long long den); -zap_priv_nothrw zap_priv_unseq zap_quotremsc zap_divmodsc(signed char num,signed char den); -zap_priv_nothrw zap_priv_unseq zap_quotrems zap_divmods( short num,short den); -zap_priv_nothrw zap_priv_unseq zap_quotremi zap_divmodi( int num,int den); -zap_priv_nothrw zap_priv_unseq zap_quotreml zap_divmodl( long num,long den); -zap_priv_nothrw zap_priv_unseq zap_quotremll zap_divmodll(long long num,long long den); - -zap_priv_nothrw zap_priv_unseq unsigned char zap_loguc( unsigned char val,unsigned char n); -zap_priv_nothrw zap_priv_unseq unsigned short zap_logus( unsigned short val,unsigned short n); -zap_priv_nothrw zap_priv_unseq unsigned int zap_logui( unsigned int val,unsigned int n); -zap_priv_nothrw zap_priv_unseq unsigned long zap_logul( unsigned long val,unsigned long n); -zap_priv_nothrw zap_priv_unseq unsigned long long zap_logull(unsigned long long val,unsigned long long n); -zap_priv_nothrw zap_priv_unseq char zap_logsc( char val,signed char n); -zap_priv_nothrw zap_priv_unseq short zap_logs( short val,short n); -zap_priv_nothrw zap_priv_unseq int zap_logi( int val,int n); -zap_priv_nothrw zap_priv_unseq long zap_logl( long val,long n); -zap_priv_nothrw zap_priv_unseq long long zap_logll( long long val,long long n); -zap_priv_nothrw zap_priv_unseq float zap_logf( float val,float n); -zap_priv_nothrw zap_priv_unseq double zap_logd( double val,double n); -zap_priv_nothrw zap_priv_unseq long double zap_logld( long double val,long double n); - -zap_priv_nothrw zap_priv_unseq unsigned char zap_expuc( unsigned char val,unsigned char n); -zap_priv_nothrw zap_priv_unseq unsigned short zap_expus( unsigned short val,unsigned short n); -zap_priv_nothrw zap_priv_unseq unsigned int zap_expui( unsigned int val,unsigned int n); -zap_priv_nothrw zap_priv_unseq unsigned long zap_expul( unsigned long val,unsigned long n); -zap_priv_nothrw zap_priv_unseq unsigned long long zap_expull(unsigned long long val,unsigned long long n); -zap_priv_nothrw zap_priv_unseq signed char zap_expsc( signed char val,signed char n); -zap_priv_nothrw zap_priv_unseq short zap_exps( short val,short n); -zap_priv_nothrw zap_priv_unseq int zap_expi( int val,int n); -zap_priv_nothrw zap_priv_unseq long zap_expl( long val,long n); -zap_priv_nothrw zap_priv_unseq long long zap_expll( long long val,long long n); -zap_priv_nothrw zap_priv_unseq float zap_expf( float val,float n); -zap_priv_nothrw zap_priv_unseq double zap_expd( double val,double n); -zap_priv_nothrw zap_priv_unseq long double zap_expld( long double val,long double n); - -zap_priv_nothrw zap_priv_unseq unsigned char zap_rootuc( unsigned char val,unsigned char n); -zap_priv_nothrw zap_priv_unseq unsigned short zap_rootus( unsigned short val,unsigned short n); -zap_priv_nothrw zap_priv_unseq unsigned int zap_rootui( unsigned int val,unsigned int n); -zap_priv_nothrw zap_priv_unseq unsigned long zap_rootul( unsigned long val,unsigned long n); -zap_priv_nothrw zap_priv_unseq unsigned long long zap_rootull(unsigned long long val,unsigned long long n); -zap_priv_nothrw zap_priv_unseq char zap_rootsc( char val,signed char n); -zap_priv_nothrw zap_priv_unseq short zap_roots( short val,short n); -zap_priv_nothrw zap_priv_unseq int zap_rooti( int val,int n); -zap_priv_nothrw zap_priv_unseq long zap_rootl( long val,long n); -zap_priv_nothrw zap_priv_unseq long long zap_rootll( long long val,long long n); -zap_priv_nothrw zap_priv_unseq float zap_rootf( float val,float n); -zap_priv_nothrw zap_priv_unseq double zap_rootd( double val,double n); -zap_priv_nothrw zap_priv_unseq long double zap_rootld( long double val,long double n); + long long lval; + long long rval; +} zap_pairll; + +zap_priv_nothrw zap_priv_unseq zap_pairsc zap_divmodsc(signed char num,signed char den); +zap_priv_nothrw zap_priv_unseq zap_pairs zap_divmods( short num,short den); +zap_priv_nothrw zap_priv_unseq zap_pairi zap_divmodi( int num,int den); +zap_priv_nothrw zap_priv_unseq zap_pairl zap_divmodl( long num,long den); +zap_priv_nothrw zap_priv_unseq zap_pairll zap_divmodll(long long num,long long den); +zap_priv_nothrw zap_priv_unseq zap_pairsc zap_divmodsc(signed char num,signed char den); +zap_priv_nothrw zap_priv_unseq zap_pairs zap_divmods( short num,short den); +zap_priv_nothrw zap_priv_unseq zap_pairi zap_divmodi( int num,int den); +zap_priv_nothrw zap_priv_unseq zap_pairl zap_divmodl( long num,long den); +zap_priv_nothrw zap_priv_unseq zap_pairll zap_divmodll(long long num,long long den); zap_priv_cdeclend @@ -141,70 +73,47 @@ namespace zap { namespace zap { namespace impl { - template<typename ityp> struct cfractyp {using typ = ityp;}; + template<typename ityp> struct cpairtyp {using typ = ityp;}; - template<> struct cfractyp<signed char> {using typ = ::zap_fracsc;}; - template<> struct cfractyp<short> {using typ = ::zap_fracs;}; - template<> struct cfractyp<int> {using typ = ::zap_fraci;}; - template<> struct cfractyp<long> {using typ = ::zap_fracl;}; - template<> struct cfractyp<long long> {using typ = ::zap_fracll;}; - - template<typename ityp> struct cquotremtyp {using typ = ityp;}; - - template<> struct cquotremtyp<signed char> {using typ = ::zap_quotremsc;}; - template<> struct cquotremtyp<short> {using typ = ::zap_quotrems;}; - template<> struct cquotremtyp<int> {using typ = ::zap_quotremi;}; - template<> struct cquotremtyp<long> {using typ = ::zap_quotreml;}; - template<> struct cquotremtyp<long long> {using typ = ::zap_quotremll;}; + template<> struct cpairtyp<signed char> {using typ = ::zap_pairsc;}; + template<> struct cpairtyp<short> {using typ = ::zap_pairs;}; + template<> struct cpairtyp<int> {using typ = ::zap_pairi;}; + template<> struct cpairtyp<long> {using typ = ::zap_pairl;}; + template<> struct cpairtyp<long long> {using typ = ::zap_pairll;}; } - template<typename typ> class frac { - public: - using cfractyp = typename ::zap::impl::cfractyp<typ>::typ; - - typ num; - typ den; - - constexpr auto cfrac() noexcept -> cfractyp { - cfractyp frac; - frac.num = this->num; - frac.den = this->den; - return frac; - } - }; - - template<typename typ> class quotrem { + template<typename typ> class pair { public: - using cquotremtyp = typename ::zap::impl::cquotremtyp<typ>::typ; + using cpairtyp = typename ::zap::impl::cpairtyp<typ>::typ; - typ quot; - typ rem; + typ lval; + typ rval; - constexpr auto cquotrem() noexcept -> cquotremtyp { - cquotremtyp quotrem; - quotrem.quot = this->quot; - quotrem.rem = this->rem; - return quotrem; + constexpr auto cpair() noexcept -> cpairtyp { + cpairtyp pair; + pair.lval = this->lval; + pair.rval = this->rval; + return pair; } }; } namespace zap { template<typename typ> constexpr auto abs(typ const val) noexcept -> ::zap::usign<typ> { - using newtyp = ::zap::usign<typ>; + using newtyp = ::zap::usign<typ>; // If a floating-point type was used, the new type would be identical. if (val > typ {0x0}) return static_cast<newtyp>(val); - return 0x0u-static_cast<newtyp>(val); + return typ {0x0} - static_cast<newtyp>(val); } - template<typename typ> constexpr auto divmod(typ const num,typ const den) noexcept -> ::zap::quotrem<typ> { - ::zap::quotrem<typ> quotrem; + template<typename typ> constexpr auto divmod(typ const num,typ const den) noexcept -> ::zap::pair<typ> { + ::zap::pair<typ> pair; zap_priv_ulikly (den == 0x0) { - quotrem.quot = ::zap::inf<typ>; - quotrem.rem = quotrem.quot; - return quotrem; + pair.lval = ::zap::inf<typ>; + pair.rval = pair.lval; + return pair; } - for (quotrem = ::zap::quotrem<typ> {typ {0x0},num};quotrem.rem >= den;++quotrem.quot,quotrem.rem -= den) {} - return quotrem; + for (pair = ::zap::pair<typ> {typ {0x0},num};pair.rval >= den;++pair.lval,pair.rval -= den); + return pair; } template<typename typ> constexpr auto exp(typ const val,typ const n) noexcept -> typ { diff --git a/zap/include/zap/mem.h b/zap/include/zap/mem.h index 751a601..bd90395 100644 --- a/zap/include/zap/mem.h +++ b/zap/include/zap/mem.h @@ -11,10 +11,15 @@ zap_priv_cdecl -zap_priv_nothrw void * zap_cp( void * zap_priv_restr dest,void const * zap_priv_restr src, zap_sz num); -zap_priv_nothrw zap_i8 zap_eq( void const * lbuf,void const * rbuf,zap_sz num); -zap_priv_nothrw void zap_fill(void * dest,unsigned char val, zap_sz num); -zap_priv_nothrw void * zap_srch(void const * buf, unsigned char val, zap_sz num); +typedef struct { + void * dest; + void * src; +} zap_cpret; + +zap_priv_nothrw zap_cpret zap_cp( void * zap_priv_restr dest,void const * zap_priv_restr src, zap_sz num); +zap_priv_nothrw zap_i8 zap_eq( void const * lbuf,void const * rbuf,zap_sz num); +zap_priv_nothrw void zap_fill(void * dest,unsigned char val, zap_sz num); +zap_priv_nothrw void * zap_srch(void const * buf, unsigned char val, zap_sz num); zap_priv_cdeclend diff --git a/zap/source/amd64/mem/cp.s b/zap/source/amd64/mem/cp.s index 3c9f2e1..b0b91e5 100644 --- a/zap/source/amd64/mem/cp.s +++ b/zap/source/amd64/mem/cp.s @@ -14,38 +14,38 @@ zap_cp: .big02cp: # big02cp:; // We assume AVX. cmp rdx,0x20 - jl short .big01cp # if (num < 0x20u) goto big01cp; + jl short .big01cp # if (rem < 0x20u) goto big01cp; vmovdqu ymm0,[rsi] # val02 = *(unsigned int256_t *)src; vmovdqu [rdi],ymm0 # *(unsigned int256_t *)dest = val02; add rdi,0x20 # dest += 0x20u; add rsi,0x20 # src += 0x20u; - sub rdx,0x20 # num -= 0x20u; + sub rdx,0x20 # rem -= 0x20u; jmp short .big02cp # goto big02cp; .big01cp: # big01cp:; cmp rdx,0x10 - jl short .wrdcp # if (num < 0x10u) goto wrdcp; + jl short .wrdcp # if (rem < 0x10u) goto wrdcp; movdqu xmm0,[rsi] # val01 = *(unsigned int128_t *)src; movdqu [rdi],xmm0 # *(unsigned int128_t *)dest = val01; add rdi,0x10 # dest += 0x10u; add rsi,0x10 # src += 0x10u; - sub rdx,0x10 # num -= 0x10u; + sub rdx,0x10 # rem -= 0x10u; jmp short .big01cp # goto big01cp; .wrdcp: # wrdcp:; cmp rdx,0x8 - jl short .bytecp # if (num < 0x8u) goto bytecp; + jl short .bytecp # if (rem < 0x8u) goto bytecp; mov rcx,[rsi] # val8 = *(zap_i04 *)src; mov [rdi],rcx # *(zap_i04 *)dest = val8; add rsi,0x8 # dest += 0x8u; add rdi,0x8 # src += 0x8u; - sub rdx,0x8 # num -= 0x8u; + sub rdx,0x8 # rem -= 0x8u; jmp short .wrdcp # goto wrdcp .bytecp: # bytecp:; @@ -62,4 +62,5 @@ zap_cp: .done: mov rax,rdi - ret # return dest; + mov rdx,rsi + ret # return (zap_cpret) {.dest = dest,.src = src}; diff --git a/zap/source/any/math/abs.cc b/zap/source/any/math/abs.cc deleted file mode 100644 index 3e6f53e..0000000 --- a/zap/source/any/math/abs.cc +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright 2022-2023 Gabriel Jensen. - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. -*/ - -#include <zap/math.h> - -extern "C" { - zap_priv_nothrw unsigned char zap_abssc(signed char const val) {return ::zap::abs(val);} - zap_priv_nothrw unsigned short zap_abss( short const val) {return ::zap::abs(val);} - zap_priv_nothrw unsigned int zap_absi( int const val) {return ::zap::abs(val);} - zap_priv_nothrw unsigned long zap_absl( long const val) {return ::zap::abs(val);} - zap_priv_nothrw unsigned long long zap_absll(long long const val) {return ::zap::abs(val);} - zap_priv_nothrw float zap_absf( float const val) {return ::zap::abs(val);} - zap_priv_nothrw double zap_absd( double const val) {return ::zap::abs(val);} - zap_priv_nothrw long double zap_absld(long double const val) {return ::zap::abs(val);} -} diff --git a/zap/source/any/math/divmod.cc b/zap/source/any/math/divmod.cc index c686c15..77523f8 100644 --- a/zap/source/any/math/divmod.cc +++ b/zap/source/any/math/divmod.cc @@ -7,9 +7,9 @@ #include <zap/math.h> extern "C" { - zap_priv_nothrw auto zap_divmodsc(signed char const num,signed char const den) -> ::zap_quotremsc {return ::zap::divmod(num,den).cquotrem();} - zap_priv_nothrw auto zap_divmods( short const num,short const den) -> ::zap_quotrems {return ::zap::divmod(num,den).cquotrem();} - zap_priv_nothrw auto zap_divmodi( int const num,int const den) -> ::zap_quotremi {return ::zap::divmod(num,den).cquotrem();} - zap_priv_nothrw auto zap_divmodl( long const num,long const den) -> ::zap_quotreml {return ::zap::divmod(num,den).cquotrem();} - zap_priv_nothrw auto zap_divmodll(long long const num,long long const den) -> ::zap_quotremll {return ::zap::divmod(num,den).cquotrem();} + zap_priv_nothrw auto zap_divmodsc(signed char const num,signed char const den) -> ::zap_pairsc {return ::zap::divmod(num,den).cpair();} + zap_priv_nothrw auto zap_divmods( short const num,short const den) -> ::zap_pairs {return ::zap::divmod(num,den).cpair();} + zap_priv_nothrw auto zap_divmodi( int const num,int const den) -> ::zap_pairi {return ::zap::divmod(num,den).cpair();} + zap_priv_nothrw auto zap_divmodl( long const num,long const den) -> ::zap_pairl {return ::zap::divmod(num,den).cpair();} + zap_priv_nothrw auto zap_divmodll(long long const num,long long const den) -> ::zap_pairll {return ::zap::divmod(num,den).cpair();} } diff --git a/zap/source/any/math/exp.cc b/zap/source/any/math/exp.cc deleted file mode 100644 index 2d4831b..0000000 --- a/zap/source/any/math/exp.cc +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright 2022-2023 Gabriel Jensen. - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. -*/ - -#include <zap/math.h> - -extern "C" { - zap_priv_nothrw unsigned char zap_expuc( unsigned char val,unsigned char n) {return ::zap::exp(val,n);} - zap_priv_nothrw unsigned short zap_expus( unsigned short val,unsigned short n) {return ::zap::exp(val,n);} - zap_priv_nothrw unsigned int zap_expui( unsigned int val,unsigned int n) {return ::zap::exp(val,n);} - zap_priv_nothrw unsigned long zap_expul( unsigned long val,unsigned long n) {return ::zap::exp(val,n);} - zap_priv_nothrw unsigned long long zap_expull(unsigned long long val,unsigned long long n) {return ::zap::exp(val,n);} - zap_priv_nothrw signed char zap_expsc( signed char val,signed char n) {return ::zap::exp(val,n);} - zap_priv_nothrw short zap_exps( short val,short n) {return ::zap::exp(val,n);} - zap_priv_nothrw int zap_expi( int val,int n) {return ::zap::exp(val,n);} - zap_priv_nothrw long zap_expl( long val,long n) {return ::zap::exp(val,n);} - zap_priv_nothrw long long zap_expll( long long val,long long n) {return ::zap::exp(val,n);} - zap_priv_nothrw float zap_expf( float val,float n) {return ::zap::exp(val,n);} - zap_priv_nothrw double zap_expd( double val,double n) {return ::zap::exp(val,n);} - zap_priv_nothrw long double zap_expld( long double val,long double n) {return ::zap::exp(val,n);} -} diff --git a/zap/source/arm64/math/abs.s b/zap/source/arm64/math/abs.s deleted file mode 100644 index 218d4d8..0000000 --- a/zap/source/arm64/math/abs.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022-2023 Gabriel Jensen. -// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -// If a copy of the MPL was not distributed with this file, You can obtasrc one at <https://mozilla.org/MPL/2.0>. - -.globl zap_abs8 - -.func - -zap_abs8: - cmp w0,0x0 - cneg w0,w0,gt // if (val < 0x0) val = -val; - ret // return val; - -zap_abs01: - cmp w0,0x0 - cneg w0,w0,gt // if (val < 0x0) val = -val; - ret // return val; - -zap_abs02: - cmp w0,0x0 - cneg w0,w0,gt // if (val < 0x0) val = -val; - ret // return val; - -zap_abs04: - cmp x0,0x0 - cneg x0,x0,gt // if (val < 0x0) val = -val; - ret // return val; - -.endfunc diff --git a/zap/source/arm64/mem/cp.s b/zap/source/arm64/mem/cp.s deleted file mode 100644 index 1eb1569..0000000 --- a/zap/source/arm64/mem/cp.s +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022-2023 Gabriel Jensen. -// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -// If a copy of the MPL was not distributed with this file, You can obtasrc one at <https://mozilla.org/MPL/2.0>. - -.globl zap_cp - -.func - -zap_cp: - // zap_i8 tmp1; - // zap_i04 tmp4; - -.wrdcp: // wrdcp:; - cmp x2,0x8 - blt .bytecp // if (num < 0x8u) goto bytecp; - - ldr x3,[x1] // tmp8 = *(zap_i04 *)src; - str x3,[x0] // *(zap_i04 *)dest = tmp8; - - add x0,x0,0x8 // dest += 0x8u; - add x1,x1,0x8 // src += 0x8u; - sub x2,x2,0x8 // num -= 0x4u; - b .wrdcp // goto wrdcp; - -.bytecp: // bytecp:; - cmp x2,0x1 - blt .done // if (num == 0x1u) goto done; - - ldrb w3,[x1] // tmp1 = *(zap_i8 *)src; - strb w3,[x0] // *(zap_i8 *)dest = tmp1; - - add x0,x0,0x1 // ++dest; - add x1,x1,0x1 // ++src; - sub x2,x2,0x1 // --num; - b .bytecp // goto bytecp; - -.done: // done:; - ret // return; - -.endfunc |