diff --git a/mach/mips/libem/com.s b/mach/mips/libem/com.s index fae0d64e5..ffabe9f5e 100644 --- a/mach/mips/libem/com.s +++ b/mach/mips/libem/com.s @@ -21,6 +21,7 @@ addiu r5, r5, 4 addiu r4, r4, -1 bne r4, zero, 1b + nop jr ra nop diff --git a/mach/mips/libem/xor.s b/mach/mips/libem/xor.s new file mode 100644 index 000000000..ad23b1d52 --- /dev/null +++ b/mach/mips/libem/xor.s @@ -0,0 +1,30 @@ +# +.sect .text; .sect .rom; .sect .data; .sect .bss + +/* + * Set xor.. + * Stack: ( a b size -- a^b ) + */ + +.sect .text +.define .xor +.xor: + lw r4, 0(sp) ! r4 = size + addiu sp, sp, 4 ! sp points at b + addu r5, sp, r4 ! r5 points at a + srl r4, r4, 2 ! r4 = count of words + +1: + lw at, 0(r5) ! load a + lw r6, 0(sp) ! load b + xor at, at, r6 ! combine + sw at, 0(r5) ! write back to a + addiu r5, r5, 4 + addiu sp, sp, 4 + addiu r4, r4, -1 + bne r4, zero, 1b + nop + + jr ra + nop + diff --git a/mach/mips/libem/zer.s b/mach/mips/libem/zer.s index 6941d340b..b48fb8ffc 100644 --- a/mach/mips/libem/zer.s +++ b/mach/mips/libem/zer.s @@ -18,6 +18,7 @@ sw zero, 0(sp) addiu r4, r4, -1 bne r4, zero, 1b + nop jr ra nop diff --git a/tests/plat/core/and_e.e b/tests/plat/core/and_e.e new file mode 100644 index 000000000..1bdf3d5ed --- /dev/null +++ b/tests/plat/core/and_e.e @@ -0,0 +1,54 @@ +# + mes 2, EM_WSIZE, EM_PSIZE + + exp $_m_a_i_n + pro $_m_a_i_n, 0 + + /* And word-sized set */ + +four + rom EM_WSIZE + + loc 32769 + loc 1 + loe four /* to defeat constant folding */ + and + loc 1 + cmu EM_WSIZE + zeq *1 + + loc __LINE__ + cal $fail + asp 4 +1 + + /* And triple-word-sized set */ + +four_by_three + rom EM_WSIZE*3 + + loc 32769 + loc 32770 + loc 32772 + loc 1 + loc 2 + loc 4 + loe four_by_three + and + loc 4 + cmu EM_WSIZE + zne *2 + loc 2 + cmu EM_WSIZE + zne *2 + loc 1 + cmu EM_WSIZE + zeq *3 +2 + loc __LINE__ + cal $fail + asp 4 +3 + + cal $finished + end diff --git a/tests/plat/core/ior_e.e b/tests/plat/core/ior_e.e new file mode 100644 index 000000000..9f4a0d985 --- /dev/null +++ b/tests/plat/core/ior_e.e @@ -0,0 +1,54 @@ +# + mes 2, EM_WSIZE, EM_PSIZE + + exp $_m_a_i_n + pro $_m_a_i_n, 0 + + /* Or word-sized set */ + +four + rom EM_WSIZE + + loc 0 + loc 1 + loe four /* to defeat constant folding */ + ior + loc 1 + cmu EM_WSIZE + zeq *1 + + loc __LINE__ + cal $fail + asp 4 +1 + + /* Or triple-word-sized set */ + +four_by_three + rom EM_WSIZE*3 + + loc 16 + loc 32 + loc 64 + loc 1 + loc 2 + loc 3 + loe four_by_three + ior + loc 67 + cmu EM_WSIZE + zne *2 + loc 34 + cmu EM_WSIZE + zne *2 + loc 17 + cmu EM_WSIZE + zeq *3 +2 + loc __LINE__ + cal $fail + asp 4 +3 + + cal $finished + end diff --git a/tests/plat/core/xor_e.e b/tests/plat/core/xor_e.e new file mode 100644 index 000000000..8218ee63c --- /dev/null +++ b/tests/plat/core/xor_e.e @@ -0,0 +1,54 @@ +# + mes 2, EM_WSIZE, EM_PSIZE + + exp $_m_a_i_n + pro $_m_a_i_n, 0 + + /* Xor word-sized set */ + +four + rom EM_WSIZE + + loc 32769 + loc 1 + loe four /* to defeat constant folding */ + xor + loc 32768 + cmu EM_WSIZE + zeq *1 + + loc __LINE__ + cal $fail + asp 4 +1 + + /* Xor triple-word-sized set */ + +four_by_three + rom EM_WSIZE*3 + + loc 32769 + loc 32770 + loc 32772 + loc 1 + loc 2 + loc 4 + loe four_by_three + xor + loc 32768 + cmu EM_WSIZE + zne *2 + loc 32768 + cmu EM_WSIZE + zne *2 + loc 32768 + cmu EM_WSIZE + zeq *3 +2 + loc __LINE__ + cal $fail + asp 4 +3 + + cal $finished + end