Author Topic: The Optimization Compilation  (Read 95756 times)

0 Members and 1 Guest are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: The Optimization Compilation
« Reply #105 on: October 21, 2011, 09:03:55 pm »
also, i think 'number less than 256' /256 might be more efficient than just 0
Actually no, both of those are 3 bytes. But 'number less than 256' and 0 is only 2 bytes and it does the same thing :)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: The Optimization Compilation
« Reply #106 on: November 11, 2011, 10:37:46 pm »
I'm going to see how many bytes I can save now.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: The Optimization Compilation
« Reply #107 on: January 04, 2012, 04:09:47 pm »
Currently, is this tutorial efficient yet ?
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: The Optimization Compilation
« Reply #108 on: January 04, 2012, 04:18:09 pm »
Umm it's a little outdated atm, though much of it is still OK.
Axe's peephole optimizer removes the need for things like
Code: [Select]
If A+1->A instead of
Code: [Select]
A+1->A
If A
Also DispGraph is just as fast as DispGraphr
I'm planning to sit down sometime in the near future and update this a bit

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: The Optimization Compilation
« Reply #109 on: January 04, 2012, 05:12:12 pm »
Done.

For those of you who don't want to scan through, I've made a list of most of the new additions/changes
  • The HL section is quasi-obsolete
  • DispGraphr is no longer faster than DispGraph
  • The !If A xor EXP structure is now better than the !If A - EXP unless you are using an optimized addition/subrtraction
  • When storing 0 to a 1 byte variable, and 0-> is better than 0->
  • I linked to Runer's index thread as well as stole the math opts table from him to be included here.
  • Otherwise cleaned up and reformatted

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: The Optimization Compilation
« Reply #110 on: January 04, 2012, 05:28:37 pm »
the 'and 0->' code only works if HL is less than 256

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: The Optimization Compilation
« Reply #111 on: January 04, 2012, 10:39:41 pm »
Hm, I thought that it doesn't matter because you're only storing the least significant byte into wherever you're storing?

Also I need to add stuff on the Select() command...Maybe later :P Edit: hm, and I want to discuss the structure of loops utilizing addition in place of mulitplication...So much to do so little time D:
« Last Edit: January 04, 2012, 10:47:00 pm by squidgetx »

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: The Optimization Compilation
« Reply #112 on: January 10, 2012, 02:42:18 pm »
Is there a way to make the inData() trick work with pointers and/or 16-bit numbers?  If used erroneously will it mess up to the point of a crash?

Edit: or is there a different way now with the newer versions of Axe? :P
« Last Edit: January 10, 2012, 02:42:58 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: The Optimization Compilation
« Reply #113 on: January 10, 2012, 07:50:29 pm »
Well it really depends on the circumstances...
As far as 16bit numbers, I don't know for sure but I think not...
And what do you mean 'with pointers'?

Wow I'm so helpful. Haha but can you clarify a little bit?

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: The Optimization Compilation
« Reply #114 on: January 10, 2012, 09:22:37 pm »
Something like...
If inData({L1},Data(2,4,6,8,0))
..or maybe even...
If inData({L1}+1,Data(3,5,7,9,0))
Vy'o'us pleorsdti thl'e gjaemue

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: The Optimization Compilation
« Reply #115 on: January 14, 2012, 09:37:09 pm »
That should work (sorry for the late reply lol)

No harm in trying these things out yourself btw ;) haha

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: The Optimization Compilation
« Reply #116 on: January 14, 2012, 09:41:21 pm »
I try, but more often than not test programs work differently for me :P and half the time I try random ambitious code weird stuff happens XD
Vy'o'us pleorsdti thl'e gjaemue