English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old 21 May 2015, 21:19   #101
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,311
Example of failure:

test2.c
Code:
int myfunc()
{
   return 0;
}

void test()
{
   int x = myfunc();
}
clang -emit-llvm test2.c -c -o test2.ll
(no O2 this time)

./llvm-m68k/build/bin/llc -march=m68k test2.ll
Code:
Not Implemented
UNREACHABLE executed at /home/paul/llvm-m68k/include/llvm/Target/TargetLowering.h:1376!
0  llc             0x00000000014fa902
1  llc             0x00000000014fa5d8
2  libpthread.so.0 0x00007f26764ae0a0
3  libc.so.6       0x00007f26759a7165 gsignal + 53
4  libc.so.6       0x00007f26759aa3e0 abort + 384
5  llc             0x00000000014c862b
6  llc             0x0000000000a3f612
7  llc             0x0000000000e7cb64 llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&) const + 2490
8  llc             0x0000000000e76176 llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite, llvm::SDValue, bool, llvm::MachineBasicBlock*) + 2638
9  llc             0x0000000000e77f79 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 2183
10 llc             0x0000000000e4e0a8 llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) + 1232
11 llc             0x0000000000e4db3a llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 128
12 llc             0x0000000000e9c244 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 68
13 llc             0x0000000000e9f083 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2873
14 llc             0x0000000000e9b756 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 864
15 llc             0x0000000000a3dc73
16 llc             0x000000000103b365 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 95
17 llc             0x000000000140e271 llvm::FPPassManager::runOnFunction(llvm::Function&) + 383
18 llc             0x000000000140e484 llvm::FPPassManager::runOnModule(llvm::Module&) + 102
19 llc             0x000000000140e7ac llvm::MPPassManager::runOnModule(llvm::Module&) + 442
20 llc             0x000000000140ecc4 llvm::PassManagerImpl::run(llvm::Module&) + 120
21 llc             0x000000000140ee77 llvm::PassManager::run(llvm::Module&) + 39
22 llc             0x000000000083b8a3 main + 4244
23 libc.so.6       0x00007f2675993ead __libc_start_main + 253
24 llc             0x000000000083a239
Stack dump:
0.      Program arguments: ./llvm-m68k/build/bin/llc -march=m68k test2.ll
1.      Running pass 'Function Pass Manager' on module 'test2.ll'.
2.      Running pass 'Unnamed pass: implement Pass::getPassName()' on function '@test'
Aborted
nogginthenog is online now  
Old 22 May 2015, 01:29   #102
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
I had not seen it. It may be worth forking.
Samurai_Crow is offline  
Old 22 May 2015, 08:37   #103
beezle
Banned
 
Join Date: May 2015
Location: Australia
Posts: 67
Quote:
Originally Posted by gulliver View Post
A Sega Genesys emulator with sound.
A SNES emulator with sound.
In both cases a native (OCS/ECS/AGA+paula) and RTG+AHI version would be really cool.

There is a an old version of AmiGenerator that works on a 68040, but has no sound.
There are many 68k SNES emulator that dont have sound support and are incomplete in one way or the other.
Actually I ported DGen to 68k/os3.x about 10 years ago. It has sound. Straight compile using SDL, but it works pretty well.
beezle is offline  
Old 22 May 2015, 20:29   #104
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
I've forked the repo for LLVM-68k. Since I'll have to come up with a custom calling convention to access the Amiga operating system and libraries, it would likely be a divergent fork of the original anyway. Unfortunately it is a stale source that is 3 years behind the trunk so I may need to get hopping if I ever get it working at all. I'll email an Amiga friend with some LLVM experience and see what happens.
Samurai_Crow is offline  
Old 22 May 2015, 21:58   #105
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,311
Quote:
Originally Posted by Samurai_Crow View Post
I've forked the repo for LLVM-68k. Since I'll have to come up with a custom calling convention to access the Amiga operating system and libraries, it would likely be a divergent fork of the original anyway. Unfortunately it is a stale source that is 3 years behind the trunk so I may need to get hopping if I ever get it working at all. I'll email an Amiga friend with some LLVM experience and see what happens.
Nice. Let me know if you need any help, but compiler internals are not my strong point!

From my limited tests this did produce code that looked a little better than GCC 2.95. But the lack of function calls is somewhat limiting...
nogginthenog is online now  
Old 23 May 2015, 16:26   #106
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
Quote:
Originally Posted by beezle View Post
Actually I ported DGen to 68k/os3.x about 10 years ago. It has sound. Straight compile using SDL, but it works pretty well.
Where is it? You should upload it to Aminet.
gulliver is offline  
Old 23 May 2015, 19:51   #107
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
Quote:
Originally Posted by nogginthenog View Post
Nice. Let me know if you need any help, but compiler internals are not my strong point!

