12-03-2004, 09:10 PM
Is it normal that ^2 is really slow?
..
because it is quite slow.
..
because it is quite slow.
Bug Reports
|
12-03-2004, 09:10 PM
Is it normal that ^2 is really slow?
.. because it is quite slow.
12-03-2004, 09:45 PM
Power of, yeah, unless the left operand is a constant, that will be evaluated at compile-time.
You could just use "expression shl 1" if the left operand is an integer. FB doesn't do the "^ powerof2constant" to "shl" optimization yet.
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
12-03-2004, 10:07 PM
Quote:"expression shl 1" Thanks, but what doesnt appear to work.... Code: 4 shl 1
12-03-2004, 10:21 PM
Er, nm me.. value ^ 2 is equal to value * value, not value * 2 (same as shl 1).
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
12-03-2004, 10:40 PM
O_o
So.... There isnt an asm type optimisation for "^"?
12-03-2004, 11:17 PM
No, it must be implemented as a library, but expr ^ 2 could be optimized to expr * expr by the compiler, i will see what i can do.
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
12-03-2004, 11:22 PM
Quote:you know, loads of different cultures mixed, a "thumbs up!" can mean "hey, it looks good" in some countries or "hey babe, lets f*ck". i hope for your health that this was not an invitation to have intercourse or something whatever...
12-03-2004, 11:24 PM
Hey, 3 smiles, you must be kidding now, right??
Heh..
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
12-06-2004, 12:33 AM
I'm trying to compile some old code, a bit spaghetti'ish, to really proof-test the compiler.
I've found that the compiler does not understand some QB stuff: --- The compiler complains with, stopping at the comma: Code: NEXT x, y Also with this line, stopping at the ":" (error: expected ","): --- Code: LINE INPUT sn$: sn$ = LCASE$(sn$) I had to change it for: Code: LINE INPUT ">"; sn$: sn$ = LCASE$(sn$) to make it work. Plus LINE INPUT throws a "?" on screen, when it shouldn't. Not a single LINE INPUT variable$ worked in the code, it needs a string literal and a ";" before the variable to work. --- QB accepted: Code: CLOSE Which closed every open file. FB doesn't, it complains about "expression expected". --- I also got something you should document (I dunno if you have done it already): If your BAS filename has a "-" the assembler fails with Code: junk at the end of line, first unrecognized character is `-' My BAS file was called OPA-OPA.BAS. The ASM lines that are not working are those: Code: .globl fb_opa-opa_entry Error messages: Code: opa-opa.asm: Assembler messages: I renamed the file to OPAOPA.BAS and it compiled without problems. Awesome work! Those are just minor issues and the code was like 120 Kb and written 6 years ago... Really UGLY code.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio underBASIC, homegrown musicians [img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
12-06-2004, 12:49 AM
Dark prevail... try SAL and SAR insead, if rel's not trying to mislead me *GLARE*
|
« Next Oldest | Next Newest »
|