Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-21 Thread Daniel Engel
Hi Christophe, On Thu, Jan 21, 2021, at 2:29 AM, Christophe Lyon wrote: > On Sat, 16 Jan 2021 at 17:13, Daniel Engel wrote: > > > > Hi Christophe, > > > > On Fri, Jan 15, 2021, at 4:30 AM, Christophe Lyon wrote: > > > On Fri, 15 Jan 2021 at 12:39, Dan

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-25 Thread Daniel Engel
> > > --snip-- > > > > > > If the test server farm is free at some point, would you mind running > > > another set of regression tests on my v5 patch series? > > > > Sure. Given the number of sub-patches, can you send it to me as a > > single patch file > > (git format) that I can directly apply to

[PATCH v7 00/34] libgcc: Thumb-1 Floating-Point Assembly for Cortex M0

2022-10-31 Thread Daniel Engel
0.5 ulp __aeabi_h2f 34+__shared_float 34 8 exact __aeabi_f2h 84 23..34 0 <= 0.5 ulp Copyright assignment is on file with the FSF. Thanks, Daniel Engel [1] // Test program for size comparison extern i

[PATCH v7 01/34] Add and restructure function declaration macros

2022-10-31 Thread Daniel Engel
the CFI_* macros earlier in the file scope will increase their scope for use in additional functions. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/lib1funcs.S: (LLSYM): New macro prefix ".L" for strippable local symbols. (CFI_START_FUNCTION, CFI_END_F

[PATCH v7 04/34] Reorganize LIB1ASMFUNCS object wrapper macros

2022-10-31 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/t-elf (LIB1ASMFUNCS): Split macros into logical groups. --- libgcc/config/arm/t-elf | 66 + 1 file changed, 53

[PATCH v7 07/34] Refactor 'ctz' functions into a new file

2022-10-31 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/lib1funcs.S (__ctzsi2): Moved to ... * config/arm/ctz2.S: New file. --- libgcc/config/arm/ctz2.S | 86 +++ libgcc

[PATCH v7 06/34] Refactor 'clz' functions into a new file

2022-10-31 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/lib1funcs.S (__clzsi2i, __clzdi2): Moved to ... * config/arm/clz2.S: New file. --- libgcc/config/arm/clz2.S | 145

[PATCH v7 02/34] Rename THUMB_FUNC_START to THUMB_FUNC_ENTRY

2022-10-31 Thread Daniel Engel
age of ".force_thumb" and ".thumb_func" is now tightly coupled throughout the "arm" subdirectory. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/lib1funcs.S: (THUMB_FUNC_START): Renamed to ... (THUMB_FUNC_ENTRY): for consistency; also add

[PATCH v7 05/34] Add the __HAVE_FEATURE_IT and IT() macros

2022-10-31 Thread Daniel Engel
code comments for limitations and expecated usage. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel (__HAVE_FEATURE_IT, IT): New macros. --- libgcc/config/arm/lib1funcs.S | 68 +++ 1 file changed, 68 insertions(+) diff --git a/libgcc/config/arm/lib1funcs.S b/l

[PATCH v7 15/34] Import 'popcnt' functions from the CM0 library

2022-10-31 Thread Daniel Engel
The functional overlap between the single- and double-word functions makes this implementation about 30% smaller than the C functions if both functions are linked together in the same appliation. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/popcnt.S (__popcountsi

[PATCH v7 08/34] Refactor 64-bit shift functions into a new file

2022-10-31 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/lib1funcs.S (__ashldi3, __ashrdi3, __lshldi3): Moved to ... * config/arm/eabi/lshift.S: New file. --- libgcc/config/arm/eabi/lshift.S | 123

[PATCH v7 03/34] Fix syntax warnings on conditional instructions

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/lib1funcs.S (RETLDM, ARM_DIV_BODY, ARM_MOD_BODY, _interwork_call_via_lr): Moved condition code after the flags update specifier "s". (ARM_FUNC_START, THUMB_LDIV0): Removed redundant ".synta

[PATCH v7 09/34] Import 'clz' functions from the CM0 library

2022-10-31 Thread Daniel Engel
improves Thumb performance without affecting ARM performance. Finally, this version adds a new __OPTIMIZE_SIZE__ build option (binary search loop). There is no change to the code for architectures with __ARM_FEATURE_CLZ. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bits/clz2.S

[PATCH v7 17/34] Import 64-bit comparison from CM0 library

2022-10-31 Thread Daniel Engel
These are 2-5 instructions smaller and just as fast. Branches are minimized, which will allow easier adaptation to Thumb-2/ARM mode. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/lcmp.S (__aeabi_lcmp, __aeabi_ulcmp): Replaced; add macro configuration to build

[PATCH v7 10/34] Import 'ctz' functions from the CM0 library

2022-10-31 Thread Daniel Engel
__ARM_FEATURE_CLZ have always returned 32, so this change makes the return value consistent. This change costs 2 extra instructions (branchless). Likewise on architectures with __ARM_FEATURE_CLZ, __ctzdi2(0) now returns 64 instead of 31. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config

[PATCH v7 11/34] Import 64-bit shift functions from the CM0 library

2022-10-31 Thread Daniel Engel
yright (C) 2018-2022 Free Software Foundation, Inc. + Contributed by Daniel Engel, Senva Inc (g...@danielengel.com) -This file is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[PATCH v7 18/34] Merge Thumb-2 optimizations for 64-bit comparison

2022-10-31 Thread Daniel Engel
This effectively merges support for all architecture variants into a common function path with appropriate build conditions. ARM performance is 1-2 instructions faster; Thumb-2 is about 50% faster. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi.S (__aeabi_lcmp

[PATCH v7 13/34] Import 'ffs' functions from the CM0 library

2022-10-31 Thread Daniel Engel
This implementation provides an efficient tail call to __clzdi2(), making the functions rather smaller and faster than the C versions. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bits/ctz2.S (__ffssi2, __ffsdi2): New functions. * config/arm/t-elf (LIB1ASMFUNCS

[PATCH v7 12/34] Import 'clrsb' functions from the CM0 library

2022-10-31 Thread Daniel Engel
This implementation provides an efficient tail call to __clzsi2(), making the functions rather smaller and faster than the C versions. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bits/clz2.S (__clrsbsi2, __clrsbdi2): Added new functions. * config/arm/t-elf

[PATCH v7 16/34] Refactor Thumb-1 64-bit comparison into a new file

2022-10-31 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_lcmp, __aeabi_ulcmp): Moved to ... * config/arm/eabi/lcmp.S: New file. * config/arm/lib1funcs.S: #include eabi/lcmp.S

[PATCH v7 21/34] Import 64-bit division from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi.c: Deleted unused file. * config/arm/eabi/ldiv.S (__aeabi_ldivmod, __aeabi_uldivmod): Replaced wrapper functions with a complete implementation. * config/arm/t-bpabi (LIB2ADD_ST): Removed bpabi.c

[PATCH v7 14/34] Import 'parity' functions from the CM0 library

2022-10-31 Thread Daniel Engel
The functional overlap between the single- and double-word functions makes functions makes this implementation about half the size of the C functions if both functions are linked in the same application. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/parity.S: New file for

[PATCH v7 19/34] Import 32-bit division from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/idiv.S: New file for __udivsi3() and __divsi3(). * config/arm/lib1funcs.S: #include eabi/idiv.S (v6m only). --- libgcc/config/arm/eabi/idiv.S | 299 ++ libgcc/config/arm/lib1funcs.S

[PATCH v7 22/34] Import integer multiplication from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/lmul.S: New file for __muldi3(), __mulsidi3(), and __umulsidi3(). * config/arm/lib1funcs.S: #eabi/lmul.S (v6m only). * config/arm/t-elf: Add the new objects to LIB1ASMFUNCS. --- libgcc/config/arm

[PATCH v7 25/34] Refactor Thumb-1 float subtraction into a new file

2022-10-31 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_frsub): Moved to ... * config/arm/eabi/fadd.S: New file. * config/arm/lib1funcs.S: #include eabi/fadd.S (v6m only

[PATCH v7 24/34] Import float comparison from the CM0 library

2022-10-31 Thread Daniel Engel
OTE: It seems that the __aeabi_cfcmp*() routines formerly in bpabi-v6m.S were not well tested, as they returned wrong results for the 'C' flag. The replacement functions are fully tested. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/fcmp.S (__c

[PATCH v7 20/34] Refactor Thumb-1 64-bit division into a new file

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_ldivmod/ldivmod): Moved to ... * config/arm/eabi/ldiv.S: New file. * config/arm/lib1funcs.S: #include eabi/ldiv.S (v6m only). --- libgcc/config/arm/bpabi-v6m.S | 81

[PATCH v7 23/34] Refactor Thumb-1 float comparison into a new file

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_cfcmpeq, __aeabi_cfcmple, __aeabi_cfrcmple, __aeabi_fcmpeq, __aeabi_fcmple, aeabi_fcmple, __aeabi_fcmpgt, aeabi_fcmpge): Moved to ... * config/arm/eabi/fcmp.S: New file

[PATCH v7 26/34] Import float addition and subtraction from the CM0 library

2022-10-31 Thread Daniel Engel
size is still less than half the size of soft-float. gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/fadd.S (__addsf3, __subsf3): Added new functions. * config/arm/eabi/fneg.S (__negsf2): Added new file. * config/arm/eabi/futil.S (__fp_normalize2

[PATCH v7 33/34] Drop single-precision Thumb-1 soft-float functions

2022-10-31 Thread Daniel Engel
ir code path, so this choice leads to a size reduction in programs that use both functions.) gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/t-softfp (softfp_float_modes): Added as "df". --- libgcc/config/arm/t-softfp | 2 ++ 1 file changed, 2 insertions(+) d

[PATCH v7 27/34] Import float multiplication from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/fmul.S (__mulsf3): New file. * config/arm/lib1funcs.S: #include eabi/fmul.S (v6m only). * config/arm/t-elf (LIB1ASMFUNCS): Moved _mulsf3 to global scope (this object was previously blocked on v6m

[PATCH v7 28/34] Import float division from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/fdiv.S (__divsf3, __fp_divloopf): New file. * config/arm/lib1funcs.S: #include eabi/fdiv.S (v6m only). * config/arm/t-elf (LIB1ASMFUNCS): Added _divsf3 and _fp_divloopf. --- libgcc/config/arm/eabi/fdiv.S

[PATCH v7 31/34] Import float<->double conversion from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/fcast.S (__aeabi_d2f, __aeabi_f2d): New file. * config/arm/lib1funcs.S: #include eabi/fcast.S (v6m only). * config/arm/t-elf (LIB1ASMFUNCS): Added _arm_d2f and _arm_f2d. --- libgcc/config/arm/eabi/fcast.S

[PATCH v7 29/34] Import integer-to-float conversion from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi-lib.h (__floatdisf, __floatundisf): Remove obsolete RENAME_LIBRARY directives. * config/arm/eabi/ffloat.S (__aeabi_i2f, __aeabi_l2f, __aeabi_ui2f, __aeabi_ul2f): New file. * config/arm

[PATCH v7 30/34] Import float-to-integer conversion from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/bpabi-lib.h (muldi3): Removed duplicate. (fixunssfsi) Removed obsolete RENAME_LIBRARY directive. * config/arm/eabi/ffixed.S (__aeabi_f2iz, __aeabi_f2uiz, __aeabi_f2lz, __aeabi_f2ulz): New file

[PATCH v7 32/34] Import float<->__fp16 conversion from the CM0 library

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel * config/arm/eabi/fcast.S (__aeabi_h2f, __aeabi_f2h): Added functions. * config/arm/fp16 (__gnu_f2h_ieee, __gnu_h2f_ieee, __gnu_f2h_alternative, __gnu_h2f_alternative): Disable build for v6m multilibs. * config/arm/t

[PATCH v7 34/34] Add -mpure-code support to the CM0 functions.

2022-10-31 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2022-10-09 Daniel Engel Makefile.in (MPURE_CODE): New macro defines __PURE_CODE__. (gcc_compile): Appended MPURE_CODE. lib1funcs.S (FUNC_START_SECTION): Set flags for __PURE_CODE__. clz2.S (__clzsi2): Added -mpure-code compatible instructions

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-06 Thread Daniel Engel
--snip-- On Wed, Jan 6, 2021, at 9:05 AM, Richard Earnshaw wrote: > > Thanks for working on this, Daniel. > > This is clearly stage1 material, so we've got time for a couple of > iterations to sort things out. I appreciate your feedback. I had been hoping that with no regressions this might s

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-09 Thread Daniel Engel
On Thu, Jan 7, 2021, at 4:56 AM, Richard Earnshaw wrote: > On 07/01/2021 00:59, Daniel Engel wrote: > > --snip-- > > > > On Wed, Jan 6, 2021, at 9:05 AM, Richard Earnshaw wrote: > > > >> > >> Thanks for working on this, Daniel. > >> > &g

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-09 Thread Daniel Engel
On Sat, Jan 9, 2021, at 5:09 AM, Christophe Lyon wrote: > On Sat, 9 Jan 2021 at 13:27, Daniel Engel wrote: > > > > On Thu, Jan 7, 2021, at 4:56 AM, Richard Earnshaw wrote: > > > On 07/01/2021 00:59, Daniel Engel wrote: > > > > --snip-- > > > >

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-09 Thread Daniel Engel
On Sat, Jan 9, 2021, at 5:09 AM, Christophe Lyon wrote: > On Sat, 9 Jan 2021 at 13:27, Daniel Engel wrote: > > > > -- snip -- > > > > To reiterate what I said above, I intend to push forward and incorporate > > your current recommendations plus any further feedbac

Re: [PATCH v4 02/29] Refactor 'clz' functions into a new file.

2021-01-11 Thread Daniel Engel
On Mon, Jan 11, 2021, at 7:39 AM, Richard Earnshaw wrote: > On 11/01/2021 15:26, Richard Earnshaw wrote: > > On 11/01/2021 11:10, g...@danielengel.com wrote: > >> From: Daniel Engel > >> > >> gcc/libgcc/ChangeLog: > >> 2021-01-07 Daniel Engel

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-11 Thread Daniel Engel
On Mon, Jan 11, 2021, at 8:07 AM, Christophe Lyon wrote: > On Sat, 9 Jan 2021 at 14:09, Christophe Lyon > wrote: > > > > On Sat, 9 Jan 2021 at 13:27, Daniel Engel wrote: > > > > > > On Thu, Jan 7, 2021, at 4:56 AM, Richard Earnshaw wrote: > > &

Re: [PATCH v4 01/29] Add and organize macros.

2021-01-11 Thread Daniel Engel
On Mon, Jan 11, 2021, at 7:21 AM, Richard Earnshaw wrote: > Some initial comments. > > On 11/01/2021 11:10, g...@danielengel.com wrote: > > From: Daniel Engel > > > > These definitions facilitate subsequent patches in this series. > > > > gcc/libgcc

Re: [PATCH v4 05/29] Import replacement 'clz' functions from CM0 library

2021-01-11 Thread Daniel Engel
directly descended from lib1funcs.S. I just merged into !__ARM_FEATURE_CLZ. I think the trivial functions still have to exist within libgcc, even if the compiler doesn't call them. > On 11/01/2021 11:10, g...@danielengel.com wrote: > > From: Daniel Engel > > > > On architectures wi

[PATCH v5 01/33] Add and restructure function declaration macros

2021-01-15 Thread Daniel Engel
the CFI_* macros earlier in the file scope will increase their scope for use in additional functions. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/lib1funcs.S: (LLSYM): New macro prefix ".L" for strippable local symbols. (CFI_START_FUNCTION, CFI_END_F

[PATCH v5 00/33] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-15 Thread Daniel Engel
34 8 exact __aeabi_d2f 56+__shared_float 54..58 8 <= 0.5 ulp __aeabi_h2f 34+__shared_float 34 8 exact __aeabi_f2h 84 23..34 0 <= 0.5 ul

[PATCH v5 02/33] Rename THUMB_FUNC_START to THUMB_FUNC_ENTRY

2021-01-15 Thread Daniel Engel
age of ".force_thumb" and ".thumb_func" is now tightly coupled throughout the "arm" subdirectory. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/lib1funcs.S: (THUMB_FUNC_START): Renamed to ... (THUMB_FUNC_ENTRY): for consistency; also add

[PATCH v5 03/33] Fix syntax warnings on conditional instructions

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/lib1funcs.S (RETLDM, ARM_DIV_BODY, ARM_MOD_BODY, _interwork_call_via_lr): Moved condition code after the flags update specifier "s". (ARM_FUNC_START, THUMB_LDIV0): Removed redundant ".synta

[PATCH v5 04/33] Reorganize LIB1ASMFUNCS object wrapper macros

2021-01-15 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/t-elf (LIB1ASMFUNCS): Split macros into logical groups. --- libgcc/config/arm/t-elf | 66 + 1 file changed, 53

[PATCH v5 05/33] Add the __HAVE_FEATURE_IT and IT() macros

2021-01-15 Thread Daniel Engel
code comments for limitations and expecated usage. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel (__HAVE_FEATURE_IT, IT): New macros. --- libgcc/config/arm/lib1funcs.S | 68 +++ 1 file changed, 68 insertions(+) diff --git a/libgcc/config/arm/lib1funcs.S b/l

[PATCH v5 06/33] Refactor 'clz' functions into a new file

2021-01-15 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/lib1funcs.S (__clzsi2i, __clzdi2): Moved to ... * config/arm/clz2.S: New file. --- libgcc/config/arm/clz2.S | 145

[PATCH v5 07/33] Refactor 'ctz' functions into a new file

2021-01-15 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/lib1funcs.S (__ctzsi2): Moved to ... * config/arm/ctz2.S: New file. --- libgcc/config/arm/ctz2.S | 86 +++ libgcc

[PATCH v5 08/33] Refactor 64-bit shift functions into a new file

2021-01-15 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/lib1funcs.S (__ashldi3, __ashrdi3, __lshldi3): Moved to ... * config/arm/eabi/lshift.S: New file. --- libgcc/config/arm/eabi/lshift.S | 123

[PATCH v5 09/33] Import 'clz' functions from the CM0 library

2021-01-15 Thread Daniel Engel
improves Thumb performance without affecting ARM performance. Finally, this version adds a new __OPTIMIZE_SIZE__ build option (binary search loop). There is no change to the code for architectures with __ARM_FEATURE_CLZ. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bits/clz2.S

[PATCH v5 10/33] Import 'ctz' functions from the CM0 library

2021-01-15 Thread Daniel Engel
__ARM_FEATURE_CLZ have always returned 32, so this change makes the return value consistent. This change costs 2 extra instructions (branchless). Likewise on architectures with __ARM_FEATURE_CLZ, __ctzdi2(0) now returns 64 instead of 31. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config

[PATCH v5 11/33] Import 64-bit shift functions from the CM0 library

2021-01-15 Thread Daniel Engel
yright (C) 2018-2021 Free Software Foundation, Inc. + Contributed by Daniel Engel, Senva Inc (g...@danielengel.com) -This file is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[PATCH v5 12/33] Import 'clrsb' functions from the CM0 library

2021-01-15 Thread Daniel Engel
This implementation provides an efficient tail call to __clzsi2(), making the functions rather smaller and faster than the C versions. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bits/clz2.S (__clrsbsi2, __clrsbdi2): Added new functions. * config/arm/t-elf

[PATCH v5 13/33] Import 'ffs' functions from the CM0 library

2021-01-15 Thread Daniel Engel
This implementation provides an efficient tail call to __clzdi2(), making the functions rather smaller and faster than the C versions. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bits/ctz2.S (__ffssi2, __ffsdi2): New functions. * config/arm/t-elf (LIB1ASMFUNCS

[PATCH v5 14/33] Import 'parity' functions from the CM0 library

2021-01-15 Thread Daniel Engel
The functional overlap between the single- and double-word functions makes functions makes this implementation about half the size of the C functions if both functions are linked in the same application. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/parity.S: New file for

[PATCH v5 15/33] Import 'popcnt' functions from the CM0 library

2021-01-15 Thread Daniel Engel
The functional overlap between the single- and double-word functions makes this implementation about 30% smaller than the C functions if both functions are linked together in the same appliation. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/popcnt.S (__popcountsi

[PATCH v5 16/33] Refactor Thumb-1 64-bit comparison into a new file

2021-01-15 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_lcmp, __aeabi_ulcmp): Moved to ... * config/arm/eabi/lcmp.S: New file. * config/arm/lib1funcs.S: #include eabi/lcmp.S

[PATCH v5 17/33] Import 64-bit comparison from CM0 library

2021-01-15 Thread Daniel Engel
These are 2-5 instructions smaller and just as fast. Branches are minimized, which will allow easier adaptation to Thumb-2/ARM mode. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/eabi/lcmp.S (__aeabi_lcmp, __aeabi_ulcmp): Replaced; add macro configuration to build

[PATCH v5 18/33] Merge Thumb-2 optimizations for 64-bit comparison

2021-01-15 Thread Daniel Engel
This effectively merges support for all architecture variants into a common function path with appropriate build conditions. ARM performance is 1-2 instructions faster; Thumb-2 is about 50% faster. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi.S (__aeabi_lcmp

[PATCH v5 19/33] Import 32-bit division from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-07 Daniel Engel * config/arm/eabi/idiv.S: New file for __udivsi3() and __divsi3(). * config/arm/lib1funcs.S: #include eabi/idiv.S (v6m only). --- libgcc/config/arm/eabi/idiv.S | 299 ++ libgcc/config/arm/lib1funcs.S

[PATCH v5 20/33] Refactor Thumb-1 64-bit division into a new file

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_ldivmod/ldivmod): Moved to ... * config/arm/eabi/ldiv.S: New file. * config/arm/lib1funcs.S: #include eabi/ldiv.S (v6m only). --- libgcc/config/arm/bpabi-v6m.S | 81

[PATCH v5 21/33] Import 64-bit division from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi.c: Deleted unused file. * config/arm/eabi/ldiv.S (__aeabi_ldivmod, __aeabi_uldivmod): Replaced wrapper functions with a complete implementation. * config/arm/t-bpabi (LIB2ADD_ST): Removed bpabi.c

[PATCH v5 22/33] Import integer multiplication from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-07 Daniel Engel * config/arm/eabi/lmul.S: New file for __muldi3(), __mulsidi3(), and __umulsidi3(). * config/arm/lib1funcs.S: #eabi/lmul.S (v6m only). * config/arm/t-elf: Add the new objects to LIB1ASMFUNCS. --- libgcc/config/arm

[PATCH v5 23/33] Refactor Thumb-1 float comparison into a new file

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_cfcmpeq, __aeabi_cfcmple, __aeabi_cfrcmple, __aeabi_fcmpeq, __aeabi_fcmple, aeabi_fcmple, __aeabi_fcmpgt, aeabi_fcmpge): Moved to ... * config/arm/eabi/fcmp.S: New file

[PATCH v5 24/33] Import float comparison from the CM0 library

2021-01-15 Thread Daniel Engel
OTE: It seems that the __aeabi_cfcmp*() routines formerly in bpabi-v6m.S were not well tested, as they returned wrong results for the 'C' flag. The replacement functions are fully tested. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/eabi/fcmp.S (__c

[PATCH v5 25/33] Refactor Thumb-1 float subtraction into a new file

2021-01-15 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_frsub): Moved to ... * config/arm/eabi/fadd.S: New file. * config/arm/lib1funcs.S: #include eabi/fadd.S (v6m only

[PATCH v5 26/33] Import float addition and subtraction from the CM0 library

2021-01-15 Thread Daniel Engel
size is still less than half the size of soft-float. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/eabi/fadd.S (__addsf3, __subsf3): Added new functions. * config/arm/eabi/fneg.S (__negsf2): Added new file. * config/arm/eabi/futil.S (__fp_normalize2

[PATCH v5 27/33] Import float multiplication from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/eabi/fmul.S (__mulsf3): New file. * config/arm/lib1funcs.S: #include eabi/fmul.S (v6m only). * config/arm/t-elf (LIB1ASMFUNCS): Moved _mulsf3 to global scope (this object was previously blocked on v6m

[PATCH v5 28/33] Import float division from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-08 Daniel Engel * config/arm/eabi/fdiv.S (__divsf3, __fp_divloopf): New file. * config/arm/lib1funcs.S: #include eabi/fdiv.S (v6m only). * config/arm/t-elf (LIB1ASMFUNCS): Added _divsf3 and _fp_divloopf. --- libgcc/config/arm/eabi/fdiv.S

[PATCH v5 29/33] Import integer-to-float conversion from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-lib.h (__floatdisf, __floatundisf): Remove obsolete RENAME_LIBRARY directives. * config/arm/eabi/ffloat.S (__aeabi_i2f, __aeabi_l2f, __aeabi_ui2f, __aeabi_ul2f): New file. * config/arm

[PATCH v5 31/33] Import float<->double conversion from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/eabi/fcast.S (__aeabi_d2f, __aeabi_f2d): New file. * config/arm/lib1funcs.S: #include eabi/fcast.S (v6m only). * config/arm/t-elf (LIB1ASMFUNCS): Added _arm_d2f and _arm_f2d. --- libgcc/config/arm/eabi/fcast.S

[PATCH v5 30/33] Import float-to-integer conversion from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-lib.h (muldi3): Removed duplicate. (fixunssfsi) Removed obsolete RENAME_LIBRARY directive. * config/arm/eabi/ffixed.S (__aeabi_f2iz, __aeabi_f2uiz, __aeabi_f2lz, __aeabi_f2ulz): New file

[PATCH v5 33/33] Drop single-precision Thumb-1 soft-float functions

2021-01-15 Thread Daniel Engel
ir code path, so this choice leads to a size reduction in programs that use both functions.) gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/t-softfp (softfp_float_modes): Added as "df". --- libgcc/config/arm/t-softfp | 2 ++ 1 file changed, 2 insertions(+) d

[PATCH v5 32/33] Import float<->__fp16 conversion from the CM0 library

2021-01-15 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/eabi/fcast.S (__aeabi_h2f, __aeabi_f2h): Added functions. * config/arm/fp16 (__gnu_f2h_ieee, __gnu_h2f_ieee, __gnu_f2h_alternative, __gnu_h2f_alternative): Disable build for v6m multilibs. * config/arm/t

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-15 Thread Daniel Engel
Hi Christophe, On Mon, Jan 11, 2021, at 8:39 AM, Christophe Lyon wrote: > On Mon, 11 Jan 2021 at 17:18, Daniel Engel wrote: > > > > On Mon, Jan 11, 2021, at 8:07 AM, Christophe Lyon wrote: > > > On Sat, 9 Jan 2021 at 14:09, Christophe Lyon > > > wrote: > &g

Re: [PATCH v3] libgcc: Thumb-1 Floating-Point Library for Cortex M0

2021-01-16 Thread Daniel Engel
Hi Christophe, On Fri, Jan 15, 2021, at 4:30 AM, Christophe Lyon wrote: > On Fri, 15 Jan 2021 at 12:39, Daniel Engel wrote: > > > > Hi Christophe, > > > > On Mon, Jan 11, 2021, at 8:39 AM, Christophe Lyon wrote: > > > On Mon, 11 Jan 2021 at 17:18, Daniel Engel

[PING] Re: [PATCH v7 00/34] libgcc: Thumb-1 Floating-Point Assembly for Cortex M0

2022-11-15 Thread Daniel Engel
Hello, Is there still any interest in merging this patch? Thanks, Daniel On Mon, Oct 31, 2022, at 8:44 AM, Daniel Engel wrote: > Hi Richard, > > I am re-submitting my libgcc patch from 2021: > > https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563585.html > h

[PATCH v6 00/34] libgcc: Thumb-1 Floating-Point Assembly for Cortex M0

2021-12-27 Thread Daniel Engel
56+__shared_float 54..58 8 <= 0.5 ulp __aeabi_h2f 34+__shared_float 34 8 exact __aeabi_f2h 84 23..34 0 <= 0.5 ulp Copyright assignment is on file with the FSF. Thanks,

[PATCH v6 01/34] Add and restructure function declaration macros

2021-12-27 Thread Daniel Engel
the CFI_* macros earlier in the file scope will increase their scope for use in additional functions. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/lib1funcs.S: (LLSYM): New macro prefix ".L" for strippable local symbols. (CFI_START_FUNCTION, CFI_END_F

[PATCH v6 02/34] Rename THUMB_FUNC_START to THUMB_FUNC_ENTRY

2021-12-27 Thread Daniel Engel
age of ".force_thumb" and ".thumb_func" is now tightly coupled throughout the "arm" subdirectory. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/lib1funcs.S: (THUMB_FUNC_START): Renamed to ... (THUMB_FUNC_ENTRY): for consistency; also add

[PATCH v6 03/34] Fix syntax warnings on conditional instructions

2021-12-27 Thread Daniel Engel
gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/lib1funcs.S (RETLDM, ARM_DIV_BODY, ARM_MOD_BODY, _interwork_call_via_lr): Moved condition code after the flags update specifier "s". (ARM_FUNC_START, THUMB_LDIV0): Removed redundant ".synta

[PATCH v6 04/34] Reorganize LIB1ASMFUNCS object wrapper macros

2021-12-27 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel * config/arm/t-elf (LIB1ASMFUNCS): Split macros into logical groups. --- libgcc/config/arm/t-elf | 66 + 1 file changed, 53

[PATCH v6 05/34] Add the __HAVE_FEATURE_IT and IT() macros

2021-12-27 Thread Daniel Engel
code comments for limitations and expecated usage. gcc/libgcc/ChangeLog: 2021-01-14 Daniel Engel (__HAVE_FEATURE_IT, IT): New macros. --- libgcc/config/arm/lib1funcs.S | 68 +++ 1 file changed, 68 insertions(+) diff --git a/libgcc/config/arm/lib1funcs.S b/l

[PATCH v6 06/34] Refactor 'clz' functions into a new file

2021-12-27 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/lib1funcs.S (__clzsi2i, __clzdi2): Moved to ... * config/arm/clz2.S: New file. --- libgcc/config/arm/clz2.S | 145

[PATCH v6 07/34] Refactor 'ctz' functions into a new file

2021-12-27 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/lib1funcs.S (__ctzsi2): Moved to ... * config/arm/ctz2.S: New file. --- libgcc/config/arm/ctz2.S | 86 +++ libgcc

[PATCH v6 08/34] Refactor 64-bit shift functions into a new file

2021-12-27 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/lib1funcs.S (__ashldi3, __ashrdi3, __lshldi3): Moved to ... * config/arm/eabi/lshift.S: New file. --- libgcc/config/arm/eabi/lshift.S | 123

[PATCH v6 09/34] Import 'clz' functions from the CM0 library

2021-12-27 Thread Daniel Engel
improves Thumb performance without affecting ARM performance. Finally, this version adds a new __OPTIMIZE_SIZE__ build option (binary search loop). There is no change to the code for architectures with __ARM_FEATURE_CLZ. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bits/clz2.S

[PATCH v6 10/34] Import 'ctz' functions from the CM0 library

2021-12-27 Thread Daniel Engel
__ARM_FEATURE_CLZ have always returned 32, so this change makes the return value consistent. This change costs 2 extra instructions (branchless). Likewise on architectures with __ARM_FEATURE_CLZ, __ctzdi2(0) now returns 64 instead of 31. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config

[PATCH v6 11/34] Import 64-bit shift functions from the CM0 library

2021-12-27 Thread Daniel Engel
yright (C) 2018-2021 Free Software Foundation, Inc. + Contributed by Daniel Engel, Senva Inc (g...@danielengel.com) -This file is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[PATCH v6 12/34] Import 'clrsb' functions from the CM0 library

2021-12-27 Thread Daniel Engel
This implementation provides an efficient tail call to __clzsi2(), making the functions rather smaller and faster than the C versions. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bits/clz2.S (__clrsbsi2, __clrsbdi2): Added new functions. * config/arm/t-elf

[PATCH v6 13/34] Import 'ffs' functions from the CM0 library

2021-12-27 Thread Daniel Engel
This implementation provides an efficient tail call to __clzdi2(), making the functions rather smaller and faster than the C versions. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bits/ctz2.S (__ffssi2, __ffsdi2): New functions. * config/arm/t-elf (LIB1ASMFUNCS

[PATCH v6 14/34] Import 'parity' functions from the CM0 library

2021-12-27 Thread Daniel Engel
The functional overlap between the single- and double-word functions makes functions makes this implementation about half the size of the C functions if both functions are linked in the same application. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/parity.S: New file for

[PATCH v6 15/34] Import 'popcnt' functions from the CM0 library

2021-12-27 Thread Daniel Engel
The functional overlap between the single- and double-word functions makes this implementation about 30% smaller than the C functions if both functions are linked together in the same appliation. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/popcnt.S (__popcountsi

[PATCH v6 16/34] Refactor Thumb-1 64-bit comparison into a new file

2021-12-27 Thread Daniel Engel
This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_lcmp, __aeabi_ulcmp): Moved to ... * config/arm/eabi/lcmp.S: New file. * config/arm/lib1funcs.S: #include eabi/lcmp.S

[PATCH v6 17/34] Import 64-bit comparison from CM0 library

2021-12-27 Thread Daniel Engel
These are 2-5 instructions smaller and just as fast. Branches are minimized, which will allow easier adaptation to Thumb-2/ARM mode. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/eabi/lcmp.S (__aeabi_lcmp, __aeabi_ulcmp): Replaced; add macro configuration to build

  1   2   >