17 September 2015, 00:01 | #1 |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
FS-UAE / WinUAE x86-64 JIT Compiler
This is the main thread for issues and testing related to the new x86-64 JIT compiler () in FS-UAE/WinUAE.
In order to test the 64-bit JIT compiler you need a 64-bit version of FS-UAE (2.7.0dev or newer) or a 64-bit version of WinUAE (3.2.0 beta 13 or newer). JIT should automatically be available the same way it is in 32-bit versions of *UAE. But always test with the latest versions available, of course. This isn't a "new JIT compiler" as such, it is a modification of the old one (including a big merge of JIT code from the ARAnyM project, and fixing UAE-specific code for x86-64). As such, it is possible that the JIT support in the 32-bit FS-UAE/WinUAE is worse (or better) than before. So, if you discover that stuff stops working in the 32-bit versions (which worked well in previous beta/development versions), you are also encouraged to report that here. In fact, the ideal testing procedure if you experience a problem with the 64-bit JIT compiler is: - Test if the same problem occurs with the "new 32-bit JIT compiler". - If so, test if the same problem occurs with the "old 32-bit JIT compiler" (in earlier versions of FS-UAE or WinUAE). (If you experience WinUAE (or FS-UAE) 64-bit issues which has nothing to do with JIT, this is not the correct thread!). 64-bit versions of FS-UAE for OS X and Windows will be released as part of 2.7.1dev (soon-ish). Happy testing Last edited by FrodeSolheim; 01 April 2016 at 00:31. |
17 September 2015, 18:01 | #2 | |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 467
|
Quote:
Can it work for 68000 cpu also? |
|
18 September 2015, 11:11 | #3 | |
Registered User
Join Date: Apr 2012
Location: germany
Posts: 139
|
Quote:
if it not work, you can set breakpoints in debugger at functions Code:
static inline void emit_byte(uae_u8 x) static inline void emit_word(uae_u16 x) static inline void emit_long(uae_u32 x) static __inline__ void emit_quad(uae_u64 x) and then when you use go(let breakpoints allways on) , you can see all that JIT output and look at asm output whats go wrong Last edited by FrodeSolheim; 18 September 2015 at 18:57. |
|
18 September 2015, 11:16 | #4 | |
Registered User
Join Date: Apr 2012
Location: germany
Posts: 139
|
Quote:
|
|
18 September 2015, 19:02 | #5 | |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
Quote:
JIT is explicitly unavailable for 68000. I'm not familiar with all the reasons. One reason can be due to minor CPU differences. Another can be that it is considered pointless, since you often want accurate-ish emulation when using 68000, and JIT will not give any kind of accurate CPU-chipset synchronization... (In any case, I don't plan to do anything about it). I know, I have had to resort to this several times (latest occurrence yesterday evening) |
|
19 September 2015, 09:56 | #6 |
Registered User
Join Date: Apr 2012
Location: germany
Posts: 139
|
JIT for 68000 CPU i think too is not usefull. because a PC is lots faster as 68000 CPU and any programs that need more speed work with 68020+ CPU, because a real 68000 CPU give not enough speed, so programmer always do a 68020+FPU versio
|
19 September 2015, 19:18 | #7 |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 467
|
Compiled from future branch now (currently at 9e807589eb). Unfortunately it doesn't run well. Tried different configs, jit direct/indirect - no change. Workbench starts, but applications do not run or behave incorrectly. Sometimes fs-uae crashes. Last tested version (from jit2 branch) worked much better. Log attached.
|
19 September 2015, 19:24 | #8 |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
If you want to help... what would really help is to find the first commit where your experience these problems (i.e. work your way backwards through the latest commits...)
|
19 September 2015, 19:52 | #9 |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
I forgot to mention one thing, JIT FPU is enabled in the latest commits, and this might not work properly for 64-bit yet. Please disable with --uae-compfpu=0 and see if this helps!
|
19 September 2015, 23:13 | #10 | |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 467
|
Quote:
With the 32-bit executable this option is not needed, but fonts of Amikit startmenu look bad if uae_compfpu=0 not set. Does the jit-fpu-compiler have lower accuracy or is it somewhat faulty? Last edited by jbl007; 19 September 2015 at 23:29. |
|
20 September 2015, 00:03 | #11 |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
64-bit JIT FPU being broken wasn't surprising. This code hasn't been checked for 64-bit compatibility yet. So in future commits, comfpu option will default to 0 for 64-bit versions.
Regarding the 32-bit JTI FPU and the font rendering - does "future version" behave worse than the current development version? Or is the behavior the same? Regarding accuracy, an important point is that there's completely different code involved with interpreter FPU emulation and JIT FPU emulation. I don't know if the JIT FPU is supposed to have the same accuracy. But there is an additional option, you can try Code:
uae_fpu_strict = 1 Last edited by FrodeSolheim; 20 September 2015 at 01:56. Reason: Fixed typo, should be uae_fpu_strict |
20 September 2015, 02:23 | #12 |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
Found the issue causing the rendering problem, will push fix tomorrow
|
20 September 2015, 11:14 | #13 | |
Registered User
Join Date: Apr 2012
Location: germany
Posts: 139
|
Quote:
I know only 1 program that seem do heavy round precision tricks. its raytracer imagine. this do strange things when not exact is emulate. but a other program i do not know. uae always execute the first loop of a code sequence before branch instruction always with interpreter mode, but compile the block for JIT. Only when a branch back is taken, there is look if the block to which the branch back want jump is compile. if compile then the jit code is execute. also best is use only 68020/68881 first for 64 bit jit test. maybe problem come due to 68k fpu exception problem. the uae generate some files not in your source(gencomp), about which 68k commands work with JIT. so everybody who can compile can help to come near the problem. to find what is the problem with FPU, it is usefull to disable all other and first enable only if fmove commands work ok. if so then enable fbne commands and then more and more. so if the command can see, there can then a testprogram in 68k do, that verify the commands that let winuae crash more. if somebody can upload the uae generatet files, i can show in source how deactivate can work. it is more easy and more flexible and give much faster compile, when the generatet files are modify. but of course gencomp should not run, because it overwrite generatet hand modify files. if only fmove instructions are in jit compile can see, when see code at emit_xxxxx. instruction that are done by uae CPU emu can see that they contain a jump. Last edited by bernd roesch; 20 September 2015 at 11:21. |
|
20 September 2015, 22:43 | #14 |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
In the latest commits in the "future" branch:
- Fixed the font rendering issue with the 32-bit FPU JIT - The uae_compfpu setting defaults to 0 on x86-64 until some issues are fixed. (I have already fixed some 64-bit FPU JIT crashes locally, so AmiKit almost boots now with the 64-bit FPI JIT enabled, but I'll want to look more at it before pushing any commits). EDIT: future branch is merged into master (and removed). Last edited by FrodeSolheim; 20 September 2015 at 23:07. |
21 September 2015, 10:15 | #15 |
Registered User
Join Date: Apr 2012
Location: germany
Posts: 139
|
have you build a windows version with 64 bit for fs-uae ?. I can then test with hd-rec and fpu testprograms(that check rounding if all work ok, and maybe find FPU problem instructions.
what was the problem with 64 bit fpu support, in general ?. There is a define USE_X86_FPUCW this is normaly used. is this enable or disable in your 64 bit builds ? i do not remember that FPU JIT work really ok, when FPUCW is disable. I try long time ago a build without it, and i notice FPU work wrong and many programs. I did not search wy. x86 use diffrent default rounding as 68k and btw dont forget a testprogram need always run in a 2 times loop, only then the jit code is execute. thats important to know, because the testprograms need do loop. but correct working can check because 1 loop time output uae interpreter values, 2. loop output from JIT code. and output both values and see diffrence, show error |
21 September 2015, 10:48 | #16 |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 467
|
Yes, they are. I made a visual diff of 2 screenshots (old-jit, new-jit). I also generated some images with ChaosPro. No difference visible.
I exported a demo project with HD-Rec. Waveforms are different. This is visible in an audio editor using a very high zoom level. Difference is not hearable as far I can trust my ears. So precision for real world performance might be good enough. BTW. Results of old-jit/no-jit are identical (checksums match). Edit: I tested the 32bit versions. Looks like this is off topic in this thread now. ;-) |
21 September 2015, 18:27 | #17 |
Registered User
Join Date: Apr 2012
Location: germany
Posts: 139
|
If hd rec output is diffrent, this look as a rounding problem
hd-rec calculate all in float and then convert to integer. 68k FPU use in default rounding as everybody do when transfer to integer. 1.51 is round to 2. 1.49 is round to 1 0.99 is round to 1 but X86 do by default round only 0.99 to 1 maybe the exception handler of windows/linux part, change FPUCW, and do not restore rounding in the FPUCW Register when leave |
21 September 2015, 19:48 | #18 |
Registered User
Join Date: Jun 2012
Location: Austria
Posts: 76
|
What.... 64 Bit Jit?
That is AMAZING Can't wait to test it |
21 September 2015, 20:12 | #19 | |||
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
Quote:
Quote:
Quote:
The latest FPU issue/crash I investigated was related to fldcw_m_indexed. If all the 32-bit x86 registers were already allocated, and the JIT register allocation routine chose on of the R8..R15 registers on x86-64, this would fail horribly, since FLDCW cannot be used with these registers (issue is fixed). Yes, this is enabled. Last edited by FrodeSolheim; 21 September 2015 at 20:18. |
|||
22 September 2015, 10:15 | #20 |
Registered User
Join Date: Apr 2012
Location: germany
Posts: 139
|
good, i see in the JIT source that more registers are use, even it not work as before. I think for first test, do not use more registers as on old JIT. only when work, then use more. this make problems find more easy maybe there are more that do not work with more registers. and when all work, then can see, when increase register number when it fail, that there is another problem with more register. i think on X64 all specific commands that are selden used, do not work on R8-R15.
this i guess are also the fpu flag (that track greater, smaller of fpu compare), and maybe some other. JIT need load and store this register too |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
It seem the JIT direct mode is not work in fs-uae. direct mode is important | bernd roesch | support.FS-UAE | 27 | 20 September 2015 21:44 |
E-UAE PowerPC JIT v1.0.0 is here! | Puni/Void | Amiga scene | 0 | 02 January 2015 19:51 |
Question about the possibility of JIT in FS-UAE under Windows | SaphirJD | support.FS-UAE | 4 | 20 December 2013 22:08 |
FS-UAE - Why it have no JIT? | nexusle | support.FS-UAE | 19 | 13 May 2012 13:39 |
JIT on E-UAE PPC? | _ThEcRoW | support.OtherUAE | 8 | 06 May 2011 23:55 |
|
|