• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 10 11 12 13 14 ... 117 Next »

Compiling Win32 ARM64
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Compiling Win32 ARM64
03-29-2018, 08:24 PM
#13
Gerdya Offline
Junior Member
**
Posts: 20
Threads: 1
Joined: Mar 2018
(03-29-2018, 05:08 PM)degasus Wrote: Oh nice. You've made my day. Feel free to create PRs for such patches. About your JIT issue, just revert https://github.com/dolphin-emu/dolphin/pull/4204 and it may work. Our libc cache invalidation was broken on Exynos as they have different cache line sizes on the big/little cluster.

I did make an assembly implementation for flush. It should reflect pretty much the C/intrinsic version (unless i made a mistake).


Code:
    EXPORT    |_FlushIcacheSection|

    AREA    |.text$mn|, CODE, ARM64
    
|_FlushIcacheSection| PROC
    mrs   x3, CTR_EL0                            ;x3 = ctr_el0
    mov   x5, #4
    mov   x6, #0xf
    and   x4, x3, x6                        
    lsl   x4, x5, x4                            ; isize = 4 << ((ctr_el0 >> 0) & 0xf) -> x4
    and   x3, x6, x3, lsr #16
    lsl   x3, x5, x3                            ; dsize = 4 << ((ctr_el0 >> 16) & 0xf) -> x3
    sub   x5, x31, x3
    and   x6, x0, x5                            ; addr = (u64)start & ~(u64)(dsize - 1);
dcache
    dc    civac, x6
    add   x6, x6, x3                            ; addr += dsize
    cmp   x6, x1
    blt   dcache                                    ; addr < end
    dsb   ish
    sub   x5, x31, x4
    and   x6, x0, x5                            ; addr = (u64)start & ~(u64)(isize - 1);
icache
    ic    ivau, x6
    add   x6, x6, x4                            ; addr += isize
    cmp   x6, x1                                    
    blt   icache                                    ; addr < end
    dsb   ish
    isb
    ret
    ENDP  ; |_FlushIcacheSection|

    END

It does ask for both cache lines size of I$ and D$ via CTR_EL0. 
And then modified ARM64XEmitter:

Code:
void ARM64XEmitter::FlushIcacheSection(u8* start, u8* end)
{
 if (start == end)
   return;

#if defined(IOS)
 // Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
 sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
#elif defined _MSC_VER
 //MSC does not support inline assembly for ARM64
 //instead an assembly implementation in Arm64Emitter_util.asm is called
 _FlushIcacheSection(start, end);
#else

But i still get a Bluescreen when enabling JIT. Well i need to wait for device since debugging with QEmu is not possible at the moment.
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Compiling Win32 ARM64 - Gerdya - 03-26-2018, 12:41 AM
RE: Compiling Win32 ARM64 - JosJuice - 03-26-2018, 01:22 AM
RE: Compiling Win32 ARM64 - Gerdya - 03-26-2018, 03:21 AM
RE: Compiling Win32 ARM64 - JosJuice - 03-26-2018, 03:38 AM
RE: Compiling Win32 ARM64 - Gerdya - 03-26-2018, 04:44 AM
RE: Compiling Win32 ARM64 - Gerdya - 03-26-2018, 05:42 AM
RE: Compiling Win32 ARM64 - degasus - 03-27-2018, 03:46 AM
RE: Compiling Win32 ARM64 - Gerdya - 03-28-2018, 06:29 AM
RE: Compiling Win32 ARM64 - mbc07 - 03-26-2018, 03:29 PM
RE: Compiling Win32 ARM64 - degasus - 03-27-2018, 09:43 PM
RE: Compiling Win32 ARM64 - Gerdya - 03-29-2018, 02:24 AM
RE: Compiling Win32 ARM64 - degasus - 03-29-2018, 05:08 PM
RE: Compiling Win32 ARM64 - Gerdya - 03-29-2018, 08:24 PM
RE: Compiling Win32 ARM64 - degasus - 03-29-2018, 08:39 PM
RE: Compiling Win32 ARM64 - gilius - 04-02-2018, 06:56 AM
RE: Compiling Win32 ARM64 - Nintonito - 04-17-2018, 08:22 AM
RE: Compiling Win32 ARM64 - Gerdya - 04-24-2018, 04:27 AM
RE: Compiling Win32 ARM64 - degasus - 04-24-2018, 06:05 AM
RE: Compiling Win32 ARM64 - Gerdya - 04-24-2018, 06:29 AM
RE: Compiling Win32 ARM64 - degasus - 04-24-2018, 06:32 AM
RE: Compiling Win32 ARM64 - Gerdya - 04-24-2018, 08:12 AM
RE: Compiling Win32 ARM64 - JonnyH - 04-24-2018, 09:05 AM
RE: Compiling Win32 ARM64 - Gerdya - 04-24-2018, 10:32 AM
RE: Compiling Win32 ARM64 - degasus - 04-25-2018, 07:39 AM
RE: Compiling Win32 ARM64 - Gerdya - 05-02-2018, 04:20 AM
RE: Compiling Win32 ARM64 - degasus - 05-02-2018, 05:18 AM
RE: Compiling Win32 ARM64 - Gerdya - 05-02-2018, 08:21 AM
RE: Compiling Win32 ARM64 - degasus - 05-02-2018, 03:35 PM
RE: Compiling Win32 ARM64 - Gerdya - 05-14-2018, 08:09 PM
RE: Compiling Win32 ARM64 - degasus - 05-14-2018, 08:24 PM
RE: Compiling Win32 ARM64 - Gerdya - 05-15-2018, 03:04 AM
RE: Compiling Win32 ARM64 - Gerdya - 07-16-2018, 03:45 AM
RE: Compiling Win32 ARM64 - JMC47 - 07-16-2018, 08:05 AM
RE: Compiling Win32 ARM64 - degasus - 07-16-2018, 05:20 PM
RE: Compiling Win32 ARM64 - Gerdya - 07-17-2018, 08:03 AM
RE: Compiling Win32 ARM64 - Helios - 07-17-2018, 08:42 AM
RE: Compiling Win32 ARM64 - Gerdya - 12-01-2019, 11:55 PM
RE: Compiling Win32 ARM64 - MayImilae - 12-02-2019, 12:24 AM
RE: Compiling Win32 ARM64 - Gerdya - 12-02-2019, 02:51 AM
RE: Compiling Win32 ARM64 - dampflokfreund - 12-02-2019, 06:53 AM
RE: Compiling Win32 ARM64 - Gerdya - 12-02-2019, 08:16 AM
RE: Compiling Win32 ARM64 - MayImilae - 12-02-2019, 08:54 AM
RE: Compiling Win32 ARM64 - dampflokfreund - 12-12-2019, 10:46 PM
RE: Compiling Win32 ARM64 - Overhaul - 02-02-2020, 04:30 PM
RE: Compiling Win32 ARM64 - degasus - 02-04-2020, 01:22 AM
RE: Compiling Win32 ARM64 - Overhaul - 02-04-2020, 05:58 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode