Slight inefficiencies in the code generated by HLA

Started by ms, June 10, 2005, 02:15:53 AM

Previous topic - Next topic

ms

Inspecting the code generated (masm code, hla v1.76 b9933) I found things like:

a) useless jumps:     jmp   L1808_endif__hla_
Example:
      jmp   L1806_exitloop__hla_   ;/* break*/
      jmp   L1808_endif__hla_       ;<------- can be eliminated

L1808_false__hla_:
      cmp   al, 05dh   ;/* ']' */
      jne   L1811_false__hla_
      mov   al, 0
      mov   byte ptr [L1736_FN__hla_+edi+0], al   ;/* FN */
      inc   ecx
      jmp   L1806_exitloop__hla_   ;/* break*/
      jmp   L1808_endif__hla_

L1811_false__hla_:
      mov   byte ptr [L1736_FN__hla_+edi+0], al   ;/* FN */
------------------------------------------------
b) Jump that points to another jump: jmp   L1759_endif__hla_
Example:

L1760_false__hla_:
      xor   eax, eax
      mov   al, byte ptr [L1735_R2Buff__hla_+esi+0]
L1760_endif__hla_:
      jmp   L1759_endif__hla_        ;<-- can be replaced with:  jmp L1758_endif__hla_

L1759_false__hla_:
      mov   al, 255
L1759_endif__hla_:
      jmp   L1758_endif__hla_

L1758_false__hla_:
      mov   al, byte ptr [L1735_R2Buff__hla_+esi+0]
L1758_endif__hla_:
      ret
xL1757_GetChar__hla___hla_:
L1757_GetChar__hla_ endp
------------------------------------------------
Is there a way to avoid this ??

I appreciate the tremendous amount of work that goes in a product like
HLA, and I consider those problems very small.


Randall Hyde

Quote from: ms on June 10, 2005, 02:15:53 AM
Inspecting the code generated (masm code, hla v1.76 b9933) I found things like:

------------------------------------------------
Is there a way to avoid this ??

I appreciate the tremendous amount of work that goes in a product like
HLA, and I consider those problems very small.

Optimization (of issues like this) is slated for HLA v3.0. As soon as I get HLA v2.0 operational and get the ports to various OSes working, then I'll immediately begin work on v3.0 (i.e., there won't be the time lag that has existed between v1.x and 2.0). Of course, I've still got a lot of work to do on v2.0.... :'(
Cheers,
Randy Hyde