1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-02-27 00:59:41 +00:00

tests/misc: Add a test for a load that hits two preceding stores

This checks that the store forwarding machinery in the dcache
correctly combines forwarded stores when they are partial stores
(i.e. only writing part of the doubleword, as for a byte store).

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
This commit is contained in:
Paul Mackerras
2021-08-31 11:45:57 +10:00
parent 0b23a5e760
commit ba34914465
4 changed files with 32 additions and 0 deletions

View File

@@ -162,3 +162,26 @@ test_bdnzl:
li %r3,0
9: mtlr %r10
blr
/* Test that a load that hits stores gets the correct data */
.global test_loadhitstore
test_loadhitstore:
addi %r5,%r1,-16
ld %r0,0(%r5)
li %r0,0
std %r0,0(%r5)
li %r6,0x66
li %r7,0x77
.balign 64
nop
nop
nop
nop
stb %r6,2(%r5)
stb %r7,3(%r5)
ld %r0,0(%r5)
sldi %r6,%r6,16
sldi %r7,%r7,24
or %r7,%r6,%r7
subf %r3,%r0,%r7
blr

View File

@@ -15,6 +15,7 @@ extern long test_addpcis_2(void);
extern long test_mfpvr(void);
extern long test_mtpvr(void);
extern long test_bdnzl(void);
extern long test_loadhitstore(void);
// i < 100
void print_test_number(int i)
@@ -66,5 +67,12 @@ int main(void)
} else
puts(PASS);
print_test_number(6);
if (test_loadhitstore() != 0) {
fail = 1;
puts(FAIL);
} else
puts(PASS);
return fail;
}

Binary file not shown.

View File

@@ -3,3 +3,4 @@ Test 02:PASS
Test 03:PASS
Test 04:PASS
Test 05:PASS
Test 06:PASS