Jump to content
IGNORED

Volker Barthelmann's/Frank Wille's VASM assembler for the JRISC


JagChris

Recommended Posts

I am using the test asm output file from the Jaguars risc gcc.

Below that will be the the results of VASM_madmacs first testrun on it.

Here is the test source:



;GCC for Atari Jaguar GPU/DSP (Jun 12 1995) (C)1994-95 Brainstorm
MACRO _RTS
load (ST),TMP
jump T,(TMP)
addqt #4,ST ;rts
ENDM
_test_start::
.GPU
.ORG $F03000
ST .REGEQU r18
FP .REGEQU r17
TMP .REGEQU r16
GT .CCDEF $15
gcc2_compiled_for_madmac:
;(.DATA)
.LONG
_global::
.DC.L 5
;(.TEXT)
.EVEN
_GetTest1::
subqt #4,ST
store FP,(ST)
move ST,FP ;link
subqt #8,ST
move FP,r1 ;movsi FP->r1
move FP,r2 ;movsi FP->r2
subqt #4,r2 ;isubqtsi3 r2-#4->r2
move r2,r3 ;movsi r2->r3
store r0,(r3) ;movsi r0->(r3)
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r0 ;movsi r4->r0
moveq #0,r6 ;movsi #0->r6
store r6,(r0) ;movsi r6->(r0)
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #4,r4 ;isubqtsi3 r4-#4->r4
move r4,r0 ;movsi r4->r0
load (r0),r4 ;movsi (r0)->r4
moveq #9,r0 ;movsi #9->r0
cmp r4,r0 ;rcmpsi r4,r0
movei #L2,TMP
jump GT,(TMP)
nop ;jgt L2
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r0 ;movsi r4->r0
movei #100,r6 ;movsi #100->r6
store r6,(r0) ;movsi r6->(r0)
movei #L3,TMP
jump T,(TMP)
nop ;jt L3
.EVEN
L2:
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #4,r4 ;isubqtsi3 r4-#4->r4
move r4,r0 ;movsi r4->r0
load (r0),r4 ;movsi (r0)->r4
moveq #9,r0 ;movsi #9->r0
cmp r4,r0 ;rcmpsi r4,r0
movei #L4,TMP
jump GT,(TMP)
nop ;jgt L4
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r0 ;movsi r4->r0
moveq #10,r6 ;movsi #10->r6
store r6,(r0) ;movsi r6->(r0)
movei #L5,TMP
jump T,(TMP)
nop ;jt L5
.EVEN
L4:
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #4,r4 ;isubqtsi3 r4-#4->r4
move r4,r0 ;movsi r4->r0
load (r0),r4 ;movsi (r0)->r4
cmpq #0,r4 ;tstsi r4
movei #L6,TMP
jump EQ,(TMP)
nop ;jeq L6
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r0 ;movsi r4->r0
moveq #1,r6 ;movsi #1->r6
store r6,(r0) ;movsi r6->(r0)
L6:
L5:
L3:
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r5 ;movsi r4->r5
load (r5),r0 ;movsi (r5)->r0
movei #L1,TMP
jump T,(TMP)
nop ;jt L1
.EVEN
L1:
move FP,ST
load (ST),FP
addqt #4,ST ;unlk
_RTS
.EVEN
_GetTest2::
subqt #4,ST
store FP,(ST)
move ST,FP ;link
subqt #8,ST
move FP,r1 ;movsi FP->r1
move FP,r2 ;movsi FP->r2
subqt #4,r2 ;isubqtsi3 r2-#4->r2
move r2,r3 ;movsi r2->r3
store r0,(r3) ;movsi r0->(r3)
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r0 ;movsi r4->r0
moveq #0,r6 ;movsi #0->r6
store r6,(r0) ;movsi r6->(r0)
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #4,r4 ;isubqtsi3 r4-#4->r4
move r4,r5 ;movsi r4->r5
load (r5),r0 ;movsi (r5)->r0
moveq #9,r4 ;movsi #9->r4
cmp r4,r0 ;cmpsi r4,r0
movei #L18,TMP
jump GT,(TMP)
nop ;jgt L18
moveq #1,r4 ;movsi #1->r4
cmp r4,r0 ;cmpsi r4,r0
movei #L18,TMP
jump MI,(TMP)
nop ;jlt L18
movei #L9,TMP
jump T,(TMP)
nop ;jt L9
.EVEN
L9:
L10:
L11:
L12:
L13:
L14:
L15:
L16:
L17:
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r0 ;movsi r4->r0
moveq #1,r6 ;movsi #1->r6
store r6,(r0) ;movsi r6->(r0)
movei #L8,TMP
jump T,(TMP)
nop ;jt L8
.EVEN
L18:
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r0 ;movsi r4->r0
moveq #10,r6 ;movsi #10->r6
store r6,(r0) ;movsi r6->(r0)
L8:
move FP,r0 ;movsi FP->r0
move FP,r4 ;movsi FP->r4
subqt #8,r4 ;isubqtsi3 r4-#8->r4
move r4,r5 ;movsi r4->r5
load (r5),r0 ;movsi (r5)->r0
movei #L7,TMP
jump T,(TMP)
nop ;jt L7
.EVEN
L7:
move FP,ST
load (ST),FP
addqt #4,ST ;unlk
_RTS
.EVEN
_Test3::
subqt #4,ST
store FP,(ST)
move ST,FP ;link
subqt #32,ST
subqt #8,ST
move ST,r14
store r19,(ST)
store r20,(r14+1)
store r21,(r14+2)
store r22,(r14+3)
store r23,(r14+4)
store r24,(r14+5)
move FP,r19 ;movsi FP->r19
move FP,r20 ;movsi FP->r20
subqt #4,r20 ;isubqtsi3 r20-#4->r20
move r20,r21 ;movsi r20->r21
store r0,(r21) ;movsi r0->(r21)
move FP,r0 ;movsi FP->r0
move FP,r1 ;movsi FP->r1
subqt #8,r1 ;isubqtsi3 r1-#8->r1
move r1,r0 ;movsi r1->r0
moveq #0,r3 ;movsi #0->r3
store r3,(r0) ;movsi r3->(r0)
move FP,r0 ;movsi FP->r0
move FP,r1 ;movsi FP->r1
subqt #16,r1 ;isubqtsi3 r1-#16->r1
move r1,r0 ;movsi r1->r0
moveq #0,r3 ;movsi #0->r3
store r3,(r0) ;movsi r3->(r0)
L21:
move FP,r0 ;movsi FP->r0
move FP,r1 ;movsi FP->r1
subqt #8,r1 ;isubqtsi3 r1-#8->r1
move r1,r0 ;movsi r1->r0
move FP,r1 ;movsi FP->r1
move FP,r2 ;movsi FP->r2
subqt #4,r2 ;isubqtsi3 r2-#4->r2
move r2,r1 ;movsi r2->r1
load (r0),r0 ;movsi (r0)->r0
load (r1),r1 ;movsi (r1)->r1
cmp r1,r0 ;cmpsi r1,r0
movei #L24,TMP
jump MI,(TMP)
nop ;jlt L24
movei #L22,TMP
jump T,(TMP)
nop ;jt L22
.EVEN
L24:
move FP,r0 ;movsi FP->r0
move FP,r1 ;movsi FP->r1
subqt #12,r1 ;isubqtsi3 r1-#12->r1
move r1,r0 ;movsi r1->r0
move FP,r1 ;movsi FP->r1
move FP,r2 ;movsi FP->r2
subqt #8,r2 ;isubqtsi3 r2-#8->r2
move r2,r1 ;movsi r2->r1
moveq #1,r2 ;movsi #1->r2
load (r1),r1 ;movsi (r1)->r1
neg r1 ;negsi2 r1->r1
sha r1,r2 ;iashlsi3 r2<<r1->r2
neg r1 ;negsi2 r1->r1
store r2,(r0) ;movsi r2->(r0)
move FP,r0 ;movsi FP->r0
move FP,r1 ;movsi FP->r1
subqt #16,r1 ;isubqtsi3 r1-#16->r1
move r1,r22 ;movsi r1->r22
move ST,r0 ;movsi ST->r0
move FP,r1 ;movsi FP->r1
move FP,r0 ;movsi FP->r0
subqt #8,r0 ;isubqtsi3 r0-#8->r0
move r0,r1 ;movsi r0->r1
load (r1),r0 ;movsi (r1)->r0
movei #_GetTest1,r23 ;movsi #_GetTest1->r23
move PC,TMP
subqt #4,ST
addqt #10,TMP
jump T,(r23)
store TMP,(ST) ;call r23->r0
move r0,r23 ;movsi r0->r23
move ST,r0 ;movsi ST->r0
move FP,r1 ;movsi FP->r1
move FP,r0 ;movsi FP->r0
subqt #12,r0 ;isubqtsi3 r0-#12->r0
move r0,r1 ;movsi r0->r1
load (r1),r0 ;movsi (r1)->r0
movei #_GetTest2,r24 ;movsi #_GetTest2->r24
move PC,TMP
subqt #4,ST
addqt #10,TMP
jump T,(r24)
store TMP,(ST) ;call r24->r0
move FP,r1 ;movsi FP->r1
move FP,r2 ;movsi FP->r2
subqt #16,r2 ;isubqtsi3 r2-#16->r2
move r2,r1 ;movsi r2->r1
add r23,r0 ;iaddsi3 r23+r0->r0
load (r1),r1 ;movsi (r1)->r1
add r1,r0 ;iaddsi3 r1+r0->r0
store r0,(r22) ;movsi r0->(r22)
L23:
move FP,r0 ;movsi FP->r0
move FP,r1 ;movsi FP->r1
subqt #8,r1 ;isubqtsi3 r1-#8->r1
move r1,r0 ;movsi r1->r0
move FP,r1 ;movsi FP->r1
move FP,r2 ;movsi FP->r2
subqt #8,r2 ;isubqtsi3 r2-#8->r2
move r2,r0 ;movsi r2->r0
move FP,r1 ;movsi FP->r1
move FP,r2 ;movsi FP->r2
subqt #8,r2 ;isubqtsi3 r2-#8->r2
move r2,r1 ;movsi r2->r1
load (r1),r2 ;movsi (r1)->r2
move r2,r1 ;movsi r2->r1
addqt #1,r1 ;iaddqtsi3 #1+r1->r1
move r1,r2 ;movsi r1->r2
store r2,(r0) ;movsi r2->(r0)
movei #L21,TMP
jump T,(TMP)
nop ;jt L21
.EVEN
L22:
move FP,r0 ;movsi FP->r0
move FP,r1 ;movsi FP->r1
subqt #16,r1 ;isubqtsi3 r1-#16->r1
move r1,r2 ;movsi r1->r2
load (r2),r0 ;movsi (r2)->r0
movei #L20,TMP
jump T,(TMP)
nop ;jt L20
.EVEN
L20:
move ST,r14
load (ST),r19
load (r14+1),r20
load (r14+2),r21
load (r14+3),r22
load (r14+4),r23
load (r14+5),r24
move FP,ST
load (ST),FP
addqt #4,ST ;unlk
_RTS
.LONG
.68000
_test_end::
_test_size .EQU *-_test_start
.GLOBL _test_size
.IF _test_size>$1000
.PRINT "Code size (",/l/x _test_size,") is over $1000"
.FAIL
.ENDIF

