aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/machine
AgeCommit message (Collapse)AuthorFilesLines
2020-01-21riscv: Map between ieeefp.h exception bits and RISC-V FCSR bitsKeith Packard1-3/+37
If we had architecture-specific exception bits, we could just set them to match the processor, but instead ieeefp.h is shared by all targets so we need to map between the public values and the register contents. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-01-21riscv: Add 'break' statements to fpsetround switchKeith Packard1-4/+4
This makes the fpsetround function actually do something rather than just return -1 due to the default 'fall-through' behavior of the switch statement. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-01-21riscv: Use current pseudo-instructions to access the FCSR registerKeith Packard1-2/+2
Use fscsr and frcsr to store and read the FCSR register instead of fssr and frsr. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-01-02Bump up release to 3.2.0 for yearly snapshotnewlib-snapshot-20200102newlib-3.2.0Jeff Johnston60-600/+600
2019-12-20Optimize setjmp/longjmp for moxie.Anthony Green1-86/+38
We don't need to save/restore every register -- just those we don't expect to be trashed by function calls.
2019-12-13Fix setjmp/longjmp for the moxie port.Anthony Green1-24/+47
These functions needs to save and restore the stack frame, because that's where the return address is stored.
2019-11-08Stash reent marker in upper bits of s1 on AMD GCNKwok Cheung Yeung1-10/+10
s[0:3] contain a descriptor used to set up the initial value of the stack, but only the lower 48 bits of s[0:1] are currently used. The reent marker is currently set in s3, but by stashing it in the upper 16 bits of s[0:1] instead, s3 can be freed up for other purposes.
2019-10-31Initial PRU port for libgloss and newlibDimitar Dimitrov8-2/+6298
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2019-10-09riscv/sys/fenv.h: Add missing extern for fe_dfl_env_pJoel Sherrill1-0/+2
2019-10-08Add patch from Joel Sherrill for i386 and x86_64 fenv supportJeff Johnston2-0/+171
2019-10-07Optimize epilogue sequence for architectures with POP interworking.Christos Gentsos2-0/+12
ARMv5 and above supports arm/thumb interworking using POP, so we can improve the exit sequence in this case.
2019-09-03riscv/include/fenv.h: Use shared fenv.h.Joel Sherrill1-42/+0
libc/include/fenv.h was a direct copy of this file.
2019-08-09Miscellaneous Makefile.in regeneratedJoel Sherrill2-11/+11
2019-08-02RISC-V: Fix header guard for sys/fenv.hKito Cheng1-3/+3
2019-06-27or1k: Avoid write outside setjmp buf & shrink bufMartin Erik Werner1-28/+28
Update the offsets used to save registers into the stejmp jmp_buf structure in order to: * Avoid writing the supervision register outside the buffer and thus clobbering something on the stack. Previously the supervision register was written at offset 124 while the buffer was of length 124. * Shrink the jmp_buf down to the size actually needed, by avoiding holes at the locations of omitted registers.
2019-06-27or1k: Correct longjmp return valueMartin Erik Werner1-1/+1
Invert equality check instruction to correct the return value handling in longjmp. The return value should be the value of the second argument to longjmp, unless the argument value was 0 in which case it should be 1. Previously, longjmp would set return value 1 if the second argument was non-zero, and 0 if it was 0, which was incorrect.
2019-06-07Fix __getreent stack calculations for AMD GCNJeff Johnston1-6/+6
From: Andrew Stubbs <ams@codesourcery.com> Fix a bug in which the high-part of 64-bit values are being corrupted, leading to erroneous stack overflow errors. The problem was only that the mixed-size calculations are being treated as signed when they should be unsigned.
2019-05-22RISC-V: Add size optimized memcpy, memmove, memset and strcmp.Jim Wilson8-2/+146
This patch adds implementations of memcpy, memmove, memset and strcmp optimized for size. The changes have been tested in riscv/riscv-gnu-toolchain by riscv-dejagnu with riscv-sim.exp/riscv-sim-nano.exp.
2019-04-15Implement reduced code size "tiny" printf and putsJozef Lawrynowicz6-428/+132
"tiny" printf is derived from _vfprintf_r in libc/stdio/nano-vfprintf.c. "tiny" puts has been implemented so that it just calls write, without any other processing. Support for buffering, reentrancy and streams has been removed from these functions to achieve reduced code size. This reduced code size implementation of printf and puts can be enabled in an application by passing "--wrap printf" and "--wrap puts" to the GNU linker. This will replace references to "printf" and "puts" in user code with "__wrap_printf" and "__wrap_puts" respectively. If there is no implementation of these __wrap* functions in user code, these "tiny" printf and puts implementations will be linked into the final executable. The wrapping mechanism is supposed to be invisible to the user: - A GCC wrapper option such as "-mtiny-printf" will be added to alias these wrap commands. - If the user is unaware of the "tiny" implementation, and chooses to implement their own __wrap_printf and __wrap_puts, their own implementation will be automatically chosen over the "tiny" printf and puts from the library. Newlib must be configured with --enable-newlib-nano-formatted-io for the "tiny" printf and puts functions to be built into the library. Code size reduction examples: printf("Hello World\n") baseline - msp430-elf-gcc gcc-8_3_0-release text data bss 5638 214 26 "tiny" puts enabled text data bss 714 90 20 printf("Hello %d\n", a) baseline - msp430-elf-gcc gcc-8_3_0-release text data bss 10916 614 28 "tiny" printf enabled text data bss 4632 280 20
2019-04-15Copy prerequisite file for "tiny" printf implementationJozef Lawrynowicz1-0/+661
Use newlib/libc/stdio/nano-vfprintf.c as baseline for tiny-printf.c
2019-03-25Add missing includes.Andrew Stubbs2-1/+2
These missing includes were causing build warnings, but also a real bug in which the "size" parameter to "write" was being passed in 32-bit, whereas it ought to be 64-bit. This led to intermittent bad behaviour.
2019-01-23Remove matherr, and SVID and X/Open math library configurationsJozef Lawrynowicz1-1/+1
Default math library configuration is now IEEE
2019-01-15AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com>Jeff Johnston14-2/+6603
Add support for the AMD GCN GPU architecture. This is primarily intended for use with OpenMP and OpenACC offloading. It can also be used for stand-alone programs, but this is intended mostly for testing the compiler and is not expected to be useful in general. The GPU architecture is highly parallel, and therefore Newlib must be configured to use dynamic re-entrancy, and thread-safe malloc. The only I/O available is a via a shared-memory interface provided by libgomp and the gcn-run tool included with GCC. At this time this is limited to stdout, argc/argv, and the return code.
2018-12-31Bump release to 3.1.0 for yearly snapshotnewlib-snapshot-20181231newlib-3.1.0Jeff Johnston58-580/+580
2018-11-08Fix issue with dst bias in memsetWilco Dijkstra1-0/+1
This patch fixes an issue in the previous memset loop change. If the zva size is >= 256 and there are more than 64 bytes left in the tail, we could enter the loop and thus need to rebias dst by 32 as well. Since no known CPUs use this size this can't be tested natively, so I've tested it on a simulator initialized with a large zva size. --
2018-11-06Adjust writeback in non-zero memsetWilco Dijkstra1-3/+3
This fixes an ineffiency in the non-zero memset. Delaying the writeback until the end of the loop is slightly faster on some cores - this shows ~5% performance gain on Cortex-A53 when doing large non-zero memsets. Tested against the GLIBC testsuite.
2018-10-11Move common <sys/dirent.h> content to <dirent.h>Sebastian Huber1-8/+0
Move common content of the various <sys/dirent.h> and the latest FreeBSD <dirent.h> to <dirent.h>. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-08-31Add --disable-newlib-fno-builtin to allow compilation without -fno-builtin ↵newlib-snapshot-20180831Jon Beniston58-120/+816
for smaller and faster code.
2018-08-29Use __inhibit_loop_to_libcall in all memset/memcpy implementationsKeith Packard9-2/+26
This macro selects a compiler option that disables recognition of common memset/memcpy patterns and converting those to direct memset/memcpy calls. Signed-off-by: Keith Packard <keithp@keithp.com>
2018-07-13strcmp.S: Improve performance for misaligned stringsSiddhesh Poyarekar1-11/+40
Replace the simple byte-wise compare in the misaligned case with a dword compare with page boundary checks in place. For simplicity I've chosen a 4K page boundary so that we don't have to query the actual page size on the system. This results in up to 3x improvement in performance in the unaligned case on falkor and about 2.5x improvement on mustang as measured using bench-strcmp in glibc.
2018-07-13memcmp.S: optimize for medium to large sizesSiddhesh Poyarekar1-44/+100
This improved memcmp provides a fast path for compares up to 16 bytes and then compares 16 bytes at a time, thus optimizing loads from both sources. The glibc memcmp microbenchmark retains performance (with an error of ~1ns) for smaller compare sizes and reduces up to 31% of execution time for compares up to 4K on the APM Mustang. On Qualcomm Falkor this improves to almost 48%, i.e. it is almost 2x improvement for sizes of 2K and above.
2018-07-13Improve strncmp for mutually misaligned inputsSiddhesh Poyarekar1-17/+79
The mutually misaligned inputs on aarch64 are compared with a simple byte copy, which is not very efficient. Enhance the comparison similar to strcmp by loading a double-word at a time. The peak performance improvement (i.e. 4k maxlen comparisons) due to this on the strncmp microbenchmark in glibc is as follows: falkor: 3.5x (up to 72% time reduction) cortex-a73: 3.5x (up to 71% time reduction) cortex-a53: 3.5x (up to 71% time reduction) All mutually misaligned inputs from 16 bytes maxlen onwards show upwards of 15% improvement and there is no measurable effect on the performance of aligned/mutually aligned inputs.
2018-04-13Add nvptx port.Jeff Johnston78-4/+7110
- From: Cesar Philippidis <cesar@codesourcery.com> Date: Tue, 10 Apr 2018 14:43:42 -0700 Subject: [PATCH] nvptx port This port adds support for Nvidia GPU's, which are primarily used as offload accelerators in OpenACC and OpenMP.
2018-01-31epiphany: Additional setjmp() and longjmp() symsSebastian Huber1-0/+4
At least with Binutils 2.30 and GCC 7.3 we need symbol definitions without the leading underscore. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-01-18Bump release to 3.0.0 for yearly snapshotnewlib-snapshot-20180118newlib-3.0.0Jeff Johnston57-572/+572
- major release required due to removal of K&R support
2018-01-17ansification: remove _HAVE_STDCYaakov Selkowitz9-36/+0
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _EXFUN, _EXFUN_NOTHROWYaakov Selkowitz3-47/+47
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _DEFUNYaakov Selkowitz56-146/+73
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _VOIDYaakov Selkowitz6-8/+8
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _DEFUN_VOIDYaakov Selkowitz4-4/+4
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _CAST_VOIDYaakov Selkowitz1-3/+3
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _PTRYaakov Selkowitz10-25/+25
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _PARAMSYaakov Selkowitz4-20/+20
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _CONSTYaakov Selkowitz38-78/+78
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _ANDYaakov Selkowitz40-84/+84
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-12-07makedoc: make errors visibleJon Turney1-3/+3
Discard QUICKREF sections, rather than writing them to stderr Discard MATHREF sections, rather than discarding as an error Pass NOTES sections through to texinfo, rather than discarding as an error Don't redirect makedoc stderr to .ref file Remove makedoc output on error Remove .ref files from CLEANFILES Regenerate Makefile.ins Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-12-01powerpc: remove TRAD_SYNOPSISYaakov Selkowitz8-231/+8
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-12-01nds32: remove TRAD_SYNOPSISYaakov Selkowitz1-5/+1
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-12-01microblaze: remove TRAD_SYNOPSISYaakov Selkowitz4-25/+4
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-08-21Change license to FreeBSD License for RISC-VKito Cheng12-12/+12
- For prevent confuse about what BSD license variant we used, 2- or 3-clause license, we change the license to FreeBSD license to make it unambiguously refers to the 2-clause license.