* as/link/lkar.h: sgetl and sputl are independent of endianness
[fw/sdcc] / doc / choices.txt
index fd6cbab859d01cca36a164247512711ee00c6bab..1442eca452e5bed8306897b5062f5c87fce84d0b 100644 (file)
@@ -192,3 +192,51 @@ Pending optimisations:
         ...
         push    iTemp4
 
+Swaps:
+        ld      hl,bc           ; 8
+        ld      bc,de           ; 8
+        ld      de,hl           ; 8
+
+vs
+        push    bc             ; 11
+        ld      bc,de           ; 8
+        pop     de              ; 11
+
+Swaps 2:
+        ld      a,h
+        ld      h,b
+        ld      b,a
+        ld      a,l
+        ld      l,c
+        ld      c,aq            ; 6*4 = 24
+
+Cleaning up the arguments to a call:
+         ld     iy,#n           ; 14
+         add    iy,sp           ; 15
+         ld     sp,iy           ; 10 = 39
+
+         pop    af              ; 5/byte
+
+
+So for 8 bytes and above use the first form.
+
+Pointer assign:
+        ld      hl,bc           ; 4+4
+        ld      e,(hl)          ; 7
+        inc     hl              ; 6
+        ld      d,(hl)          ; 7
+
+vs:
+        ld      a,(bc)          ; 7
+        ld      e,a             ; 4
+        inc     bc              ; 6
+        ld      a,(bc)          ; 7
+        ld      d,a             ; 4
+
+Same cost.  Not worth it, although is does free up HL.
+
+Shift left signed on HL
+      sla  l
+      rl   h                    ; 8+8 = 16
+
+      add  hl,hl                ; 11