Convert _time_t_to_tm to asm

46 bytes size gain, -8% cycles on the unit tests
This commit is contained in:
Colin Leroy-Mira
2024-01-09 21:28:37 +01:00
parent 8aa59e4af3
commit 348a9048b7
3 changed files with 135 additions and 67 deletions

View File

@@ -65,7 +65,8 @@ static const unsigned MonthDays [] = {
/* Code */
/*****************************************************************************/
/* use statics for size optimisation (~34 bytes) */
#pragma static-locals(push, on)
time_t __fastcall__ mktime (register struct tm* TM)
/* Make a time in seconds since 1/1/1970 from the broken down time in TM.
@@ -74,8 +75,8 @@ time_t __fastcall__ mktime (register struct tm* TM)
*/
{
register div_t D;
static int Max;
static unsigned DayCount;
int Max;
unsigned DayCount;
/* Check if TM is valid */
if (TM == 0) {
@@ -182,3 +183,5 @@ time_t __fastcall__ mktime (register struct tm* TM)
((unsigned) TM->tm_sec) -
_tz.timezone;
}
#pragma static-locals(pop)