SPI_Test/tb/qumcu/isa/rv64mi/lh-misaligned.S

39 lines
704 B
ArmAsm
Raw Normal View History

2024-06-25 16:41:01 +08:00
# See LICENSE for license details.
#*****************************************************************************
# lh-unaligned.S
#-----------------------------------------------------------------------------
#
# Test that misaligned loads work or raise the correct exception
# This test assumes the target is little-endian
#
#include "riscv_test.h"
#include "test_macros.h"
RVTEST_RV64M
RVTEST_CODE_BEGIN
TEST_LD_OP( 2, lh, 0x0201, 0, tdat );
TEST_LD_OP( 3, lh, 0x0302, 1, tdat );
2:
TEST_PASSFAIL
.align 2
.global mtvec_handler
mtvec_handler:
MISALIGNED_LOAD_HANDLER
RVTEST_CODE_END
.data
RVTEST_DATA_BEGIN
TEST_DATA
tdat:
.byte 0x01, 0x02, 0x03, 0x04
RVTEST_DATA_END