About C / Z80 optimizations (SDCC)

Page 16/17
9 | 10 | 11 | 12 | 13 | 14 | 15 | | 17

By DarkSchneider

Paladin (862)

DarkSchneider's picture

23-09-2019, 09:53

geijoenr wrote:

the whole point of using C is that it reduces the "cognitive load" required to do something,
so you can come up with stuff that is a couple of orders of magnitude more complicated than what you would do in assembler, in the same amount of time.
Speed is not everything, even in an MSX. Sometimes game logic is more important.

Agree.

About debugging, what I do is open the symbols and asm generated files and look for addresses to look at. Other times, you can make public some variables so it generates a symbol address and you can look at it directly.
Also, be carefull about addresses and pages-slots configs. For small codes, I usually set the linker start address from address #4000 (page 1) so it is not overlapped by the BIOS.
It is true that is not as direct as with asm, but there are some tips to allow it.

By PingPong

Prophet (3437)

PingPong's picture

23-09-2019, 12:51

zPasi wrote:
PingPong wrote:

Using only 256k of ram and r800 to code a text adventure

Stop the bullshit and prepare the benchmarks you promised earlier.

After the posts above do you need other benchmarks?
look at the asm code it put SDCC on the shame.

By Grauw

Ascended (8398)

Grauw's picture

23-09-2019, 13:56

Stop bickering.

By zPasi

Champion (444)

zPasi's picture

23-09-2019, 14:31

PingPong wrote:
zPasi wrote:
PingPong wrote:

Using only 256k of ram and r800 to code a text adventure

Stop the bullshit and prepare the benchmarks you promised earlier.

After the posts above do you need other benchmarks?

Asm code is not a benchmark.

You said you'll prepare benchmarks. It's up to you if you do them or not, but if not, it's useless to continue this conversation.

Quote:

look at the asm code it put SDCC on the shame.

It's partially ugly, yes. But ugliness doesn't necessarily mean it to be slow.

For example, this is ugly:

	ld	hl,_somevar
	ld	a,(hl)
	add	a, #some const
	ld	(hl),a
	inc	hl
	ld	a,(hl)
	adc	a, #other const
	ld	(hl),a

I would have coded it this way:

	ld	hl,(_somevar)
	ld	de, #some const
	add	hl,de
	ld	(_somevar),hl

But the first version is actually quicker.

And, as I wrote earlier, currently I don't really even care if Hi-Tech is better or not.

By PingPong

Prophet (3437)

PingPong's picture

23-09-2019, 23:19

The problem is that sdcc is both ugly and slow and sometimes even take more space.
My "benchmarks" were based in comparisons on t states and n. Of bytes used. Non need to see them running. I assume both compilers generate semantically correct code.

By zPasi

Champion (444)

zPasi's picture

23-09-2019, 23:42

PingPong wrote:

The problem is that sdcc is both ugly and slow and sometimes even take more space.
My "benchmarks" were based in comparisons on t states and n. Of bytes used. Non need to see them running. I assume both compilers generate semantically correct code.

So, where are those benchmarks?

By PingPong

Prophet (3437)

PingPong's picture

24-09-2019, 09:33

Look at the code above in previous page. It's not enough?
PS= If you don't care about Hitech-C or SDCC why you shut up at every my criticism of SDCC like a human sustaining a surgery without anestetics?
I can feel your pain. ;-)

By Grauw

Ascended (8398)

Grauw's picture

24-09-2019, 09:41

Grauw wrote:

Stop bickering.

Seriously. Enough is enough.

By PingPong

Prophet (3437)

PingPong's picture

24-09-2019, 10:40

@Grauw: the problem is not mine. I'm only expressing the deficiencies of this compiler.
It is a matter of objectivity. if zPasi feel offended by this, (like SDCC was its own creation) it is its problem.
On the previous pages we seen a lot of asm generated code by the two compilers, and it is clear that SDCC code is more far (a lot) than hitech 7.8 than the ideal one.

Instead of simply take this assumption for true zPasi keep to try to change the conversation into a bickering.
But it is not only than an objective comparison between the two compilers.

I can (partially) understand the love for opensource software that some of us have, that force a lot of people to defend some software or another, but for me a software is a software. It must do its work in the best way.
And it is the only thing that matter.

By Grauw

Ascended (8398)

Grauw's picture

24-09-2019, 11:53

Regardless of who’s being touchy about what, let’s try to stop pushing each other’s buttons. Different compilers have different pros and cons, and different people have different priorities what’s important to them, let’s please respect each other’s opinions. No need to keep fighting back and forth about each individual’s definition of superiority.

The mood in this thread has been pretty hostile for weeks now, with a mood of addressing each other in a very direct and harsh manner without regard of the person behind the other screen as well as the other readers, and it also seems to infect other parts of the forum. Even if one feels like a harsh response is justified because it was provoked, just let it rest for once, instead of continuing the cycle.

Respect each other’s opinions, and there may be some actual informative constructive discussion. If anyone feels addressed by this comment there is probably something you can do for the better.

Page 16/17
9 | 10 | 11 | 12 | 13 | 14 | 15 | | 17