1 |
6 |
skordal |
# See LICENSE for license details.
|
2 |
|
|
|
3 |
|
|
#*****************************************************************************
|
4 |
|
|
# xor.S
|
5 |
|
|
#-----------------------------------------------------------------------------
|
6 |
|
|
#
|
7 |
|
|
# Test xor instruction.
|
8 |
|
|
#
|
9 |
|
|
|
10 |
|
|
#include "riscv_test.h"
|
11 |
|
|
#include "test_macros.h"
|
12 |
|
|
|
13 |
|
|
RVTEST_RV32U
|
14 |
|
|
RVTEST_CODE_BEGIN
|
15 |
|
|
|
16 |
|
|
#-------------------------------------------------------------
|
17 |
|
|
# Logical tests
|
18 |
|
|
#-------------------------------------------------------------
|
19 |
|
|
|
20 |
|
|
TEST_RR_OP( 2, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
21 |
|
|
TEST_RR_OP( 3, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 );
|
22 |
|
|
TEST_RR_OP( 4, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f );
|
23 |
|
|
TEST_RR_OP( 5, xor, 0x00ff00ff, 0xf00ff00f, 0xf0f0f0f0 );
|
24 |
|
|
|
25 |
|
|
#-------------------------------------------------------------
|
26 |
|
|
# Source/Destination tests
|
27 |
|
|
#-------------------------------------------------------------
|
28 |
|
|
|
29 |
|
|
TEST_RR_SRC1_EQ_DEST( 6, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
30 |
|
|
TEST_RR_SRC2_EQ_DEST( 7, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
31 |
|
|
TEST_RR_SRC12_EQ_DEST( 8, xor, 0x00000000, 0xff00ff00 );
|
32 |
|
|
|
33 |
|
|
#-------------------------------------------------------------
|
34 |
|
|
# Bypassing tests
|
35 |
|
|
#-------------------------------------------------------------
|
36 |
|
|
|
37 |
|
|
TEST_RR_DEST_BYPASS( 9, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
38 |
|
|
TEST_RR_DEST_BYPASS( 10, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 );
|
39 |
|
|
TEST_RR_DEST_BYPASS( 11, 2, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f );
|
40 |
|
|
|
41 |
|
|
TEST_RR_SRC12_BYPASS( 12, 0, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
42 |
|
|
TEST_RR_SRC12_BYPASS( 13, 0, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 );
|
43 |
|
|
TEST_RR_SRC12_BYPASS( 14, 0, 2, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f );
|
44 |
|
|
TEST_RR_SRC12_BYPASS( 15, 1, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
45 |
|
|
TEST_RR_SRC12_BYPASS( 16, 1, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 );
|
46 |
|
|
TEST_RR_SRC12_BYPASS( 17, 2, 0, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f );
|
47 |
|
|
|
48 |
|
|
TEST_RR_SRC21_BYPASS( 18, 0, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
49 |
|
|
TEST_RR_SRC21_BYPASS( 19, 0, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 );
|
50 |
|
|
TEST_RR_SRC21_BYPASS( 20, 0, 2, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f );
|
51 |
|
|
TEST_RR_SRC21_BYPASS( 21, 1, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f );
|
52 |
|
|
TEST_RR_SRC21_BYPASS( 22, 1, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 );
|
53 |
|
|
TEST_RR_SRC21_BYPASS( 23, 2, 0, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f );
|
54 |
|
|
|
55 |
|
|
TEST_RR_ZEROSRC1( 24, xor, 0xff00ff00, 0xff00ff00 );
|
56 |
|
|
TEST_RR_ZEROSRC2( 25, xor, 0x00ff00ff, 0x00ff00ff );
|
57 |
|
|
TEST_RR_ZEROSRC12( 26, xor, 0 );
|
58 |
|
|
TEST_RR_ZERODEST( 27, xor, 0x11111111, 0x22222222 );
|
59 |
|
|
|
60 |
|
|
TEST_PASSFAIL
|
61 |
|
|
|
62 |
|
|
RVTEST_CODE_END
|
63 |
|
|
|
64 |
|
|
.data
|
65 |
|
|
RVTEST_DATA_BEGIN
|
66 |
|
|
|
67 |
|
|
TEST_DATA
|
68 |
|
|
|
69 |
|
|
RVTEST_DATA_END
|