1# See LICENSE for license details. 2 3#***************************************************************************** 4# fence_i.S 5#----------------------------------------------------------------------------- 6# 7# Test self-modifying code and the fence.i instruction. 8# 9 10#include "riscv_test.h" 11#include "test_macros.h" 12 13RVTEST_RV64U 14RVTEST_CODE_BEGIN 15 16li a3, 111 17lh a0, insn 18lh a1, insn+2 19 20# test I$ hit 21.align 6 22sh a0, 1f, t0 23sh a1, 1f+2, t0 24fence.i 25 261: addi a3, a3, 222 27TEST_CASE( 2, a3, 444, nop ) 28 29# test prefetcher hit 30li a4, 100 311: addi a4, a4, -1 32bnez a4, 1b 33 34sh a0, 1f, t0 35sh a1, 1f+2, t0 36fence.i 37 38.align 6 391: addi a3, a3, 555 40TEST_CASE( 3, a3, 777, nop ) 41 42TEST_PASSFAIL 43 44RVTEST_CODE_END 45 46 .data 47RVTEST_DATA_BEGIN 48 49 TEST_DATA 50 51insn: 52 addi a3, a3, 333 53 54RVTEST_DATA_END 55