1# sh testcase for mac.w @${rm}+, @${rn}+ 2# mach: all 3# as: -isa=shcompact 4# ld: -m shelf32 5 6 .include "compact/testutils.inc" 7 8 start 9 10 # Store some magic numbers in memory. 11 mov #40, r1 12 shll8 r1 13 mov #85, r0 14 mov.l r0, @r1 15 # Keep for later. 16 mov r1, r10 17store2: 18 mov #40, r1 19 shll8 r1 20 add #12, r1 21 mov #17, r0 22 mov.l r0, @r1 23 # Keep for later. 24 mov r1, r11 25 26init: 27 # Set up addresses. 28 mov #40, r1 29 shll8 r1 30 mov #40, r2 31 shll8 r2 32 add #12, r2 33 34 # Prime {MACL, MACH} to #1. 35 mov #1, r3 36 dmulu.l r3, r3 37 38test: 39 mac.w @r1+, @r2+ 40 41check: 42 # Check result. 43 sts mach, r5 44 assert r5, #0 45 46 sts macl, r6 47 assert r6, #1 48 49 # Ensure post-increment occurred. 50 add #2, r10 51 cmp/eq r10, r1 52 bf wrong 53 54 add #2, r11 55 cmp/eq r11, r2 56 bf wrong 57 58doubleinc: 59 mov #40, r0 60 shll8 r0 61 mov r0, r1 62 mac.w @r0+, @r0+ 63 add #8, r1 64 cmp/eq r0, r1 65 bf wrong 66 67okay: 68 pass 69wrong: 70 fail 71