Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix asm.pseudo for arm64's movk ##disasm #23014

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions libr/arch/p/arm/pseudo.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* radare - LGPL - Copyright 2015-2022 - pancake */
/* radare - LGPL - Copyright 2015-2024 - pancake */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <r_lib.h>
#include <r_util.h>
#include <r_flag.h>
Expand Down Expand Up @@ -85,8 +82,8 @@ static int replace(int argc, const char *argv[], char *newstr) {
{ 0, "fmov", "# = #", { 1, 2 } },
{ 0, "mvn", "# = ~#", { 1, 2 } },
{ 0, "movz", "# = #", { 1, 2 } },
{ 4, "movk", "# = # # #", { 1, 2, 3, 4 } },
{ 0, "movk", "# = #", { 1, 2 } },
// { 4, "movk", "# = # # #", { 1, 2, 3, 4 } },
{ 3, "movk", "# = # #", { 1, 2, 3 } },
{ 0, "movn", "# = ~#", { 1, 2 } },
{ 0, "neg", "# = !#", { 1, 2 } },
{ 0, "sxtw", "# = #", { 1, 2 } },
Expand Down
19 changes: 19 additions & 0 deletions test/db/cmd/cmd_pdc
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,22 @@ int sym.func.100003a54 (int x0, int x1) {
EOF
RUN

NAME=movk pseudo
FILE=-
CMDS=<<EOF
-a arm
-b 64
wx 018d8e520101a872
pd 2
?e --
e asm.pseudo=true
pd 2
EOF
EXPECT=<<EOF
0x00000000 018d8e52 mov w1, 0x7468 ; 'ht'
0x00000004 0101a872 movk w1, 0x4008, lsl 16
--
0x00000000 018d8e52 w1 = 0x7468 ; 'ht'
0x00000004 0101a872 w1 = 0x4008 << 16
EOF
RUN
Loading