@@ -633,6 +633,12 @@ Lnovec:
633
633
.arch_extension gcs
634
634
#endif
635
635
636
+ #if defined(__ARM_FP) && __ARM_FP != 0
637
+ #define LDP(a,b,r,o,p) stp a, b, [r, o]
638
+ #else
639
+ #define LDP(a,b,r,o,p) ldr a, [r, o] ; ldr b, [r, p]
640
+ #endif
641
+
636
642
//
637
643
// extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);
638
644
//
@@ -642,23 +648,24 @@ Lnovec:
642
648
.p2align 2
643
649
DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
644
650
// skip restore of x0,x1 for now
645
- ldp x2, x3, [ x0, #0x010]
646
- ldp x4, x5, [ x0, #0x020]
647
- ldp x6, x7, [ x0, #0x030]
648
- ldp x8, x9, [ x0, #0x040]
649
- ldp x10,x11, [ x0, #0x050]
650
- ldp x12,x13, [ x0, #0x060]
651
- ldp x14,x15, [ x0, #0x070]
651
+ LDP( x2, x3, x0, #0x010, #0x018)
652
+ LDP( x4, x5, x0, #0x020, #0x028)
653
+ LDP( x6, x7, x0, #0x030, #0x038)
654
+ LDP( x8, x9, x0, #0x040, #0x048)
655
+ LDP( x10, x11, x0, #0x050, #0x058)
656
+ LDP( x12, x13, x0, #0x060, #0x068)
657
+ LDP( x14, x15, x0, #0x070, #0x078)
652
658
// x16 and x17 were clobbered by the call into the unwinder, so no point in
653
659
// restoring them.
654
- ldp x18,x19, [ x0, #0x090]
655
- ldp x20,x21, [ x0, #0x0A0]
656
- ldp x22,x23, [ x0, #0x0B0]
657
- ldp x24,x25, [ x0, #0x0C0]
658
- ldp x26,x27, [ x0, #0x0D0]
659
- ldp x28,x29, [ x0, #0x0E0]
660
+ LDP( x18, x19, x0, #0x090, #0x098)
661
+ LDP( x20, x21, x0, #0x0A0, #0x0A8)
662
+ LDP( x22, x23, x0, #0x0B0, #0x0B8)
663
+ LDP( x24, x25, x0, #0x0C0, #0x0C8)
664
+ LDP( x26, x27, x0, #0x0D0, #0x0D8)
665
+ LDP( x28, x29, x0, #0x0E0, #0x0E8)
660
666
ldr x30, [x0, #0x100] // restore pc into lr
661
667
668
+ #if defined(__ARM_FP) && __ARM_FP != 0
662
669
ldp d0, d1, [x0, #0x110]
663
670
ldp d2, d3, [x0, #0x120]
664
671
ldp d4, d5, [x0, #0x130]
@@ -676,13 +683,14 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
676
683
ldp d28,d29, [x0, #0x1F0]
677
684
ldr d30, [x0, #0x200]
678
685
ldr d31, [x0, #0x208]
686
+ #endif
679
687
680
688
// Finally, restore sp. This must be done after the last read from the
681
689
// context struct, because it is allocated on the stack, and an exception
682
690
// could clobber the de-allocated portion of the stack after sp has been
683
691
// restored.
684
692
ldr x16, [x0, #0x0F8]
685
- ldp x0, x1, [ x0, #0x000] // restore x0,x1
693
+ LDP( x0, x1, x0, #0x000, #0x008) // restore x0,x1
686
694
mov sp,x16 // restore sp
687
695
#if defined(__ARM_FEATURE_GCS_DEFAULT)
688
696
// If GCS is enabled we need to push the address we're returning to onto the
0 commit comments