Author Topic: Features Wishlist  (Read 691607 times)

0 Members and 5 Guests are viewing this topic.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #3255 on: October 07, 2013, 10:22:56 am »
I just realized that bitshifting a var down one is equivalent to var>1. Is there a way this optimization could find its way into Axe?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3256 on: October 07, 2013, 01:26:31 pm »
Can you clarify what you mean, perhaps showing it in code and how it should be optimized?

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Features Wishlist
« Reply #3257 on: October 07, 2013, 03:52:38 pm »
Well, that's basically var/2. And it only works on unsigned values so it can't be an auto opt.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #3258 on: October 07, 2013, 10:09:35 pm »
Instead of doing
Code: [Select]
I>1 or
Code: [Select]
I>=2, you can do
Code: [Select]
I/2 which is already auto-opted to a bitshift; could the other two functions be added to the auto-opts? It also works for other powers of two.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3259 on: October 07, 2013, 10:15:23 pm »
But those return completely different things..?

I realize that in the context of a conditional like If I>1, dividing by 2 will result in the same conditional branch being followed, but people can use it in computations as well. If you want the optimization in the context of conditionals and understand the different return value, you can always do it manually. :P Axe doesn't really have great capability to perform context-sensitive optimizations that only trigger in certain scenarios. I don't think the peephole optimizer's current state (the system that seems like would be responsible for such an optimization) could even support making this optimization only in if statements.
« Last Edit: October 07, 2013, 10:19:19 pm by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Features Wishlist
« Reply #3260 on: October 08, 2013, 05:18:42 am »
A good example of why this would break down is that you could no longer do things like If (I>1) and (A=2), since the 'and' operator is bitwise instead of boolean the conditional would never pass if I is 4 for instance.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Features Wishlist
« Reply #3261 on: October 08, 2013, 11:45:18 am »
Well, ? and ?? should be used for conditionals anyway.
By the way, nice to see you here Builderboy ! :D

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Features Wishlist
« Reply #3262 on: October 08, 2013, 01:22:28 pm »
Well, ? and ?? should be used for conditionals anyway.
That doesn't mean you can't put optimizations within this kind of "blocks". For example, if you want to store 1 in D when B>1 and don't touch it otherwise, you can do B>1?→D.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Features Wishlist
« Reply #3263 on: October 08, 2013, 01:29:20 pm »
I was just telling BB that ?? and ? were better than or and and. ;) I know about this kind of HL abuse, it's pretty awesome. :D
And I personally believe that it just shouldn't auto opt >1 to /2 because of what Hayleia said.
« Last Edit: October 08, 2013, 01:31:11 pm by Streetwalker »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Features Wishlist
« Reply #3264 on: October 08, 2013, 02:06:10 pm »
A good example of why this would break down is that you could no longer do things like If (I>1) and (A=2), since the 'and' operator is bitwise instead of boolean the conditional would never pass if I is 4 for instance.

A Wild Builderboy appeared! Heya, BB! If you can makes some time, you should try to submit an entry for the BASIC version of the <a href=http://ourl.ca/19647>contest</a> going on, ya know, for old times sake. ;)

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #3265 on: October 19, 2013, 01:20:56 pm »
Is signed for loop comparisons a possibility?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3266 on: October 19, 2013, 01:22:49 pm »
Possible: yes. Easy to implement: I'm not so sure... I'll look into it, though.

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Features Wishlist
« Reply #3267 on: October 19, 2013, 01:30:35 pm »
It would be awesome if Axe also had more commands for utility type programs in addition to all the game stuff.
It would be great if it could:

RunPRGM(programNAME)
easily run achived/unarchived basic and assembly programs without an axiom

RunAPP(appNAME)
run Apps from within the program
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3268 on: October 19, 2013, 01:37:17 pm »
Running external apps and programs is tricky and should really involve stuff like error handlers when done properly. Considering DrDnar's axiom exists and does most of that already, and that the Axe application's 2 pages are pretty much completely full, I don't think this is something I'd consider adding to Axe at the moment.

Offline jo-thijs

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +1/-0
    • View Profile
Re: Features Wishlist
« Reply #3269 on: October 30, 2013, 05:48:42 pm »
I've just noticed the use of rp_Ans and rp_Byte in the Commands.inc file, it's brillant!
when I saw, it, a question arose however: what if it would be possible to find another start code
that is followed by a label, where axe will go to the label and copy the code that is there in the final code
and then return? could this free some space in axe, without slowing axe too much down?
an example would be:
p_ShiftLeftFast:         ;16982 cycles, 44 bytes
   .db __ShiftLeftFast_SubEnd-1-$
   ld   hl,plotSScreen+768
x_ShiftLeftFastEntry:
   ld   b,64
__ShiftLeftFast_Loop:
   dec   hl
   sla   (hl)
__ShiftLeftFast_SubEnd:
   .db copy_subfunc
   .dw _ShiftLeftFast_End
   .db 0,copy_subfunc
   .dw _ShiftLeftFast_End
   .db 6
   dec   hl
   rl   (hl)
   djnz   __ShiftLeftFast_Loop
   ret
__ShiftLeftFast_End:
   .db 15
   dec   hl
   rl   (hl)
   dec   hl
   rl   (hl)
   dec   hl
   rl   (hl)
   dec   hl
   rl   (hl)
   dec   hl
   rl   (hl)

which would be 6 bytes smaller if I'm correct.
another example:
p_NEN2:
   .db 1
   inc   l
   .db copy_subfunc
   .dw p_NEN1
        .db 0

which would save 3 bytes.
another example:
p_NE2:
   .db 1
   dec   l
   .db copy_subfunc
   .dw p_NE1
   .db 0

which would save 4 bytes.
and so on.

this is probably just a crazy idea I got, but I wanted to post it anyway.