From my limited tests this did produce code that looked a little better than GCC 2.95. But the lack of function calls is somewhat limiting...
You can be a tester once we've got something to test. My friend, mness1978 (Sidewinder on most Amiga forums), has joined up also as a collaborator. I've also added ezrec in case we need some extra help. (He was also on the SourceForge project.)

The link, as you might suspect, is at https://github.com/SamuraiCrow/llvm-m68k but if compilers aren't your strong suit, you might not need commit privileges right away. If you send me your GitHub username, I can add you though. There shouldn't be much need for documentation either since this is just a backend for LLVM 3.2 and most of the documentation you'd need would be found at http://llvm.org/releases/3.2/docs/index.html.

The first step after getting it to build as you have already done, will be to get the target triples set to M68k-commodore-amiga instead of M68k-apple-mac. Then add the calling conventions and so on, (including the two custom calling conventions, libcall and acall, for shared library calls and amiga-specific register loading calls respectively). Finally we migrate the code to the latest LLVM stable release and start adding subtargets for 020/030, 040/060, and Apollo softcore optimization.

At least it sounds like a plan to me... If anybody else wants to join up, let me know!
Samurai_Crow is offline  
Old 28 May 2015, 01:26   #108
beezle
Banned
 
Join Date: May 2015
Location: Australia
Posts: 67
Quote:
Originally Posted by gulliver View Post
Where is it? You should upload it to Aminet.
I actually thought I had, but couldn't find it when I checked. By chance I still have a copy of the binary, so I'll upload it somewhere.

EAB has a file server (ftp?) somewhere to temporarily host files for this sort of thing doesn't it?
I'd prefer not to upload to aminet yet as there's newer versions of DGen (and better sdl versions for 68k) now, so I'd prefer to update it first.
I'm not sure when that'll be though, so for now Im still happy to share what I already have, just elsewhere

It's built against an old 68k sdl though, which can be flaky at times. Generally though if you set a decent stack first it's pretty good. Probably needs an overclocked '060 (needs rtg too) to be useful though. I vaguely recall someone at the tome saying it was about 5-10fps on an '060@50mhz. I was/am an Amithlon user though, so never used it on my real (nowadays aga only) amiga.
beezle is offline  
Old 01 June 2015, 19:40   #109
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
Sidewinder has emailed me that the LLVM-68k project looks hopeful. He worked on it this past weekend. He also said he wants to merge the code from our earlier attempt at making a 68k AROS backend and bring them collectively up-to-date to the current stable release of LLVM 3.6.1. I hope he can do it (and wonder if I'll be any help to him).
Samurai_Crow is offline  
Old 03 June 2015, 05:18   #110
B14ck W01f
m68k all the way
 
Join Date: Aug 2011
Location: Koalaland
Posts: 523
I have been playing around with AMOS The Creator. It is quite a useful little program, and it comes with some interesting games, including "AMOSteroids" (which is quite different to the version I played before I got my hands on AMOS) and Magic Forest.

Strangely, these are on the "Data" disk, not "Extras" as they should have been.

Quote:
Originally Posted by adrdesign View Post
I think we underestimate the amiga audio chip

http://www.amiga.org/forums/archive/...p/t-54117.html

based on this, we could really have an instrument by itself applying some new concepts using our lovely Paula.

He was asking about software for the Amiga, not about its custom chips.
B14ck W01f is offline  
Old 05 June 2015, 14:24   #111
MrFluffy
furtling tinkerer
 
Join Date: Jun 2015
Location: Mouhet France
Posts: 55
Another vote for a ssh/scp/sftp client/server. A cmd line tool and a sshd would be great. If it supports tunneling and port forwarding it could open up a myriad of extra possibilities over telnet and ftp.

Just waiting for a avr-net board to turn up to make a plip box then I will probably be adding to the chorus for a newer synergy client too :-)
MrFluffy is offline  
Old 19 June 2015, 21:43   #112
TenLeftFingers
Registered User
 
TenLeftFingers's Avatar
 
Join Date: Sep 2013
Location: Ireland
Posts: 800
I would also like to see a very crude/lightweight and text only Evernote client.

Sent from my awesome Ubuntu Touch device using the Forum Browser app
TenLeftFingers is offline  
Old 30 June 2015, 16:41   #113
ziovax
Registered User
 
ziovax's Avatar
 
Join Date: Jul 2005
Location: Roma / Italia
Age: 49
Posts: 90
Quote:
Originally Posted by turrican3 View Post
This is exactly what i thought, but you know when you are not specialist, you are always afraid to say wrong things.
Yes, indeed. The real limit of cd32 is its slow CD-ROM reader... I'm pretty sure that an Amiga 500+HD could reach the limit of the stream according to the speed of the mounted hard disk.

P.S.: "the guy making the anime CDs for CD32" is me.
ziovax is offline  
Old 03 July 2015, 11:08   #114
SainT
Registered User
 
