1//+build !noasm !appengine
2
3// (C2GOASM doesn't work correctly for Arm64)
4// func _levels_to_bitmap_neon(levels unsafe.Pointer, numLevels int, rhs int16) (res uint64)
5TEXT ยท_levels_to_bitmap_neon(SB), $0-32
6
7 MOVD levels+0(FP), R0
8 MOVD numLevels+8(FP), R1
9 MOVD rhs+16(FP), R2
10
11 WORD $0xa9bf7bfd // stp x29, x30, [sp, #-16]!
12 WORD $0x7100043f // cmp w1, #1
13 WORD $0x910003fd // mov x29, sp
14 BLT LBB1_3
15
16 WORD $0x71000c3f // cmp w1, #3
17 WORD $0x2a0103e9 // mov w9, w1
18 BHI LBB1_4
19 WORD $0xaa1f03ea // mov x10, xzr
20 WORD $0xaa1f03e8 // mov x8, xzr
21 JMP LBB1_7
22LBB1_3:
23 WORD $0xaa1f03e8 // mov x8, xzr
24 JMP LBB1_8
25LBB1_4:
26 VMOVQ $0x0000000000000000, $0x0000000000000001, V1 // adrp x11, .LCPI1_0; ldr q1, [x11, :lo12:.LCPI1_0]
27 WORD $0x5280004b // mov w11, #2
28 WORD $0x0e040c43 // dup v3.2s, w2
29 WORD $0x4e080d62 // dup v2.2d, x11
30 WORD $0x5280002b // mov w11, #1
31 WORD $0x927e752a // and x10, x9, #0xfffffffc
32 WORD $0x0f305464 // shl v4.2s, v3.2s, #16
33 WORD $0x4e080d63 // dup v3.2d, x11
34 WORD $0x5280008b // mov w11, #4
35 WORD $0x91001008 // add x8, x0, #4
36 WORD $0x6f00e400 // movi v0.2d, #0000000000000000
37 WORD $0x0f300484 // sshr v4.2s, v4.2s, #16
38 WORD $0x4e080d65 // dup v5.2d, x11
39 WORD $0xaa0a03eb // mov x11, x10
40 WORD $0x6f00e406 // movi v6.2d, #0000000000000000
41LBB1_5:
42 WORD $0x78dfc10c // ldursh w12, [x8, #-4]
43 WORD $0x79c0010d // ldrsh w13, [x8]
44 WORD $0x78dfe10e // ldursh w14, [x8, #-2]
45 WORD $0x4ee28431 // add v17.2d, v1.2d, v2.2d
46 WORD $0x1e270187 // fmov s7, w12
47 WORD $0x79c0050c // ldrsh w12, [x8, #2]
48 WORD $0x1e2701b0 // fmov s16, w13
49 WORD $0x4e0c1dc7 // mov v7.s[1], w14
50 WORD $0x0ea434e7 // cmgt v7.2s, v7.2s, v4.2s
51 WORD $0x4e0c1d90 // mov v16.s[1], w12
52 WORD $0x0ea43610 // cmgt v16.2s, v16.2s, v4.2s
53 WORD $0x2f20a4e7 // ushll v7.2d, v7.2s, #0
54 WORD $0x2f20a610 // ushll v16.2d, v16.2s, #0
55 WORD $0x4e231ce7 // and v7.16b, v7.16b, v3.16b
56 WORD $0x4e231e10 // and v16.16b, v16.16b, v3.16b
57 WORD $0x6ee144e7 // ushl v7.2d, v7.2d, v1.2d
58 WORD $0x6ef14610 // ushl v16.2d, v16.2d, v17.2d
59 WORD $0xf100116b // subs x11, x11, #4
60 WORD $0x4ee58421 // add v1.2d, v1.2d, v5.2d
61 WORD $0x4ea01ce0 // orr v0.16b, v7.16b, v0.16b
62 WORD $0x4ea61e06 // orr v6.16b, v16.16b, v6.16b
63 WORD $0x91002108 // add x8, x8, #8
64 BNE LBB1_5
65 WORD $0x4ea01cc0 // orr v0.16b, v6.16b, v0.16b
66 WORD $0x4e180401 // dup v1.2d, v0.d[1]
67 WORD $0x4ea11c00 // orr v0.16b, v0.16b, v1.16b
68 WORD $0xeb09015f // cmp x10, x9
69 WORD $0x9e660008 // fmov x8, d0
70 BEQ LBB1_8
71LBB1_7:
72 WORD $0x78ea780b // ldrsh w11, [x0, x10, lsl #1]
73 WORD $0x6b22a17f // cmp w11, w2, sxth
74 WORD $0x1a9fd7eb // cset w11, gt
75 WORD $0x9aca216b // lsl x11, x11, x10
76 WORD $0x9100054a // add x10, x10, #1
77 WORD $0xeb0a013f // cmp x9, x10
78 WORD $0xaa080168 // orr x8, x11, x8
79 BNE LBB1_7
80LBB1_8:
81 WORD $0xa8c17bfd // ldp x29, x30, [sp], #16
82 MOVD R8, res+24(FP)
83 RET
84
View as plain text