Skip to content

Instantly share code, notes, and snippets.

@rygorous
Last active October 16, 2024 00:57
Show Gist options
  • Save rygorous/9bb5149ea859962a7351488f5d748cb4 to your computer and use it in GitHub Desktop.
Save rygorous/9bb5149ea859962a7351488f5d748cb4 to your computer and use it in GitHub Desktop.
00000000000001BC: D2802009 mov x9,#0x100
00000000000001C0: F2C00809 movk x9,#0x40,lsl #0x20
00000000000001C4: F90003E9 str x9,[sp]
00000000000001C8: D2800209 mov x9,#0x10
00000000000001CC: F2C00089 movk x9,#4,lsl #0x20
00000000000001D0: F90007E9 str x9,[sp,#8]
00000000000001D4: 58000869 ldr x9,$LN356
00000000000001D8: F9000BE9 str x9,[sp,#0x10]
00000000000001DC: 58000869 ldr x9,$LN357
00000000000001E0: F9000FE9 str x9,[sp,#0x18]
00000000000001E4: 52806009 mov w9,#0x300
00000000000001E8: 72A120C9 movk w9,#0x906,lsl #0x10
00000000000001EC: AD406FFE ldp q30,q27,[sp]
00000000000001F0: 4E040D3F dup v31.4s,w9
which is generated from three constants:
Vec128_S16(1<<8, 0, 1<<6, 0, 1<<4, 0, 1<<2, 0) (ends up in v30)
Vec128_U8(1,1,1,1, 5,5,5,5, 9,9,9,9, 13,13,13,13) (ends up in v27)
Vec128_U8(0,3,6,9, 0,3,6,9, 0,3,6,9, 0,3,6,9) (ends up in v31)
and could be something like this instead:
adrp x9, $CPOOL
add x9, x9, :lo12:$CPOOL
ldp q30, q27, [x9]
ldr q31, [x9, #0x20]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment