@Seenkao the tasks are about optimizing the output of FPC.
Это не даёт ни какого понимания чего вы хотите.
Если вы хотите чтоб написали оптимизатор подобных реализаций используя FPC, то просто не используйте данные решения, которые вы предоставили.
Если более глобально рассматривать, то просто разверните циклы. Если вам нужны не такие значения которые вы писали изначально и разворачивание циклов будет достаточно сложным, то тут нужны будут алгоритмы, которые будут учитывать количество приходящих циклов и оптимизировать в зависимости от этого (это кстати очень древние оптимизации, написаны они наверно ещё в прошлом веке).
Если же вы хотите, чтоб компилятор делал необходимые оптимизации, то думаю стоит обратиться к разработчикам FPC, а не как не ко всему форуму. Я могу показать как должен выглядеть конечный ассемблерный код, а разработчики FPC могут его применить, по необходимости и если он им подойдёт.
Gogle translate:
This does not give any understanding of what you want.
If you want to write an optimizer for such implementations using FPC, then simply do not use the solutions you provided.
If you consider it more globally, then simply unroll the cycles. If you do not need the values that you wrote initially and unrolling the cycles will be quite complex, then you will need algorithms that will take into account the number of incoming cycles and optimize depending on this (by the way, these are very ancient optimizations, they were probably written in the last century).
If you want the compiler to make the necessary optimizations, then I think it is worth contacting the FPC developers, and not the entire forum. I can show what the final assembler code should look like, and the FPC developers can use it, if necessary and if it suits them.
For a specific cpu, because on arm it already does not need such micro optimizations that you ask for.
It is highly debatable, since there are already too many assembler optimizations on the i386 and x86_64 platforms to take the compiler serious for that platform.
You should ask for pure pascal.
Не надо вводить в заблуждение людей. Я специально писал
fast_StrToInt, чтобы показать что оптимизировать можно многие задачи. Я так же написал
fast_StrToInt на ассемблере (
посмотреть можно здесь), и я могу с большой уверенностью сказать что ассемблерная версия для процессоров ARM работает быстрее, чем моя же Паскалевская версия (а моя Паскалевская версия, в большинстве случаев работает быстрее, чем стандартная версия).
Оптимизация нужна везде. Просто нужно помнить, что многое оптимизировали уже до нас, а в особенности циклы.
Google translate:
Don't mislead people. I specifically wrote
fast_StrToInt to show that many tasks can be optimized. I also wrote
fast_StrToInt in assembler (
you can see it here), and I can say with great confidence that the assembler version for ARM processors works faster than my Pascal version (and my Pascal version, in most cases, works faster than the standard version).
Optimization is needed everywhere. You just need to remember that many things have already been optimized before us, especially cycles.
------------------------------------------------------------------
I apologize if you thought I was being rude. I use a translator, I don't know English well yet.