Welcome to Fractal Forums

Fractal Software => Mandel Machine => Topic started by: Botond Kósa on December 07, 2014, 02:51:18 AM




Title: Source code is available
Post by: Botond Kósa on December 07, 2014, 02:51:18 AM
I made the source code of version 1.3.10 available for download. The Java (http://web.t-online.hu/kbotond/mandelmachine/src/mm_v1.3.10_src_java.zip) and C++/ASM (http://web.t-online.hu/kbotond/mandelmachine/src/mm_v1.3.10_src_native.zip) files can be downloaded separately.

Please be aware that the code is in prototype state. It lacks documentation, even most of the comments are in Hungarian.
I do not take any responsibilities, nor do I promise any development targeting code reuseability. I will happily answer any questions regarding the code, though.


Title: Re: Source code is available
Post by: quaz0r on December 07, 2014, 08:46:51 AM
damn you wrote over 200kb of assembly...that must have taken ages  ;D


Title: Re: Source code is available
Post by: Chillheimer on December 07, 2014, 09:46:35 AM
Thank you Botond for this great gift to the community!


Title: Re: Source code is available
Post by: Kalles Fraktaler on December 07, 2014, 05:25:45 PM
Thanks for maintaining the spirit of K.I.Martin!
 :worm:


Title: Re: Source code is available
Post by: Botond Kósa on December 08, 2014, 03:08:15 PM
You're welcome! :happy:


Title: Re: Source code is available
Post by: claude on December 11, 2014, 04:18:50 PM
I hoped to try to compile on Linux but had some problems.  Not expecting a fix from you but more highlighting issues so other people don't waste time covering the same ground.

The asm source seems to be MASM syntax, and while I did find JWasm which claimed to be compatible it wasn't quite compatible enough.  GNU's assembler 'as' doesn't work at all, nor nasm or yasm.  I might try to assemble it on windows (hopefully WINE will work) and try something like objcopy to extract the code from windows object into ELF64.  I don't have access to a windows machine though...

The C++ compiled fine with GNU g++, once I changed #include <intrin.h> to #include <x86intrin.h>, and typedef int64_t __int64, and #include <some path to jni.h> to #include <jni.h> in the worker.h with the correct -Ipath for my system, but missed symbols defined in the asm code.

I didn't try anything with the Java so far, there is no build system but perhaps something like this might work (haven't tried it yet): find -iname "*.java" | xargs javac

Then remains the issue of combining all of the compiled code into one program, but the other things would need to work first.

Thanks for releasing the source in any case.


Title: Re: Source code is available
Post by: 3dickulus on December 12, 2014, 05:54:11 AM
if you have a mm64core.o the linux objdump command might be able to produce asm source for gcc ?


Title: Re: Source code is available
Post by: Botond Kósa on December 12, 2014, 08:35:25 AM
I hoped to try to compile on Linux but had some problems.  Not expecting a fix from you but more highlighting issues so other people don't waste time covering the same ground.

The asm source seems to be MASM syntax, and while I did find JWasm which claimed to be compatible it wasn't quite compatible enough.  GNU's assembler 'as' doesn't work at all, nor nasm or yasm.  I might try to assemble it on windows (hopefully WINE will work) and try something like objcopy to extract the code from windows object into ELF64.  I don't have access to a windows machine though...

The C++ compiled fine with GNU g++, once I changed #include <intrin.h> to #include <x86intrin.h>, and typedef int64_t __int64, and #include <some path to jni.h> to #include <jni.h> in the worker.h with the correct -Ipath for my system, but missed symbols defined in the asm code.

I didn't try anything with the Java so far, there is no build system but perhaps something like this might work (haven't tried it yet): find -iname "*.java" | xargs javac

Then remains the issue of combining all of the compiled code into one program, but the other things would need to work first.

Thanks for releasing the source in any case.
I'm afraid it would need a deeper rewrite of the ASM source to compile on Linux, because gcc on Linux and Microsoft's 64-bit C compiler conform to different calling conventions (http://en.wikipedia.org/wiki/X86_calling_conventions#x86-64_calling_conventions).


Title: Re: Source code is available
Post by: claude on December 12, 2014, 01:41:01 PM
I'm afraid it would need a deeper rewrite of the ASM source to compile on Linux, because gcc on Linux and Microsoft's 64-bit C compiler conform to different calling conventions (http://en.wikipedia.org/wiki/X86_calling_conventions#x86-64_calling_conventions).

Ah good point.  I give up for now!  I'll wait until wine64 is available on Debian stable..


Title: Re: Source code is available
Post by: PieMan597 on December 12, 2014, 02:32:06 PM
Claude, just get linux mint!


Title: Re: Source code is available
Post by: 3dickulus on December 12, 2014, 03:26:47 PM
@Claude

Code:
   180001000:	f2 0f 10 15 00 70 0c 	movsd  0xc7000(%rip),%xmm2        # 0x1800c8008
   180001007: 00
   180001008: f2 0f 10 05 00 70 0c movsd  0xc7000(%rip),%xmm0        # 0x1800c8010
   18000100f: 00
   180001010: b8 3c 00 00 00        mov    $0x3c,%eax
   180001015: 0f 28 ca              movaps %xmm2,%xmm1
   180001018: a8 01                test   $0x1,%al
   18000101a: 74 04                je     0x180001020
   18000101c: f2 0f 59 c8          mulsd  %xmm0,%xmm1
   180001020: d1 e8                shr    %eax
   180001022: 74 06                je     0x18000102a
   180001024: f2 0f 59 c0          mulsd  %xmm0,%xmm0
   180001028: eb ee                jmp    0x180001018
   18000102a: f2 0f 5e d1          divsd  %xmm1,%xmm2
   18000102e: f2 0f 11 15 6a 80 0c movsd  %xmm2,0xc806a(%rip)        # 0x1800c90a0
   180001035: 00
   180001036: c3                    retq   
   180001037: cc                    int3   
   180001038: cc                    int3   
   180001039: cc                    int3   
   18000103a: cc                    int3   
   18000103b: cc                    int3   
   18000103c: cc                    int3   
   18000103d: cc                    int3   
   18000103e: cc                    int3   
   18000103f: cc                    int3   

this is some output from objdump, mm64.dll makes 20k+ lines of asm code

with debug information, an un-stripped object should reproduce all labels and jump offsets