Join Date: Jul 2015
Location: UK
Posts: 10
@Samurai_Crow has there been any progress on the LLVM backend? I've just started looking at updating it to the latest LLVM release and starting work on it myself for use on Atari machines. But if there's active work going on, I'd be happy to collaborate and contribute to your fork.
SainT is offline  
Old 03 July 2015, 17:05   #115
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
@SainT

My old friend Michael Ness is a compiler specialist and is very interested in updating the LLVM 68k project to the latest stable release as well as adding the necessary Amiga calling conventions for an Amiga version of LLVM. Currently, it is only a fork of an incomplete Classic Mac backend. Mike has just started a new job and hasn't had much time to work on it yet.

What I've discussed so far with Mike is regarding making the Clang C++ compiler link in less than 2 Gigs of RAM and eventually self-hosting. The plan that would allow such things to take place will require OOP.library from the AROS kernel to implement LibC++ and only preloading 2 passes in the optimizer. This will allow C++ class instances using a similar style of shared-library linkage to that of the BOOPSI classes used by MUI and ClassAct/ReAct for GUIs except on a slightly more abstract level.

Send me a private message with your GitHub ID and I can add you unless you'd rather start your own fork.
Samurai_Crow is offline  
Old 03 July 2015, 17:59   #116
SainT
Registered User
 
Join Date: Jul 2015
Location: UK
Posts: 10
Sounds good! My primary goal is for a Jaguar target, which should be pretty straight forward (not having any OS to speak of to integrate with).
SainT is offline  
Old 04 July 2015, 10:09   #117
SainT
Registered User
 
Join Date: Jul 2015
Location: UK
Posts: 10
Quote:
Originally Posted by nogginthenog View Post
Have you seen this:
https://github.com/kwaters/llvm-m68k

I compiled it and it does work (Debian Linux). But any C function call fails...

test.c
Code:
typedef unsigned int uint32_t;
typedef char int8_t;

uint32_t foo(uint32_t x, int8_t y)
{
    return (x | (1 << 17)) + y;
}
clang -emit-llvm test.c -c -O2 -o test.ll
./llvm-m68k/build/bin/llc -march=m68k test.ll

test.s
Code:
        SEG     'main'
; GLOBAL foo
foo     PROC                            ; @foo
; BB#0:
        move.l  #131072, d1
        or.l    (a6), d1
        move.b  4(a6), d0
        ext.w   d0
        ext.l   d0
        add.l   d1, d0
        rts

        END
Is there any specific configuration setup you used to compile llvm here? I've built with m68k target, but I'm getting a crash even with this simple example. I'm not sure if its triple related, as I just left the default triple as it was.

I should get more time to look into this tonight I hope, so any pointers would be appreciated, otherwise I'll just poke things until it works...
SainT is offline  
Old 04 July 2015, 12:00   #118
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,311
Quote:
Originally Posted by SainT View Post
Is there any specific configuration setup you used to compile llvm here? I've built with m68k target, but I'm getting a crash even with this simple example. I'm not sure if its triple related, as I just left the default triple as it was.

I should get more time to look into this tonight I hope, so any pointers would be appreciated, otherwise I'll just poke things until it works...
I don't think I did anything special. What do you mean by 'triple'?
Here are the command I used to build:

Quote:
git clone https://github.com/kwaters/llvm-m68k.git
cd llvm-m68k/cmake
cmake -G "Unix Makefiles" . .. -DCLANG_PATH_TO_LLVM_BUILD=~/llvm-m68k/build
nogginthenog is online now  
Old 04 July 2015, 16:28   #119
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
The current target triple in the source is 68k-apple-macintosh because it needs to be changed. SainT is trying to build the backend within an updated version of LLVM.

The reason any function fails is that the C calling convention is undefined.

Lastly, this git package is an indirect fork of LLVM so a merge with the current stable release of 3.6.2 should do the trick.

Last edited by Samurai_Crow; 04 July 2015 at 16:41. Reason: Added information
Samurai_Crow is offline  
Old 08 July 2015, 12:46   #120
SainT
Registered User
 
Join Date: Jul 2015
Location: UK
Posts: 10
It was actually a bug with LLVM when working with a MSVC debug executable. There was a combination of constructor issues (which were just in the M68k module) and also an uninitialised variable which was causing a crash.

So at least I have the 3.2 version working. I'll have a play and see what is required to add JSR / BSR type instructions and go from there.
SainT is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best C software for Amiga crosswire Coders. General 4 21 February 2013 14:41
Amiga Future: Amiga Software Database (ASD) Beta 2 Online AndreasM News 0 12 January 2009 12:42
Amiga Software madduck Amiga websites reviews 4 20 October 2002 23:16
New/Used Amiga Software jmmijo MarketPlace 0 04 April 2002 22:30
PC -> Amiga Software Shagra request.Apps 4 20 September 2001 23:50

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:08.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.31893 seconds with 14 queries