diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-07-12 07:09:26 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-07-12 07:09:26 +0000 |
commit | 71592d940dc3cc0a31be00887e3c300c2357b10b (patch) | |
tree | 380103af7b6fd3429c29ee2f5c6ed21ed6519aea | |
parent | f86fd8d8635aa8fd5d92f5282953de3da628bd81 (diff) |
try the supported immediate asi's, too.
-rw-r--r-- | regress/sys/arch/sparc64/emul-ldqstq/asi/asi.c | 122 | ||||
-rw-r--r-- | regress/sys/arch/sparc64/emul-ldqstq/asi/asi_asm.S | 68 |
2 files changed, 188 insertions, 2 deletions
diff --git a/regress/sys/arch/sparc64/emul-ldqstq/asi/asi.c b/regress/sys/arch/sparc64/emul-ldqstq/asi/asi.c index 4264cbd9513..a72b79be166 100644 --- a/regress/sys/arch/sparc64/emul-ldqstq/asi/asi.c +++ b/regress/sys/arch/sparc64/emul-ldqstq/asi/asi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asi.c,v 1.1 2003/07/12 06:31:49 jason Exp $ */ +/* $OpenBSD: asi.c,v 1.2 2003/07/12 07:09:25 jason Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -53,7 +53,27 @@ void c_stqa_asi(int, union fpregs *, struct fpquad *); void c_ldqa_asi(int, union fpregs *, struct fpquad *); void asm_ldqa_asi(int, struct fpquad *); void asm_stqa_asi(int, struct fpquad *); +void asm_ldqa_imm(int asi, struct fpquad *); +void asm_stqa_imm(int asi, struct fpquad *); +void asm_stqa_primary(struct fpquad *); +void asm_ldqa_primary(struct fpquad *); +void asm_stqa_secondary(struct fpquad *); +void asm_ldqa_secondary(struct fpquad *); +void asm_stqa_primary_nofault(struct fpquad *); +void asm_ldqa_primary_nofault(struct fpquad *); +void asm_stqa_secondary_nofault(struct fpquad *); +void asm_ldqa_secondary_nofault(struct fpquad *); +void asm_stqa_primary_little(struct fpquad *); +void asm_ldqa_primary_little(struct fpquad *); +void asm_stqa_secondary_little(struct fpquad *); +void asm_ldqa_secondary_little(struct fpquad *); +void asm_stqa_primary_nofault_little(struct fpquad *); +void asm_ldqa_primary_nofault_little(struct fpquad *); +void asm_stqa_secondary_nofault_little(struct fpquad *); +void asm_ldqa_secondary_nofault_little(struct fpquad *); void check_asi(int, union fpregs *, union fpregs *, union fpregs *); +void check_asi_asi(int, union fpregs *, union fpregs *, union fpregs *); +void check_asi_imm(int, union fpregs *, union fpregs *, union fpregs *); int main(int, char *[]); int @@ -146,8 +166,81 @@ c_ldqa_asi(int asi, union fpregs *frp, struct fpquad *q) } void +asm_stqa_imm(int asi, struct fpquad *q) +{ + switch (asi) { + case ASI_PRIMARY: + asm_stqa_primary(q); + break; + case ASI_SECONDARY: + asm_stqa_secondary(q); + break; + case ASI_PRIMARY_NOFAULT: + asm_stqa_primary_nofault(q); + break; + case ASI_SECONDARY_NOFAULT: + asm_stqa_secondary_nofault(q); + break; + case ASI_PRIMARY_LITTLE: + asm_stqa_primary_little(q); + break; + case ASI_SECONDARY_LITTLE: + asm_stqa_secondary_little(q); + break; + case ASI_PRIMARY_NOFAULT_LITTLE: + asm_stqa_primary_nofault_little(q); + break; + case ASI_SECONDARY_NOFAULT_LITTLE: + asm_stqa_secondary_nofault_little(q); + break; + default: + errx(1, "asm_stqa_imm: bad asi %d", asi); + } +} + +void +asm_ldqa_imm(int asi, struct fpquad *q) +{ + switch (asi) { + case ASI_PRIMARY: + asm_ldqa_primary(q); + break; + case ASI_SECONDARY: + asm_ldqa_secondary(q); + break; + case ASI_PRIMARY_NOFAULT: + asm_ldqa_primary_nofault(q); + break; + case ASI_SECONDARY_NOFAULT: + asm_ldqa_secondary_nofault(q); + break; + case ASI_PRIMARY_LITTLE: + asm_ldqa_primary_little(q); + break; + case ASI_SECONDARY_LITTLE: + asm_ldqa_secondary_little(q); + break; + case ASI_PRIMARY_NOFAULT_LITTLE: + asm_ldqa_primary_nofault_little(q); + break; + case ASI_SECONDARY_NOFAULT_LITTLE: + asm_ldqa_secondary_nofault_little(q); + break; + default: + errx(1, "asm_ldqa_imm: bad asi %d", asi); + } +} + +void check_asi(int asi, union fpregs *fr1, union fpregs *fr2, union fpregs *fr3) { + check_asi_asi(asi, fr1, fr2, fr3); + check_asi_imm(asi, fr1, fr2, fr3); +} + +void +check_asi_asi(int asi, union fpregs *fr1, union fpregs *fr2, union fpregs *fr3) +{ struct fpquad q1; initfpregs(fr1); @@ -172,6 +265,33 @@ check_asi(int asi, union fpregs *fr1, union fpregs *fr2, union fpregs *fr3) } } +void +check_asi_imm(int asi, union fpregs *fr1, union fpregs *fr2, union fpregs *fr3) +{ + struct fpquad q1; + + initfpregs(fr1); + initfpregs(fr2); + initfpregs(fr3); + + q1.x1 = 0x01234567; + q1.x2 = 0x89abcdef; + q1.x3 = 0x55aa55aa; + q1.x4 = 0xa5a5a5a5; + + loadfpregs(fr1); + asm_ldqa_imm(asi, &q1); + savefpregs(fr2); + + c_ldqa_asi(asi, fr3, &q1); + + if (compare_regs(fr2, fr3)) { + printf("ASI 0x%x failed\n", asi); + dump_regs(fr1, fr2, fr3); + exit(1); + } +} + int main(int argc, char *argv[]) { diff --git a/regress/sys/arch/sparc64/emul-ldqstq/asi/asi_asm.S b/regress/sys/arch/sparc64/emul-ldqstq/asi/asi_asm.S index c64817e6a7f..7e50b1fb894 100644 --- a/regress/sys/arch/sparc64/emul-ldqstq/asi/asi_asm.S +++ b/regress/sys/arch/sparc64/emul-ldqstq/asi/asi_asm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: asi_asm.S,v 1.1 2003/07/12 06:31:49 jason Exp $ */ +/* $OpenBSD: asi_asm.S,v 1.2 2003/07/12 07:09:25 jason Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -27,6 +27,7 @@ */ #include <machine/asm.h> +#include <machine/ctlreg.h> /* void asm_ldq_asi(int asi, struct fpquad *r) %f0 = *r */ ENTRY(asm_ldqa_asi) @@ -43,3 +44,68 @@ ENTRY(asm_stqa_asi) stqa %f0, [%o1] %asi retl wr %o2, 0, %asi + +ENTRY(asm_stqa_primary) + retl + stqa %f0, [%o0] ASI_PRIMARY + +ENTRY(asm_ldqa_primary) + retl + ldqa [%o0] ASI_PRIMARY, %f0 + +ENTRY(asm_stqa_secondary) + retl + stqa %f0, [%o0] ASI_SECONDARY + +ENTRY(asm_ldqa_secondary) + retl + ldqa [%o0] ASI_SECONDARY, %f0 + +ENTRY(asm_stqa_primary_nofault) + retl + stqa %f0, [%o0] ASI_PRIMARY_NOFAULT + +ENTRY(asm_ldqa_primary_nofault) + retl + ldqa [%o0] ASI_PRIMARY_NOFAULT, %f0 + +ENTRY(asm_stqa_secondary_nofault) + retl + stqa %f0, [%o0] ASI_SECONDARY_NOFAULT + +ENTRY(asm_ldqa_secondary_nofault) + retl + ldqa [%o0] ASI_SECONDARY_NOFAULT, %f0 + +ENTRY(asm_stqa_primary_little) + retl + stqa %f0, [%o0] ASI_PRIMARY_LITTLE + +ENTRY(asm_ldqa_primary_little) + retl + ldqa [%o0] ASI_PRIMARY_LITTLE, %f0 + +ENTRY(asm_stqa_secondary_little) + retl + stqa %f0, [%o0] ASI_SECONDARY_LITTLE + +ENTRY(asm_ldqa_secondary_little) + retl + ldqa [%o0] ASI_SECONDARY_LITTLE, %f0 + +ENTRY(asm_stqa_primary_nofault_little) + retl + stqa %f0, [%o0] ASI_PRIMARY_NOFAULT_LITTLE + +ENTRY(asm_ldqa_primary_nofault_little) + retl + ldqa [%o0] ASI_PRIMARY_NOFAULT_LITTLE, %f0 + +ENTRY(asm_stqa_secondary_nofault_little) + retl + stqa %f0, [%o0] ASI_SECONDARY_NOFAULT_LITTLE + +ENTRY(asm_ldqa_secondary_nofault_little) + retl + ldqa [%o0] ASI_SECONDARY_NOFAULT_LITTLE, %f0 + |