Here are the results:



C:\vasm\test>vasmjagrisc_madmac -o test.o test.s
vasm 1.7c (c) in 2002-2015 Volker Barthelmann
vasm Jaguar RISC cpu backend 0.4 (c) 2014-2015 Frank Wille
vasm madmac syntax module 0.1 (c) 2015 Frank Wille
vasm test output module 1.0 (c) 2002 Volker Barthelmann

error 2 in line 335 of "test.s": unknown mnemonic <.68000>
> .68000

error 31 in line 339 of "test.s": expression must be constant
> .IF _test_size>$1000

error 54: non-relocatable expression in equate <_test_size>

I have reported these bugs already.

Edited by JagChris
Link to comment
Share on other sites

 

I'm pretty sure he doesn't have a clue.

 

Now don't be that way. I'm learning.

 

So if I am understanding that source code I posted correctly everything after the .68000 directive is 68k code correct?

 

Everything before that is gpu specific stuff apparently. The new module appears to have no problem with it. That's promising.

 

We may have a heartbeat here.

Link to comment
Share on other sites

 

There is absolutely no evidence of that what-so-ever, anywhere.

 

Holy crap this post has been up 5+ hours and the usual suspects haven't dogpiled on the 'like' button? Start taking everyone's temperature. Something's going around.

