aboutsummaryrefslogtreecommitdiff
path: root/isa
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2013-08-23 20:02:02 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2013-08-23 20:04:30 -0700
commit5fe2ce69dcd1d0ddb42c4edffac7ab11d939ca45 (patch)
tree1c76b45e4b7cf966f5d0d3b943d66b04c4f95c21 /isa
parent5b13eb6cd5aa3e73fb477414f1866e7b9cbeaf3f (diff)
downloadriscv-tests-5fe2ce69dcd1d0ddb42c4edffac7ab11d939ca45.zip
riscv-tests-5fe2ce69dcd1d0ddb42c4edffac7ab11d939ca45.tar.gz
riscv-tests-5fe2ce69dcd1d0ddb42c4edffac7ab11d939ca45.tar.bz2
Reflect changes to ISA
Conflicts: isa/Makefile
Diffstat (limited to 'isa')
-rw-r--r--isa/Makefile26
-rw-r--r--isa/macros/scalar/test_macros.h20
-rw-r--r--isa/macros/vector/test_macros.h16
-rw-r--r--isa/rv64si/coreid.S2
-rw-r--r--isa/rv64si/ipi.S18
-rw-r--r--isa/rv64uf/Makefrag2
-rw-r--r--isa/rv64uf/move.S22
-rw-r--r--isa/rv64uf/structural.S16
-rw-r--r--isa/rv64ui/Makefrag2
-rw-r--r--isa/rv64uv/fma.S10
-rw-r--r--isa/rv64uv/fmovn.S4
-rw-r--r--isa/rv64uv/fmovz.S4
-rw-r--r--isa/rv64uv/vfmvv.S2
13 files changed, 72 insertions, 72 deletions
diff --git a/isa/Makefile b/isa/Makefile
index e2c6f32..18a03a4 100644
--- a/isa/Makefile
+++ b/isa/Makefile
@@ -6,7 +6,7 @@ isa_src_dir := .
include $(isa_src_dir)/rv64ui/Makefrag
include $(isa_src_dir)/rv64uf/Makefrag
-include $(isa_src_dir)/rv64uv/Makefrag
+#include $(isa_src_dir)/rv64uv/Makefrag
include $(isa_src_dir)/rv64si/Makefrag
include $(isa_src_dir)/rv64sv/Makefrag
include $(isa_src_dir)/rv32ui/Makefrag
@@ -18,7 +18,7 @@ default: all
#--------------------------------------------------------------------
RISCV_GCC = riscv-gcc
-RISCV_GCC_OPTS = -nostdlib -nostartfiles
+RISCV_GCC_OPTS = -nostdlib -nostartfiles -Wa,-march=RVIMAFDXhwacha
RISCV_OBJDUMP = riscv-objdump --disassemble-all --section=.text --section=.data --section=.bss
RISCV_SIM = spike
@@ -54,17 +54,17 @@ $$($(1)_v_tests): $(1)-v-%: $(1)/%.S
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -std=gnu99 -O2 -I$(isa_src_dir)/../env/v -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/v/link.ld $(isa_src_dir)/../env/v/entry.S $(isa_src_dir)/../env/v/vm.c $$< -lc -o $$@
tests += $$($(1)_v_tests)
-$$($(1)_p_vec_tests): $(1)-p-vec-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/p -I$(isa_src_dir)/macros/vector -T$(isa_src_dir)/../env/p/link.ld $$< -o $$@
-tests += $$($(1)_p_vec_tests)
-
-$$($(1)_pt_vec_tests): $(1)-pt-vec-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/pt -I$(isa_src_dir)/macros/vector -T$(isa_src_dir)/../env/pt/link.ld $$< -o $$@
-tests += $$($(1)_pt_vec_tests)
-
-$$($(1)_v_vec_tests): $(1)-v-vec-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -std=gnu99 -O2 -I$(isa_src_dir)/../env/v -I$(isa_src_dir)/macros/vector -T$(isa_src_dir)/../env/v/link.ld $(isa_src_dir)/../env/v/entry.S $(isa_src_dir)/../env/v/vm.c $$< -lc -o $$@
-tests += $$($(1)_v_vec_tests)
+#$$($(1)_p_vec_tests): $(1)-p-vec-%: $(1)/%.S
+# $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/p -I$(isa_src_dir)/macros/vector -T$(isa_src_dir)/../env/p/link.ld $$< -o $$@
+#tests += $$($(1)_p_vec_tests)
+#
+#$$($(1)_pt_vec_tests): $(1)-pt-vec-%: $(1)/%.S
+# $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/pt -I$(isa_src_dir)/macros/vector -T$(isa_src_dir)/../env/pt/link.ld $$< -o $$@
+#tests += $$($(1)_pt_vec_tests)
+#
+#$$($(1)_v_vec_tests): $(1)-v-vec-%: $(1)/%.S
+# $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -std=gnu99 -O2 -I$(isa_src_dir)/../env/v -I$(isa_src_dir)/macros/vector -T$(isa_src_dir)/../env/v/link.ld $(isa_src_dir)/../env/v/entry.S $(isa_src_dir)/../env/v/vm.c $$< -lc -o $$@
+#tests += $$($(1)_v_vec_tests)
endef
diff --git a/isa/macros/scalar/test_macros.h b/isa/macros/scalar/test_macros.h
index 97cb28e..6ce6abc 100644
--- a/isa/macros/scalar/test_macros.h
+++ b/isa/macros/scalar/test_macros.h
@@ -485,35 +485,35 @@ test_ ## testnum: \
#define TEST_FCVT_S_D( testnum, result, val1 ) \
TEST_FP_OP_D_INTERNAL( testnum, double result, val1, 0.0, 0.0, \
- fcvt.s.d f3, f0; fcvt.d.s f3, f3; mftx.d a0, f3)
+ fcvt.s.d f3, f0; fcvt.d.s f3, f3; fmv.x.d a0, f3)
#define TEST_FCVT_D_S( testnum, result, val1 ) \
TEST_FP_OP_S_INTERNAL( testnum, float result, val1, 0.0, 0.0, \
- fcvt.d.s f3, f0; fcvt.s.d f3, f3; mftx.s a0, f3)
+ fcvt.d.s f3, f0; fcvt.s.d f3, f3; fmv.x.s a0, f3)
#define TEST_FP_OP1_S( testnum, inst, result, val1 ) \
TEST_FP_OP_S_INTERNAL( testnum, float result, val1, 0.0, 0.0, \
- inst f3, f0; mftx.s a0, f3)
+ inst f3, f0; fmv.x.s a0, f3)
#define TEST_FP_OP1_D( testnum, inst, result, val1 ) \
TEST_FP_OP_D_INTERNAL( testnum, double result, val1, 0.0, 0.0, \
- inst f3, f0; mftx.d a0, f3)
+ inst f3, f0; fmv.x.d a0, f3)
#define TEST_FP_OP2_S( testnum, inst, result, val1, val2 ) \
TEST_FP_OP_S_INTERNAL( testnum, float result, val1, val2, 0.0, \
- inst f3, f0, f1; mftx.s a0, f3)
+ inst f3, f0, f1; fmv.x.s a0, f3)
#define TEST_FP_OP2_D( testnum, inst, result, val1, val2 ) \
TEST_FP_OP_D_INTERNAL( testnum, double result, val1, val2, 0.0, \
- inst f3, f0, f1; mftx.d a0, f3)
+ inst f3, f0, f1; fmv.x.d a0, f3)
#define TEST_FP_OP3_S( testnum, inst, result, val1, val2, val3 ) \
TEST_FP_OP_S_INTERNAL( testnum, float result, val1, val2, val3, \
- inst f3, f0, f1, f2; mftx.s a0, f3)
+ inst f3, f0, f1, f2; fmv.x.s a0, f3)
#define TEST_FP_OP3_D( testnum, inst, result, val1, val2, val3 ) \
TEST_FP_OP_D_INTERNAL( testnum, double result, val1, val2, val3, \
- inst f3, f0, f1, f2; mftx.d a0, f3)
+ inst f3, f0, f1, f2; fmv.x.d a0, f3)
#define TEST_FP_INT_OP_S( testnum, inst, result, val1, rm ) \
TEST_FP_OP_S_INTERNAL( testnum, word result, val1, 0.0, 0.0, \
@@ -538,7 +538,7 @@ test_ ## testnum: \
lw a3, 0(a0); \
li a0, val1; \
inst f0, a0; \
- mftx.s a0, f0; \
+ fmv.x.s a0, f0; \
bne a0, a3, fail; \
b 1f; \
.align 2; \
@@ -553,7 +553,7 @@ test_ ## testnum: \
ld a3, 0(a0); \
li a0, val1; \
inst f0, a0; \
- mftx.d a0, f0; \
+ fmv.x.d a0, f0; \
bne a0, a3, fail; \
b 1f; \
.align 3; \
diff --git a/isa/macros/vector/test_macros.h b/isa/macros/vector/test_macros.h
index f7357f4..3a5d548 100644
--- a/isa/macros/vector/test_macros.h
+++ b/isa/macros/vector/test_macros.h
@@ -294,27 +294,27 @@ vtcode ## testnum : \
#define TEST_FCVT_S_D( testnum, result, val1 ) \
TEST_FP_OP_D_INTERNAL_NREG( testnum, 2, 4, double result, val1, 0.0, 0.0, \
- fcvt.s.d f3, f0; fcvt.d.s f3, f3; mftx.d x1, f3)
+ fcvt.s.d f3, f0; fcvt.d.s f3, f3; fmv.x.d x1, f3)
#define TEST_FCVT_D_S( testnum, result, val1 ) \
TEST_FP_OP_S_INTERNAL_NREG( testnum, 2, 4, float result, val1, 0.0, 0.0, \
- fcvt.d.s f3, f0; fcvt.s.d f3, f3; mftx.s x1, f3)
+ fcvt.d.s f3, f0; fcvt.s.d f3, f3; fmv.x.s x1, f3)
#define TEST_FP_OP2_S( testnum, inst, result, val1, val2 ) \
TEST_FP_OP_S_INTERNAL_NREG( testnum, 2, 4, float result, val1, val2, 0.0, \
- inst f3, f0, f1; mftx.s x1, f3)
+ inst f3, f0, f1; fmv.x.s x1, f3)
#define TEST_FP_OP2_D( testnum, inst, result, val1, val2 ) \
TEST_FP_OP_D_INTERNAL_NREG( testnum, 2, 4, double result, val1, val2, 0.0, \
- inst f3, f0, f1; mftx.d x1, f3)
+ inst f3, f0, f1; fmv.x.d x1, f3)
#define TEST_FP_OP3_S( testnum, inst, result, val1, val2, val3 ) \
TEST_FP_OP_S_INTERNAL_NREG( testnum, 2, 4, float result, val1, val2, val3, \
- inst f3, f0, f1, f2; mftx.s x1, f3)
+ inst f3, f0, f1, f2; fmv.x.s x1, f3)
#define TEST_FP_OP3_D( testnum, inst, result, val1, val2, val3 ) \
TEST_FP_OP_D_INTERNAL_NREG( testnum, 2, 4, double result, val1, val2, val3, \
- inst f3, f0, f1, f2; mftx.d x1, f3)
+ inst f3, f0, f1, f2; fmv.x.d x1, f3)
#define TEST_FP_INT_OP_S( testnum, inst, result, val1, rm ) \
TEST_FP_OP_S_INTERNAL_NREG( testnum, 2, 4, word result, val1, 0.0, 0.0, \
@@ -357,7 +357,7 @@ skip ## testnum : \
vtcode ## testnum : \
li x1, val1; \
inst f0, x1; \
- mftx.s x1, f0; \
+ fmv.x.s x1, f0; \
stop; \
.align 2; \
test_ ## testnum ## _data: \
@@ -389,7 +389,7 @@ skip ## testnum : \
vtcode ## testnum : \
li x1, val1; \
inst f0, x1; \
- mftx.d x1, f0; \
+ fmv.x.d x1, f0; \
stop; \
.align 3; \
test_ ## testnum ## _data: \
diff --git a/isa/rv64si/coreid.S b/isa/rv64si/coreid.S
index 2b7ffc3..47336db 100644
--- a/isa/rv64si/coreid.S
+++ b/isa/rv64si/coreid.S
@@ -15,7 +15,7 @@ RVTEST_CODE_BEGIN
# Basic tests
#-------------------------------------------------------------
- TEST_CASE( 2, x1, 0x0, mfpcr x1, cr12 );
+ TEST_CASE( 2, x1, 0x0, mfpcr x1, hartid );
TEST_PASSFAIL
diff --git a/isa/rv64si/ipi.S b/isa/rv64si/ipi.S
index 92ae149..8db0163 100644
--- a/isa/rv64si/ipi.S
+++ b/isa/rv64si/ipi.S
@@ -13,12 +13,12 @@ RVTEST_CODE_BEGIN
# clear pending IPIs then enable interrupts
la a0, handler
- mtpcr a0, cr3
- mtpcr x0, cr9
- mfpcr a0, cr0
- li a1, 0x00ff0001
+ mtpcr a0, evec
+ mtpcr x0, clear_ipi
+ mfpcr a0, status
+ li a1, SR_EI | (1 << (IRQ_IPI + SR_IM_SHIFT))
or a0, a0, a1
- mtpcr a0, cr0
+ mtpcr a0, status
# wait for all cores to boot
la a0, coreid
@@ -29,15 +29,15 @@ RVTEST_CODE_BEGIN
blt a1, a3, 1b
# IPI dominoes
- mfpcr a0, cr10
+ mfpcr a0, hartid
1: bnez a0, 1b
add a0, a0, 1
rem a0, a0, a3
- mtpcr a0, cr8
+ mtpcr a0, send_ipi
1: b 1b
handler:
- mfpcr a0, cr10
+ mfpcr a0, hartid
bnez a0, 2f
RVTEST_PASS
@@ -45,7 +45,7 @@ RVTEST_CODE_BEGIN
2: add a0, a0, 1
rem a0, a0, a3
- mtpcr a0, cr8
+ mtpcr a0, send_ipi
1: b 1b
RVTEST_CODE_END
diff --git a/isa/rv64uf/Makefrag b/isa/rv64uf/Makefrag
index fc9da14..185a799 100644
--- a/isa/rv64uf/Makefrag
+++ b/isa/rv64uf/Makefrag
@@ -15,4 +15,4 @@ rv64uf_p_vec_tests = $(addprefix rv64uf-p-vec-, $(rv64uf_sc_vec_tests))
rv64uf_pt_vec_tests = $(addprefix rv64uf-pt-vec-, $(rv64uf_sc_vec_tests))
rv64uf_v_vec_tests = $(addprefix rv64uf-v-vec-, $(rv64uf_sc_vec_tests))
-spike_tests += $(rv64uf_p_tests) $(rv64uf_v_tests) $(rv64uf_p_vec_tests) $(rv64uf_pt_vec_tests) $(rv64uf_v_vec_tests)
+spike_tests += $(rv64uf_p_tests) #$(rv64uf_v_tests) $(rv64uf_p_vec_tests) $(rv64uf_pt_vec_tests) $(rv64uf_v_vec_tests)
diff --git a/isa/rv64uf/move.S b/isa/rv64uf/move.S
index d8ad24c..d00e55a 100644
--- a/isa/rv64uf/move.S
+++ b/isa/rv64uf/move.S
@@ -2,7 +2,7 @@
# move.S
#-----------------------------------------------------------------------------
#
-# This test verifies that mxtf.[s,d], mftx.[s,d], mtfsr, mffsr,
+# This test verifies that mxtf.[s,d], mftx.[s,d], fssr, frsr,
# and fsgnj[x|n].[s|d] work properly.
#
@@ -13,19 +13,19 @@ RVTEST_RV64UF
RVTEST_CODE_BEGIN
li a0, 1
-mtfsr a0
+fssr a0
- TEST_CASE(2, a1, 1, li a0, 0x1234; mtfsr a1, a0)
- TEST_CASE(3, a0, 0x34, mffsr a0)
- TEST_CASE(4, a0, 0x34, mffsr a0)
+ TEST_CASE(2, a1, 1, li a0, 0x1234; fssr a1, a0)
+ TEST_CASE(3, a0, 0x34, frsr a0)
+ TEST_CASE(4, a0, 0x34, frsr a0)
- TEST_CASE(5, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; mxtf.s f0, a1; mftx.s a0, f0)
- TEST_CASE(6, a0, 0x3FF02468A0000000, li a1, 0x3FF02468A0000000; mxtf.d f1, a1; mftx.d a0, f1)
+ TEST_CASE(5, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; fmv.s.x f0, a1; fmv.x.s a0, f0)
+ TEST_CASE(6, a0, 0x3FF02468A0000000, li a1, 0x3FF02468A0000000; fmv.d.x f1, a1; fmv.x.d a0, f1)
- TEST_CASE(7, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; mxtf.s f0, a1; fsgnj.s f1, f0, f0; mftx.s a0, f1)
- TEST_CASE(8, a0, 0x000000004BA98765, li a1, 0xFFFFFFFFCBA98765; mxtf.s f0, a1; fsgnjx.s f1, f0, f0; mftx.s a0, f1)
- TEST_CASE(9, a0, 0x000000005EADBEEF, li a1, 0xFFFFFFFFDEADBEEF; mxtf.s f0, a1; fsgnjn.s f1, f0, f0; mftx.s a0, f1)
- TEST_CASE(10, a0, 0xBFF02468A0001000, li a1, 0x3FF02468A0001000; li a2, -1; mxtf.d f1, a1; mxtf.d f2, a2; fsgnj.d f0, f1, f2; mftx.d a0, f0)
+ TEST_CASE(7, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; fmv.s.x f0, a1; fsgnj.s f1, f0, f0; fmv.x.s a0, f1)
+ TEST_CASE(8, a0, 0x000000004BA98765, li a1, 0xFFFFFFFFCBA98765; fmv.s.x f0, a1; fsgnjx.s f1, f0, f0; fmv.x.s a0, f1)
+ TEST_CASE(9, a0, 0x000000005EADBEEF, li a1, 0xFFFFFFFFDEADBEEF; fmv.s.x f0, a1; fsgnjn.s f1, f0, f0; fmv.x.s a0, f1)
+ TEST_CASE(10, a0, 0xBFF02468A0001000, li a1, 0x3FF02468A0001000; li a2, -1; fmv.d.x f1, a1; fmv.d.x f2, a2; fsgnj.d f0, f1, f2; fmv.x.d a0, f0)
TEST_PASSFAIL
diff --git a/isa/rv64uf/structural.S b/isa/rv64uf/structural.S
index 24a5687..61baa54 100644
--- a/isa/rv64uf/structural.S
+++ b/isa/rv64uf/structural.S
@@ -18,23 +18,23 @@ li x2, 0x3FF0000000000000
li x1, 0x3F800000
#define TEST(nops, errcode) \
- mxtf.d f4, x0 ;\
- mxtf.s f3, x0 ;\
- mxtf.d f2, x2 ;\
- mxtf.s f1, x1 ;\
+ fmv.d.x f4, x0 ;\
+ fmv.s.x f3, x0 ;\
+ fmv.d.x f2, x2 ;\
+ fmv.s.x f1, x1 ;\
b 1f ;\
.align 5 ;\
1:fmul.d f4, f2, f2 ;\
nops ;\
fsgnj.s f3, f1, f1 ;\
- mftx.d x4, f4 ;\
- mftx.s x3, f3 ;\
+ fmv.x.d x4, f4 ;\
+ fmv.x.s x3, f3 ;\
beq x1, x3, 2f ;\
RVTEST_FAIL ;\
2:beq x2, x4, 2f ;\
RVTEST_FAIL; \
-2:mxtf.d f2, zero ;\
- mxtf.s f1, zero ;\
+2:fmv.d.x f2, zero ;\
+ fmv.s.x f1, zero ;\
TEST(;,2)
TEST(nop,4)
diff --git a/isa/rv64ui/Makefrag b/isa/rv64ui/Makefrag
index 45b86a2..b3799bc 100644
--- a/isa/rv64ui/Makefrag
+++ b/isa/rv64ui/Makefrag
@@ -49,4 +49,4 @@ rv64ui_p_vec_tests = $(addprefix rv64ui-p-vec-, $(rv64ui_sc_vec_tests))
rv64ui_pt_vec_tests = $(addprefix rv64ui-pt-vec-, $(rv64ui_sc_vec_tests))
rv64ui_v_vec_tests = $(addprefix rv64ui-v-vec-, $(rv64ui_sc_vec_tests))
-spike_tests += $(rv64ui_p_tests) $(rv64ui_pm_tests) $(rv64ui_v_tests) $(rv64ui_p_vec_tests) $(rv64ui_pt_vec_tests) $(rv64ui_v_vec_tests)
+spike_tests += $(rv64ui_p_tests) $(rv64ui_pm_tests) #$(rv64ui_v_tests) $(rv64ui_p_vec_tests) $(rv64ui_pt_vec_tests) $(rv64ui_v_vec_tests)
diff --git a/isa/rv64uv/fma.S b/isa/rv64uv/fma.S
index 8d22bbc..eb56358 100644
--- a/isa/rv64uv/fma.S
+++ b/isa/rv64uv/fma.S
@@ -17,8 +17,8 @@ RVTEST_CODE_BEGIN
la a4,src
fld f0,0(a4)
fld f1,8(a4)
- mftx.d s0,f0
- mftx.d s1,f1
+ fmv.x.d s0,f0
+ fmv.x.d s1,f1
vmsv vx1,s0
vmsv vx2,s1
lui a0,%hi(vtcode)
@@ -31,7 +31,7 @@ wait:
bne a7,a6,wait
fadd.d f0,f0,f1
- mftx.d s2,f0
+ fmv.x.d s2,f0
la a5,dest
vfsd vf0,a5
@@ -53,8 +53,8 @@ loop:
j pass
vtcode:
- mxtf.d f0,x1
- mxtf.d f1,x2
+ fmv.d.x f0,x1
+ fmv.d.x f1,x2
fadd.d f0,f0,f1
stop
diff --git a/isa/rv64uv/fmovn.S b/isa/rv64uv/fmovn.S
index 52c47c0..1d6e87e 100644
--- a/isa/rv64uv/fmovn.S
+++ b/isa/rv64uv/fmovn.S
@@ -40,8 +40,8 @@ vtcode:
slti x2,x1,10
li x1,-1
li x3,0
- mxtf.d f0,x3
- mxtf.d f1,x1
+ fmv.d.x f0,x3
+ fmv.d.x f1,x1
fmovn f0,x2,f1
stop
diff --git a/isa/rv64uv/fmovz.S b/isa/rv64uv/fmovz.S
index bda56b9..3090ac3 100644
--- a/isa/rv64uv/fmovz.S
+++ b/isa/rv64uv/fmovz.S
@@ -41,8 +41,8 @@ vtcode:
slti x2,x1,10
li x1,-1
li x3,0
- mxtf.d f0,x3
- mxtf.d f1,x1
+ fmv.d.x f0,x3
+ fmv.d.x f1,x1
fmovz f0,x2,f1
stop
diff --git a/isa/rv64uv/vfmvv.S b/isa/rv64uv/vfmvv.S
index 869160b..2f6e8bf 100644
--- a/isa/rv64uv/vfmvv.S
+++ b/isa/rv64uv/vfmvv.S
@@ -34,7 +34,7 @@ loop:
vtcode:
utidx x1
addi x1,x1,1
- mxtf.d f0,x1
+ fmv.d.x f0,x1
stop
TEST_PASSFAIL