Skip to content

Instantly share code, notes, and snippets.

@EgorBo
Created December 20, 2020 16:23
Show Gist options
  • Save EgorBo/d8a643cd67e7347c7744183f9e2b9cff to your computer and use it in GitHub Desktop.
Save EgorBo/d8a643cd67e7347c7744183f9e2b9cff to your computer and use it in GitHub Desktop.
xand-xor-old.asm
; Method InterlockedImpl:XAnd64(byref,long):long
G_M46586_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp,#-16]!
910003FD mov fp, sp
;; bbWeight=1 PerfScore 1.50
G_M46586_IG02: ;; offset=0008H
F9400002 ldr x2, [x0]
;; bbWeight=1 PerfScore 3.00
G_M46586_IG03: ;; offset=000CH
8A010043 and x3, x2, x1
;; bbWeight=4 PerfScore 2.00
G_M46586_IG04: ;; offset=0010H
C85FFC05 ldaxr x5, [x0]
EB0200BF cmp x5, x2
54000061 bne G_M46586_IG05
C804FC03 stlxr w4, x3, [x0]
35FFFF84 cbnz w4, G_M46586_IG04
;; bbWeight=4 PerfScore 34.00
G_M46586_IG05: ;; offset=0024H
D5033BBF dmb ish
EB0200BF cmp x5, x2
54000060 beq G_M46586_IG07
;; bbWeight=4 PerfScore 46.00
G_M46586_IG06: ;; offset=0030H
AA0503E2 mov x2, x5
17FFFFF6 b G_M46586_IG03
;; bbWeight=2 PerfScore 3.00
G_M46586_IG07: ;; offset=0038H
AA0503E0 mov x0, x5
;; bbWeight=1 PerfScore 0.50
G_M46586_IG08: ;; offset=003CH
A8C17BFD ldp fp, lr, [sp],#16
D65F03C0 ret lr
;; bbWeight=1 PerfScore 2.00
; Total bytes of code: 68
; Method InterlockedImpl:XAnd64_noret(byref,long)
G_M59447_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp,#-16]!
910003FD mov fp, sp
;; bbWeight=1 PerfScore 1.50
G_M59447_IG02: ;; offset=0008H
F9400002 ldr x2, [x0]
;; bbWeight=1 PerfScore 3.00
G_M59447_IG03: ;; offset=000CH
8A010043 and x3, x2, x1
;; bbWeight=4 PerfScore 2.00
G_M59447_IG04: ;; offset=0010H
C85FFC05 ldaxr x5, [x0]
EB0200BF cmp x5, x2
54000061 bne G_M59447_IG05
C804FC03 stlxr w4, x3, [x0]
35FFFF84 cbnz w4, G_M59447_IG04
;; bbWeight=4 PerfScore 34.00
G_M59447_IG05: ;; offset=0024H
D5033BBF dmb ish
EB0200BF cmp x5, x2
54000060 beq G_M59447_IG07
;; bbWeight=4 PerfScore 46.00
G_M59447_IG06: ;; offset=0030H
AA0503E2 mov x2, x5
17FFFFF6 b G_M59447_IG03
;; bbWeight=2 PerfScore 3.00
G_M59447_IG07: ;; offset=0038H
A8C17BFD ldp fp, lr, [sp],#16
D65F03C0 ret lr
;; bbWeight=1 PerfScore 2.00
; Total bytes of code: 64
; Method InterlockedImpl:XOr64(byref,long):long
G_M16012_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp,#-16]!
910003FD mov fp, sp
;; bbWeight=1 PerfScore 1.50
G_M16012_IG02: ;; offset=0008H
F9400002 ldr x2, [x0]
;; bbWeight=1 PerfScore 3.00
G_M16012_IG03: ;; offset=000CH
AA010043 orr x3, x2, x1
;; bbWeight=4 PerfScore 2.00
G_M16012_IG04: ;; offset=0010H
C85FFC05 ldaxr x5, [x0]
EB0200BF cmp x5, x2
54000061 bne G_M16012_IG05
C804FC03 stlxr w4, x3, [x0]
35FFFF84 cbnz w4, G_M16012_IG04
;; bbWeight=4 PerfScore 34.00
G_M16012_IG05: ;; offset=0024H
D5033BBF dmb ish
EB0200BF cmp x5, x2
54000060 beq G_M16012_IG07
;; bbWeight=4 PerfScore 46.00
G_M16012_IG06: ;; offset=0030H
AA0503E2 mov x2, x5
17FFFFF6 b G_M16012_IG03
;; bbWeight=2 PerfScore 3.00
G_M16012_IG07: ;; offset=0038H
AA0503E0 mov x0, x5
;; bbWeight=1 PerfScore 0.50
G_M16012_IG08: ;; offset=003CH
A8C17BFD ldp fp, lr, [sp],#16
D65F03C0 ret lr
;; bbWeight=1 PerfScore 2.00
; Total bytes of code: 68
; Method InterlockedImpl:XOr64_noret(byref,long)
G_M35329_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp,#-16]!
910003FD mov fp, sp
;; bbWeight=1 PerfScore 1.50
G_M35329_IG02: ;; offset=0008H
F9400002 ldr x2, [x0]
;; bbWeight=1 PerfScore 3.00
G_M35329_IG03: ;; offset=000CH
AA010043 orr x3, x2, x1
;; bbWeight=4 PerfScore 2.00
G_M35329_IG04: ;; offset=0010H
C85FFC05 ldaxr x5, [x0]
EB0200BF cmp x5, x2
54000061 bne G_M35329_IG05
C804FC03 stlxr w4, x3, [x0]
35FFFF84 cbnz w4, G_M35329_IG04
;; bbWeight=4 PerfScore 34.00
G_M35329_IG05: ;; offset=0024H
D5033BBF dmb ish
EB0200BF cmp x5, x2
54000060 beq G_M35329_IG07
;; bbWeight=4 PerfScore 46.00
G_M35329_IG06: ;; offset=0030H
AA0503E2 mov x2, x5
17FFFFF6 b G_M35329_IG03
;; bbWeight=2 PerfScore 3.00
G_M35329_IG07: ;; offset=0038H
A8C17BFD ldp fp, lr, [sp],#16
D65F03C0 ret lr
;; bbWeight=1 PerfScore 2.00
; Total bytes of code: 64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment