aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartyn Capewell <martyn.capewell@arm.com>2020-07-29 16:54:04 +0100
committerMartyn Capewell <martyn.capewell@arm.com>2020-07-29 16:55:37 +0100
commitf84b4643727572209374b58fdd88ef6c34913704 (patch)
tree62eca789689e05c52f160620782fa8e68f1265ac /test
parentaaf02c54f1f68153d769db26577317e1d4f46c1b (diff)
downloadvixl-f84b4643727572209374b58fdd88ef6c34913704.tar.gz
Revert optimisation for add/sub immediates
Removed due to some cases showing worse performance. Reverts: 960606b686f59d468f97dfa93b5dba5b2b38cc8f f3f5d246129febc518cfa99003ee66c5008202c5 Change-Id: I5b9585d112424d97e372bd264d084cb9caf92b5f
Diffstat (limited to 'test')
-rw-r--r--test/aarch64/test-disasm-aarch64.cc68
1 files changed, 6 insertions, 62 deletions
diff --git a/test/aarch64/test-disasm-aarch64.cc b/test/aarch64/test-disasm-aarch64.cc
index b9ee9912..0051d0c7 100644
--- a/test/aarch64/test-disasm-aarch64.cc
+++ b/test/aarch64/test-disasm-aarch64.cc
@@ -2746,25 +2746,6 @@ TEST(add_sub_negative) {
COMPARE_MACRO(Cmp(w2, -4095), "cmn w2, #0xfff (4095)");
COMPARE_MACRO(Cmp(x3, -4095), "cmn x3, #0xfff (4095)");
- int32_t temp32 = std::numeric_limits<int32_t>::min();
- COMPARE_MACRO(Cmp(w0, temp32),
- "mov w16, #0x80000000\n"
- "cmp w0, w16");
- COMPARE_MACRO(Cmp(w0, temp32 + 1),
- "mov w16, #0x7fffffff\n"
- "cmn w0, w16");
- COMPARE_MACRO(Cmp(x0, temp32),
- "mov x16, #0x80000000\n"
- "cmn x0, x16");
-
- int64_t temp64 = std::numeric_limits<int64_t>::min();
- COMPARE_MACRO(Cmp(x0, temp64),
- "mov x16, #0x8000000000000000\n"
- "cmp x0, x16");
- COMPARE_MACRO(Cmp(x0, temp64 + 1),
- "mov x16, #0x7fffffffffffffff\n"
- "cmn x0, x16");
-
COMPARE_MACRO(Cmn(w0, -1), "cmp w0, #0x1 (1)");
COMPARE_MACRO(Cmn(x1, -1), "cmp x1, #0x1 (1)");
COMPARE_MACRO(Cmn(w2, -4095), "cmp w2, #0xfff (4095)");
@@ -2777,61 +2758,24 @@ TEST(add_sub_macro) {
SETUP();
// Add and Sub use their destination register as a scratch if they can.
- COMPARE_MACRO(Add(x0, x1, 0x42424242),
+ COMPARE_MACRO(Add(x0, x1, 0x4242),
"mov x0, #0x4242\n"
- "movk x0, #0x4242, lsl #16\n"
"add x0, x1, x0");
- COMPARE_MACRO(Add(x0, x0, 0x42424242),
+ COMPARE_MACRO(Add(x0, x0, 0x4242),
"mov x16, #0x4242\n"
- "movk x16, #0x4242, lsl #16\n"
"add x0, x0, x16");
- COMPARE_MACRO(Adds(x0, x1, 0x4242),
- "mov x0, #0x4242\n"
- "adds x0, x1, x0");
- COMPARE_MACRO(Adds(x0, x0, 0x4242),
- "mov x16, #0x4242\n"
- "adds x0, x0, x16");
COMPARE_MACRO(Adds(x0, xzr, Operand(w1, SXTW)),
"sxtw x0, w1\n"
"adds x0, xzr, x0");
- COMPARE_MACRO(Subs(x0, x1, 0x42424242),
- "mov x0, #0x4242\n"
- "movk x0, #0x4242, lsl #16\n"
- "subs x0, x1, x0");
- COMPARE_MACRO(Subs(x0, x0, 0x42424242),
- "mov x16, #0x4242\n"
- "movk x16, #0x4242, lsl #16\n"
- "subs x0, x0, x16");
- COMPARE_MACRO(Subs(x0, x1, 0x4242),
+ COMPARE_MACRO(Sub(x0, x1, 0x4242),
"mov x0, #0x4242\n"
- "subs x0, x1, x0");
- COMPARE_MACRO(Subs(x0, x0, 0x4242),
+ "sub x0, x1, x0");
+ COMPARE_MACRO(Sub(x0, x0, 0x4242),
"mov x16, #0x4242\n"
- "subs x0, x0, x16");
+ "sub x0, x0, x16");
COMPARE_MACRO(Subs(x0, xzr, Operand(w1, SXTW)),
"sxtw x0, w1\n"
"negs x0, x0");
-
- // Add and Sub for immediates between 12 and 24 bits emits a pair of
- // instructions.
- COMPARE_MACRO(Add(x0, x0, 0x4242),
- "add x0, x0, #0x242 (578)\n"
- "add x0, x0, #0x4000 (16384)");
- COMPARE_MACRO(Add(x0, x1, 0x4242),
- "add x0, x1, #0x242 (578)\n"
- "add x0, x0, #0x4000 (16384)");
- COMPARE_MACRO(Add(x0, x0, 0xffffff),
- "add x0, x0, #0xfff (4095)\n"
- "add x0, x0, #0xfff000 (16773120)");
- COMPARE_MACRO(Sub(x0, x0, 0x4242),
- "sub x0, x0, #0x242 (578)\n"
- "sub x0, x0, #0x4000 (16384)");
- COMPARE_MACRO(Sub(x0, x1, 0x4242),
- "sub x0, x1, #0x242 (578)\n"
- "sub x0, x0, #0x4000 (16384)");
- COMPARE_MACRO(Sub(x0, x0, 0xffffff),
- "sub x0, x0, #0xfff (4095)\n"
- "sub x0, x0, #0xfff000 (16773120)");
}
TEST(adc_sbc_macro) {