Edited by JagChris
Link to comment
Share on other sites

 

Add 'Kevincal' complex to the list of symptoms.

 

 

Well I seem to be in good company. There seems to be a few people lately who develop 'symptoms' when they come around to this forum.

 

Anyways I'm out until next time.

Edited by JagChris
Link to comment
Share on other sites

its not fun reading this topic ...

filtering nearly 80% of flaming and spiderman pics between the topic related posts :-(

 

Maybe you could ask a third time "what's going on here?"

 

Third time lucky? Worth a shot, bump that 4:1 ratio in the right direction if you get a satisfactory response.

Link to comment
Share on other sites

 

 

> error 2 in line 335 of "test.s": unknown mnemonic <.68000>

> > .68000

 

Hmm. From this context I doubt that I can get away with just ignoring

.68000, although there are no M68k instructions in the source.

 

Seems like .68000 also switches back from absolute assembling (to the

fixed address $f03000) to the .text section. This makes the label

_test_end being placed in .text again.

 

 

> error 31 in line 339 of "test.s": expression must be constant

> > .IF _test_size>$1000

 

It's probably because of:

 

_test_size .EQU *-_test_start

 

The difference between two labels is not constant in vasm, as there

may always be optimizations in a later pass. But the parser needs a

constant for conditional assembly in the first pass.

 

I will look into that.

 

 

Regards,

 

--

Frank Wille

Link to comment
Share on other sites

 

 

> error 2 in line 335 of "test.s": unknown mnemonic <.68000>

> > .68000

>

> error 31 in line 339 of "test.s": expression must be constant

> > .IF _test_size>$1000

 

Ok, the reason was that vasm handles ORG differently than madmac/smac.

 

Usually ORG starts a separate section with a fixed base address

defined by ORG. But in the Jaguar/Madmac case it is more like a RORG,

relocating the labels inside a still active text section.

 

And .68000 seems to work like ending such a RORG-block.

 

I wanted to keep the usual function of ORG to make the madmac syntax

module also usable for other CPUs, so I implemented the new option

"-rorg", which changes the function of .ORG and .68000 in the way you

need it.

 

Your test source assembles now. New snapshot available in 11 hours.

 

frank@sun ../../vasmjagrisc_madmac -rorg -Faout gcc.s

vasm 1.7c © in 2002-2015 Volker Barthelmann

vasm Jaguar RISC cpu backend 0.4 © 2014-2015 Frank Wille

vasm madmac syntax module 0.2 © 2015 Frank Wille

vasm a.out output module 0.6 © 2008-2015 Frank Wille

 

.text(acrx2): 640 bytes

 

 

Regards,

 

--

Frank Wille

Link to comment
Share on other sites

C:\vasm\test>vasmjagrisc_madmac -rorg -Faout test.s
vasm 1.7c (c) in 2002-2015 Volker Barthelmann
vasm Jaguar RISC cpu backend 0.4 (c) 2014-2015 Frank Wille
vasm madmac syntax module 0.2 (c) 2015 Frank Wille
vasm a.out output module 0.6 (c) 2008-2015 Frank Wille

.text(acrx2): 640 byte

C:\vasm\test>

Win32 build of vasm_madmac w/syntax module 0.2 vasmjagrisc_madmac.zip

Edited by JagChris
Link to comment
Share on other sites

It uses the agile method to provide data mining collaboration that will lead to the discovery of epic proportions: a next gen optimize pipeline that runs in real time on the cloud. It's a brogrammer's level up!

Edited by ggn
  • Like 2
Link to comment
Share on other sites

It uses the agile method to provide data mining collaboration that will lead to the discovery of epic proportions: a next gen optimize pipeline that runs in real time on the cloud. It's a brogrammer's level up!

 

Hey, at least he had some source code this time.....

  • Like 1
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...