Forum > Embedded - AVR

UnoLib - library in Pascal for Arduino Uno and ATMega328p

<< < (2/8) > >>

ackarwow:

--- Quote from: AlexTP on January 05, 2025, 04:07:02 pm ---- Float32Sinus
- Float32Cosinus

in English it spells like Sine/Cosine, AFAIK.

--- End quote ---

Thanks, @AlexTP. Yes, we used Latin convention ;) We will fix it.

ccrause:
Comment regarding:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure Cli; assembler;asm  CLIend;
This code cannot be inlined even in the development version of the compiler. This means that each use of Cli will add a call and a ret instruction.

The alternative is:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses  intrinsics;...  avr_cli;
Here the compiler will directly insert the cli instruction, avoiding the call overhead.

ackarwow:

--- Quote from: ccrause on January 06, 2025, 07:42:54 am ---Comment regarding:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure Cli; assembler;asm  CLIend;
This code cannot be inlined even in the development version of the compiler. This means that each use of Cli will add a call and a ret instruction.

The alternative is:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses  intrinsics;...  avr_cli;
Here the compiler will directly insert the cli instruction, avoiding the call overhead.

--- End quote ---

@ccrause
Thank you for this tip. It will be very useful for optimization of UnoLib.

VisualLab:

--- Quote from: ackarwow on January 05, 2025, 04:27:02 pm ---
--- Quote from: AlexTP on January 05, 2025, 04:07:02 pm ---- Float32Sinus
- Float32Cosinus

in English it spells like Sine/Cosine, AFAIK.

--- End quote ---

Thanks, @AlexTP. Yes, we used Latin convention ;) We will fix it.

--- End quote ---

Or maybe you will use suffixes like these functions have in the Math module? I.e.: Sin, Cos, Tan, Cot, Sec, Csc. Then the appropriate function names could be: Float32Sin, Float32Cos, Float32Tan, etc.

This would also follow the convention used in many libraries (and even some spreadsheets).

ackarwow:

--- Quote from: VisualLab on January 06, 2025, 04:28:53 pm ---
--- Quote from: ackarwow on January 05, 2025, 04:27:02 pm ---
--- Quote from: AlexTP on January 05, 2025, 04:07:02 pm ---- Float32Sinus
- Float32Cosinus

in English it spells like Sine/Cosine, AFAIK.

--- End quote ---

Thanks, @AlexTP. Yes, we used Latin convention ;) We will fix it.

--- End quote ---

Or maybe you will use suffixes like these functions have in the Math module? I.e.: Sin, Cos, Tan, Cot, Sec, Csc. Then the appropriate function names could be: Float32Sin, Float32Cos, Float32Tan, etc.

This would also follow the convention used in many libraries (and even some spreadsheets).

--- End quote ---

@VisualLab
Thank you for comment. Yes, I have modified these names using this convention. Moreover - now there is possibility to select function(s) to test.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version