From d3f2505677c3a8cd40c6dbc4bf32cfe4427aab20 Mon Sep 17 00:00:00 2001 From: Mitchell Johnson Date: Sun, 4 Sep 2022 19:52:22 -0400 Subject: Add some additional 32-bit thumb branch decode test cases --- tests/armv7/thumb.rs | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tests/armv7/thumb.rs b/tests/armv7/thumb.rs index 8e1796d..33911d2 100644 --- a/tests/armv7/thumb.rs +++ b/tests/armv7/thumb.rs @@ -728,17 +728,39 @@ fn test_decode_bcc_cases() { } #[test] fn test_decode_32b_branch_cases() { - // encoding t4 test_display( &[0xf3, 0xf7, 0x7c, 0xbe], "b.w $-0xc308" ); - // encoding t4 test_display( &[0x0c, 0xf0, 0x84, 0xb9], "b.w $+0xc308" ); test_display( + &[0x00, 0xf4, 0x00, 0x90], + "b.w $-0x1000000" + ); + test_display( + &[0xff, 0xf3, 0xff, 0x97], + "b.w $+0xfffffe" + ); + test_display( + &[0x00, 0xf4, 0x00, 0xc0], + "blx.w $-0x1000000" + ); + test_display( + &[0xff, 0xf3, 0xfe, 0xc7], + "blx.w $+0xfffffc" + ); + test_display( + &[0x00, 0xf4, 0x00, 0xd0], + "bl.w $-0x1000000" + ); + test_display( + &[0xff, 0xf3, 0xff, 0xd7], + "bl.w $+0xfffffe" + ); + test_display( &[0x3f, 0xf4, 0xfe, 0xaf], "b.weq $-0x4" ); @@ -1429,6 +1451,10 @@ fn test_decode_cmp_cases() { &[0xff, 0x45], "cmp pc, pc" ); + test_display( + &[0xb4, 0xeb, 0x55, 0x4f], + "cmp.w r4, r5, lsr 17" + ); } #[test] fn test_decode_it_cases() { -- cgit v1.1