Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug Reports
#41
Is it normal that ^2 is really slow?

..

because it is quite slow.
Reply
#42
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.
Reply
#43
Quote:"expression shl 1"

Thanks, but what doesnt appear to work....

Code:
4 shl 1
yields 8...
Reply
#44
Er, nm me.. value ^ 2 is equal to value * value, not value * 2 (same as shl 1).
Reply
#45
O_o

So.... There isnt an asm type optimisation for "^"?
Reply
#46
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.
Reply
#47
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 Smile Wink Sad whatever...
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#48
Hey, 3 smiles, you must be kidding now, right??

Heh..
Reply
#49
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
.globl FB_OPA-OPA_ENTRY
fb_opa-opa_entry:
FB_OPA-OPA_ENTRY:

Error messages:

Code:
opa-opa.asm: Assembler messages:
opa-opa.asm:10: Error: junk at end of line, first unrecognized character is `-'
opa-opa.asm:11: Error: junk at end of line, first unrecognized character is `-'
opa-opa.asm:12: Error: invalid character '_' in mnemonic
opa-opa.asm:13: Error: invalid character '_' in mnemonic

I renamed the file to OPAOPA.BAS and it compiled without problems.

Awesome work! Those are just minor issues Smile 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
Reply
#50
Dark prevail... try SAL and SAR insead, if rel's not trying to mislead me *GLARE*
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)