33 Commits

Author SHA1 Message Date
1159162e50 Change armv4t integer to string conversion to use an unrolled loop
This implementation also writes the digits from left to right instead of
right to left. Using this method we can write the string to the
beginning of the buffer and still avoid reversing the string. It also
has the benefit of being slightly slower than the previous
implementation. The function's signature changed as well because there
is no longer a reason to pass the buffer size or a pointer to output the
start of the string.
2024-03-25 17:13:29 -06:00
b00a52ea9b Add armv4t assembly macros for division by 10^x, x=[1,9] 2024-03-25 17:11:49 -06:00
f41a10939c Add architecture dependent declarations in utility.hpp and add
math/tostring helpers
2024-03-24 21:27:58 -06:00
c4d73a8fde Rename armv4t math macro file 2024-03-24 21:26:43 -06:00
bbb3c15002 Add armv4t assembly optimized integer to string conversion functions 2024-03-24 01:07:24 -06:00
2beab09f7d Add armv4t assembly optimized division and modulo by 10 2024-03-24 00:30:56 -06:00
dcb91bac19 Optimize string single character append
Now uses a specialized implementation instead of the append multiple
characters implementation. Useful for appending single characters to
string streams (ex. newline).
2024-03-21 20:35:22 -06:00
033f835c0c Add exceptions
Can't use std::exception because it dynamically allocates memory. This
implementation doesn't allocate memory, but also doesn't allow leaving
an exception message.
2024-03-13 00:36:58 -06:00
f394929e0a Add support for debug-build specific files 2024-03-12 00:40:02 -06:00
c8162e6974 Update CMakeLists.txt to use globbing, and support arch. dependent files
CONFIGURE_DEPENDS option was added in CMake v3.12. This option allows the
build system to automatically re-run CMake if the glob changes, solving the
major issue with globbing. May have a performance impact, but it should be
negligible compared to the time spent building.
2024-03-10 21:55:50 -06:00
9166710926 Implement istring replace, append, erase 2024-03-10 20:50:09 -06:00
754c0f6d68 Remove istring::append with template 2024-03-07 21:49:55 -07:00
25a0dab8ea Remove istring::push_back / istring::pop_back 2024-03-07 21:41:15 -07:00
d4b13b36f6 Implement istring comparison operators
Not thoroughly tested.
2024-03-07 21:29:44 -07:00
ef39d535e2 Remove iterators from string and string_view
Iterators could probably be implemented efficiently, but it is not a
priority at the moment. They are removed for the time being.
2024-03-07 19:38:00 -07:00
52d91aa752 Change istring to use string_view for the majority of its operations
The istring and string_view operators have identical implementations. By
changing the istring operators to cast to string_view and use that
implementation instead, the number of redundant implementations is
reduced. This does incurr a small performance penalty, around 15 cycles
when tested on the MGBA Gameboy Advance emulator (uses an armv7tdmi).
When compared to the time operations take, the performance difference is
negligible. Ex. An insertion with two 8 character strings takes around
450 cycles.
2024-03-07 16:28:18 -07:00
98d55c9869 Document istring::insert 2024-03-07 16:09:32 -07:00
c9f3a57cfb Implement istring::insert with given index and count 2024-03-07 16:07:21 -07:00
232808770f Implement string::copy and string_view::copy 2024-03-07 15:57:29 -07:00
f36d61330d Change string_view to use char_traits instead of custom strlen 2024-03-07 15:55:00 -07:00
236b5661ad Fix mtl_rmemcpy32 incorrectly calculating the number of bytes and words 2024-03-07 15:53:10 -07:00
c9091951f8 Fix incorrect memcpy 2024-03-07 14:44:17 -07:00
56ea8ad91d Change strings to use mtl::memmove instead of memcpy ot std::memmove 2024-03-07 14:32:46 -07:00
ecac9d2087 Change strings to use string_view instead of const char*
Because the length of a string_view is computed at compile time, it is
faster for simple copies.
2024-03-07 14:25:39 -07:00
913e54252a Add initial string_view implementation 2024-03-07 14:24:10 -07:00
80bff7ca5d Fix incorrect function name in fixed.hpp 2024-03-06 23:49:40 -07:00
34495b580b Add initial fixed point number implementation 2024-03-06 23:42:48 -07:00
f872bcc0c9 Add finite state machine header to cmake 2024-03-06 23:05:15 -07:00
be6de4e7e3 Add initial finite state machine implementation 2024-03-06 23:02:00 -07:00
dd07c57d7a Fix rmemcpy32 not copying chunks correctly 2024-03-06 23:00:38 -07:00
dd0e7e63e0 Fix incorrect paths in CMakeLists.txt 2024-03-04 20:56:36 -07:00
3f8bcf2f61 Add cmake files and initial memcpy/string implementation 2024-03-04 20:44:58 -07:00
aecbbbb7f6 Initial commit 2024-03-04 19:29:37 -07:00