Jump to content
IGNORED

Open Lara engine on the ATARI Jaguar


Gunther

Recommended Posts

17 minutes ago, 42bs said:

Maybe you should remove the SKUNK debug code:

$5d40: Writing 0x37ea to 0xc00000

This is a SKUNK command register IIRC.

Yes, it's in my TODO list, I want to have two build versions, one with skunk debug code, the other one "naked"

Edited by swapd0
Link to comment
Share on other sites

3 hours ago, 42bs said:

Wow, the C compiler produces horrible code:

 


| |    005DF2: 5380                     SUB.L #$1, D0
| |    005DF4: 4A80                     TST.L D0
| | -> 005DF6: 66E8                     BNE.B $5DE0 (true)

This hurts a Assembly-guy's eyes. :.(

That looks like debug-level code.. are you sure the optimizer was enabled when this code was compiled?

Link to comment
Share on other sites

6 minutes ago, selgus said:

That looks like debug-level code.. are you sure the optimizer was enabled when this code was compiled?

I'm using -Ofast flag.

 

I've seen that it's the getBuffer function from the skunk board code... so don't worry.

Edited by swapd0
Link to comment
Share on other sites

2 minutes ago, swapd0 said:

It's some "ataribrownart-prefix" version, IIRC 8.2 or something like that.

Really? And such a horrible code generation?

Even without optimization, the compiler should know that "sub.l #1,dn" will set the Z flag.

I checked an old GCC (Sourcery G++ Lite 4.4-52) and it does know about.

Link to comment
Share on other sites

A quick check

extern int func(int);

int a()
{
  int s = 0;
  for(int i = 100; i > 0; --i){
    s += func(i);
  }
  return s;
}

=>

#NO_APP
        .file   "x.c"
        .text
        .align  2
        .globl  a
        .type   a, @function
a:
        movem.l #12320,-(%sp)
        moveq #100,%d2
        clr.w %d3
        lea func,%a2
.L2:
        move.w %d2,-(%sp)
        jsr (%a2)
        add.w %d0,%d3
        subq.w #1,%d2
        addq.l #2,%sp
        jne .L2
        move.w %d3,%d0
        movem.l (%sp)+,#1036
        rts
        .size   a, .-a
        .ident  "GCC: (Sourcery G++ Lite 4.4-52) 4.4.1"

With:-std=c99 -mc68000 -mshort -O -fomit-frame-pointer

Link to comment
Share on other sites

9 minutes ago, 42bs said:

Really? And such a horrible code generation?

Even without optimization, the compiler should know that "sub.l #1,dn" will set the Z flag.

I checked an old GCC (Sourcery G++ Lite 4.4-52) and it does know about.

That code is from the skunk code library and it's in asm, anyway I've removed the tst.l opcode.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...