112771Sqtt2@cornell.edu# See LICENSE for license details. 212771Sqtt2@cornell.edu 312771Sqtt2@cornell.edu#***************************************************************************** 412771Sqtt2@cornell.edu# mulh.S 512771Sqtt2@cornell.edu#----------------------------------------------------------------------------- 612771Sqtt2@cornell.edu# 712771Sqtt2@cornell.edu# Test mulh instruction. 812771Sqtt2@cornell.edu# 912771Sqtt2@cornell.edu 1012771Sqtt2@cornell.edu#include "riscv_test.h" 1112771Sqtt2@cornell.edu#include "test_macros.h" 1212771Sqtt2@cornell.edu 1312771Sqtt2@cornell.eduRVTEST_RV64U 1412771Sqtt2@cornell.eduRVTEST_CODE_BEGIN 1512771Sqtt2@cornell.edu 1612771Sqtt2@cornell.edu #------------------------------------------------------------- 1712771Sqtt2@cornell.edu # Arithmetic tests 1812771Sqtt2@cornell.edu #------------------------------------------------------------- 1912771Sqtt2@cornell.edu 2012771Sqtt2@cornell.edu TEST_RR_OP( 2, mulh, 0x00000000, 0x00000000, 0x00000000 ); 2112771Sqtt2@cornell.edu TEST_RR_OP( 3, mulh, 0x00000000, 0x00000001, 0x00000001 ); 2212771Sqtt2@cornell.edu TEST_RR_OP( 4, mulh, 0x00000000, 0x00000003, 0x00000007 ); 2312771Sqtt2@cornell.edu 2412771Sqtt2@cornell.edu TEST_RR_OP( 5, mulh, 0x0000000000000000, 0x0000000000000000, 0xffffffffffff8000 ); 2512771Sqtt2@cornell.edu TEST_RR_OP( 6, mulh, 0x0000000000000000, 0xffffffff80000000, 0x00000000 ); 2612771Sqtt2@cornell.edu TEST_RR_OP( 7, mulh, 0x0000000000000000, 0xffffffff80000000, 0xffffffffffff8000 ); 2712771Sqtt2@cornell.edu 2812771Sqtt2@cornell.edu #------------------------------------------------------------- 2912771Sqtt2@cornell.edu # Source/Destination tests 3012771Sqtt2@cornell.edu #------------------------------------------------------------- 3112771Sqtt2@cornell.edu 3212771Sqtt2@cornell.edu TEST_RR_SRC1_EQ_DEST( 8, mulh, 143, 13<<32, 11<<32 ); 3312771Sqtt2@cornell.edu TEST_RR_SRC2_EQ_DEST( 9, mulh, 154, 14<<32, 11<<32 ); 3412771Sqtt2@cornell.edu TEST_RR_SRC12_EQ_DEST( 10, mulh, 169, 13<<32 ); 3512771Sqtt2@cornell.edu 3612771Sqtt2@cornell.edu #------------------------------------------------------------- 3712771Sqtt2@cornell.edu # Bypassing tests 3812771Sqtt2@cornell.edu #------------------------------------------------------------- 3912771Sqtt2@cornell.edu 4012771Sqtt2@cornell.edu TEST_RR_DEST_BYPASS( 11, 0, mulh, 143, 13<<32, 11<<32 ); 4112771Sqtt2@cornell.edu TEST_RR_DEST_BYPASS( 12, 1, mulh, 154, 14<<32, 11<<32 ); 4212771Sqtt2@cornell.edu TEST_RR_DEST_BYPASS( 13, 2, mulh, 165, 15<<32, 11<<32 ); 4312771Sqtt2@cornell.edu 4412771Sqtt2@cornell.edu TEST_RR_SRC12_BYPASS( 14, 0, 0, mulh, 143, 13<<32, 11<<32 ); 4512771Sqtt2@cornell.edu TEST_RR_SRC12_BYPASS( 15, 0, 1, mulh, 154, 14<<32, 11<<32 ); 4612771Sqtt2@cornell.edu TEST_RR_SRC12_BYPASS( 16, 0, 2, mulh, 165, 15<<32, 11<<32 ); 4712771Sqtt2@cornell.edu TEST_RR_SRC12_BYPASS( 17, 1, 0, mulh, 143, 13<<32, 11<<32 ); 4812771Sqtt2@cornell.edu TEST_RR_SRC12_BYPASS( 18, 1, 1, mulh, 154, 14<<32, 11<<32 ); 4912771Sqtt2@cornell.edu TEST_RR_SRC12_BYPASS( 19, 2, 0, mulh, 165, 15<<32, 11<<32 ); 5012771Sqtt2@cornell.edu 5112771Sqtt2@cornell.edu TEST_RR_SRC21_BYPASS( 20, 0, 0, mulh, 143, 13<<32, 11<<32 ); 5212771Sqtt2@cornell.edu TEST_RR_SRC21_BYPASS( 21, 0, 1, mulh, 154, 14<<32, 11<<32 ); 5312771Sqtt2@cornell.edu TEST_RR_SRC21_BYPASS( 22, 0, 2, mulh, 165, 15<<32, 11<<32 ); 5412771Sqtt2@cornell.edu TEST_RR_SRC21_BYPASS( 23, 1, 0, mulh, 143, 13<<32, 11<<32 ); 5512771Sqtt2@cornell.edu TEST_RR_SRC21_BYPASS( 24, 1, 1, mulh, 154, 14<<32, 11<<32 ); 5612771Sqtt2@cornell.edu TEST_RR_SRC21_BYPASS( 25, 2, 0, mulh, 165, 15<<32, 11<<32 ); 5712771Sqtt2@cornell.edu 5812771Sqtt2@cornell.edu TEST_RR_ZEROSRC1( 26, mulh, 0, 31<<32 ); 5912771Sqtt2@cornell.edu TEST_RR_ZEROSRC2( 27, mulh, 0, 32<<32 ); 6012771Sqtt2@cornell.edu TEST_RR_ZEROSRC12( 28, mulh, 0 ); 6112771Sqtt2@cornell.edu TEST_RR_ZERODEST( 29, mulh, 33<<32, 34<<32 ); 6212771Sqtt2@cornell.edu 6312771Sqtt2@cornell.edu TEST_PASSFAIL 6412771Sqtt2@cornell.edu 6512771Sqtt2@cornell.eduRVTEST_CODE_END 6612771Sqtt2@cornell.edu 6712771Sqtt2@cornell.edu .data 6812771Sqtt2@cornell.eduRVTEST_DATA_BEGIN 6912771Sqtt2@cornell.edu 7012771Sqtt2@cornell.edu TEST_DATA 7112771Sqtt2@cornell.edu 7212771Sqtt2@cornell.eduRVTEST_DATA_END 73