diff options
author | Palmer Dabbelt <palmer@dabbelt.com> | 2016-07-12 09:19:08 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@dabbelt.com> | 2016-07-12 09:19:08 -0700 |
commit | 00df2be7a414d34c7633142c73ac6130f6cbbd4b (patch) | |
tree | 49ade5408f077f851fd90280fc300709148883f9 | |
parent | d82a880f81cb5d197f712bbd17e821e0d70d7b75 (diff) | |
parent | 3dc00e7b04834f862a074ac8822892e1ecfc009c (diff) | |
download | riscv-tests-00df2be7a414d34c7633142c73ac6130f6cbbd4b.zip riscv-tests-00df2be7a414d34c7633142c73ac6130f6cbbd4b.tar.gz riscv-tests-00df2be7a414d34c7633142c73ac6130f6cbbd4b.tar.bz2 |
Merge commit '3dc00e7' into smi-demosmi-demo
-rw-r--r-- | benchmarks/common/crt.S | 27 | ||||
-rw-r--r-- | benchmarks/common/syscalls.c | 3 | ||||
-rw-r--r-- | benchmarks/common/util.h | 2 | ||||
-rw-r--r-- | benchmarks/dhrystone/dhrystone.h | 2 | ||||
-rw-r--r-- | benchmarks/sort/bmark.mk | 21 | ||||
-rw-r--r-- | benchmarks/sort/dataset.h | 2057 | ||||
-rw-r--r-- | benchmarks/sort/sort.c | 255 | ||||
-rw-r--r-- | benchmarks/sort/sort.h | 57 | ||||
-rwxr-xr-x | benchmarks/sort/sort_gendata.scala | 30 | ||||
-rw-r--r-- | benchmarks/sort/sort_main.c | 119 | ||||
m--------- | env | 10 | ||||
-rw-r--r-- | isa/Makefile | 10 | ||||
-rw-r--r-- | isa/rv32mi/Makefrag | 1 | ||||
-rw-r--r-- | isa/rv32mi/wfi.S | 8 | ||||
-rw-r--r-- | isa/rv32ua/Makefrag | 12 | ||||
-rw-r--r-- | isa/rv32ua/amoadd_w.S (renamed from isa/rv32ui/amoadd_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amoand_w.S (renamed from isa/rv32ui/amoand_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amomax_w.S (renamed from isa/rv32ui/amomax_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amomaxu_w.S (renamed from isa/rv32ui/amomaxu_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amomin_w.S (renamed from isa/rv32ui/amomin_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amominu_w.S (renamed from isa/rv32ui/amominu_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amoor_w.S (renamed from isa/rv32ui/amoor_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amoswap_w.S (renamed from isa/rv32ui/amoswap_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/amoxor_w.S (renamed from isa/rv32ui/amoxor_w.S) | 0 | ||||
-rw-r--r-- | isa/rv32ua/lrsc.S (renamed from isa/rv32ui/lrsc.S) | 0 | ||||
-rw-r--r-- | isa/rv32ui/Makefrag | 5 | ||||
-rw-r--r-- | isa/rv32ui/divuw.S | 41 | ||||
-rw-r--r-- | isa/rv32ui/divw.S | 41 | ||||
-rw-r--r-- | isa/rv32ui/mulw.S | 72 | ||||
-rw-r--r-- | isa/rv32ui/sh.S | 18 | ||||
-rw-r--r-- | isa/rv32um/Makefrag | 13 | ||||
-rw-r--r-- | isa/rv32um/div.S (renamed from isa/rv32ui/div.S) | 0 | ||||
-rw-r--r-- | isa/rv32um/divu.S (renamed from isa/rv32ui/divu.S) | 0 | ||||
-rw-r--r-- | isa/rv32um/mul.S (renamed from isa/rv32ui/mul.S) | 0 | ||||
-rw-r--r-- | isa/rv32um/mulh.S (renamed from isa/rv32ui/mulh.S) | 0 | ||||
-rw-r--r-- | isa/rv32um/mulhsu.S (renamed from isa/rv32ui/mulhsu.S) | 0 | ||||
-rw-r--r-- | isa/rv32um/mulhu.S (renamed from isa/rv32ui/mulhu.S) | 0 | ||||
-rw-r--r-- | isa/rv32um/rem.S (renamed from isa/rv32ui/rem.S) | 0 | ||||
-rw-r--r-- | isa/rv32um/remu.S (renamed from isa/rv32ui/remu.S) | 0 | ||||
-rw-r--r-- | isa/rv64mi/breakpoint.S | 121 | ||||
-rw-r--r-- | isa/rv64mi/dirty.S | 8 | ||||
-rw-r--r-- | isa/rv64si/wfi.S | 5 | ||||
-rw-r--r-- | isa/rv64ua/Makefrag | 13 | ||||
-rw-r--r-- | isa/rv64ua/amoadd_d.S (renamed from isa/rv64ui/amoadd_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoadd_w.S (renamed from isa/rv64ui/amoadd_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoand_d.S (renamed from isa/rv64ui/amoand_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoand_w.S (renamed from isa/rv64ui/amoand_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amomax_d.S (renamed from isa/rv64ui/amomax_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amomax_w.S (renamed from isa/rv64ui/amomax_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amomaxu_d.S (renamed from isa/rv64ui/amomaxu_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amomaxu_w.S (renamed from isa/rv64ui/amomaxu_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amomin_d.S (renamed from isa/rv64ui/amomin_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amomin_w.S (renamed from isa/rv64ui/amomin_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amominu_d.S (renamed from isa/rv64ui/amominu_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amominu_w.S (renamed from isa/rv64ui/amominu_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoor_d.S (renamed from isa/rv64ui/amoor_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoor_w.S (renamed from isa/rv64ui/amoor_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoswap_d.S (renamed from isa/rv64ui/amoswap_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoswap_w.S (renamed from isa/rv64ui/amoswap_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoxor_d.S (renamed from isa/rv64ui/amoxor_d.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/amoxor_w.S (renamed from isa/rv64ui/amoxor_w.S) | 0 | ||||
-rw-r--r-- | isa/rv64ua/lrsc.S (renamed from isa/rv64ui/lrsc.S) | 0 | ||||
-rw-r--r-- | isa/rv64ud/Makefrag | 12 | ||||
-rw-r--r-- | isa/rv64ud/fadd.S | 44 | ||||
-rw-r--r-- | isa/rv64ud/fclass.S | 44 | ||||
-rw-r--r-- | isa/rv64ud/fcmp.S | 37 | ||||
-rw-r--r-- | isa/rv64ud/fcvt.S | 56 | ||||
-rw-r--r-- | isa/rv64ud/fcvt_w.S | 102 | ||||
-rw-r--r-- | isa/rv64ud/fdiv.S | 42 | ||||
-rw-r--r-- | isa/rv64ud/fmadd.S | 45 | ||||
-rw-r--r-- | isa/rv64ud/fmin.S | 43 | ||||
-rw-r--r-- | isa/rv64ud/fsgnj.S | 44 | ||||
-rw-r--r-- | isa/rv64ud/ldst.S | 38 | ||||
-rw-r--r-- | isa/rv64ud/move.S | 36 | ||||
-rw-r--r-- | isa/rv64ud/recoding.S | 67 | ||||
-rw-r--r-- | isa/rv64ud/structural.S (renamed from isa/rv64uf/structural.S) | 0 | ||||
-rw-r--r-- | isa/rv64uf/Makefrag | 2 | ||||
-rw-r--r-- | isa/rv64uf/fadd.S | 29 | ||||
-rw-r--r-- | isa/rv64uf/fclass.S | 17 | ||||
-rw-r--r-- | isa/rv64uf/fcmp.S | 2 | ||||
-rw-r--r-- | isa/rv64uf/fcvt.S | 29 | ||||
-rw-r--r-- | isa/rv64uf/fcvt_w.S | 91 | ||||
-rw-r--r-- | isa/rv64uf/fdiv.S | 27 | ||||
-rw-r--r-- | isa/rv64uf/fmadd.S | 34 | ||||
-rw-r--r-- | isa/rv64uf/fmin.S | 16 | ||||
-rw-r--r-- | isa/rv64uf/fsgnj.S | 17 | ||||
-rw-r--r-- | isa/rv64uf/ldst.S | 2 | ||||
-rw-r--r-- | isa/rv64uf/move.S | 10 | ||||
-rw-r--r-- | isa/rv64uf/recoding.S | 33 | ||||
-rw-r--r-- | isa/rv64ui/Makefrag | 6 | ||||
-rw-r--r-- | isa/rv64um/Makefrag | 13 | ||||
-rw-r--r-- | isa/rv64um/div.S (renamed from isa/rv64ui/div.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/divu.S (renamed from isa/rv64ui/divu.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/divuw.S (renamed from isa/rv64ui/divuw.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/divw.S (renamed from isa/rv64ui/divw.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/mul.S (renamed from isa/rv64ui/mul.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/mulh.S (renamed from isa/rv64ui/mulh.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/mulhsu.S (renamed from isa/rv64ui/mulhsu.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/mulhu.S (renamed from isa/rv64ui/mulhu.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/mulw.S (renamed from isa/rv64ui/mulw.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/rem.S (renamed from isa/rv64ui/rem.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/remu.S (renamed from isa/rv64ui/remu.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/remuw.S (renamed from isa/rv64ui/remuw.S) | 0 | ||||
-rw-r--r-- | isa/rv64um/remw.S (renamed from isa/rv64ui/remw.S) | 0 |
104 files changed, 848 insertions, 3041 deletions
diff --git a/benchmarks/common/crt.S b/benchmarks/common/crt.S index 7c8fc19..2dda05b 100644 --- a/benchmarks/common/crt.S +++ b/benchmarks/common/crt.S @@ -50,29 +50,26 @@ _start: li x30,0 li x31,0 - li t0, MSTATUS_FS; csrs mstatus, t0 # enable FPU - li t0, MSTATUS_XS; csrs mstatus, t0 # enable accelerator + # enable FPU and accelerator if present + li t0, MSTATUS_FS | MSTATUS_XS + csrs mstatus, t0 -#ifdef __riscv64 + # make sure XLEN agrees with compilation choice csrr t0, misa - # make sure processor supports RV64 if this was compiled for RV64 +#ifdef __riscv64 bltz t0, 1f +#else + bgez t0, 1f +#endif li a0, 1234 j tohost_exit 1: -#endif - - csrr t0, mstatus - li t1, MSTATUS_XS - and t1, t0, t1 - sw t1, have_vec, t2 - - ## if that didn't stick, we don't have a FPU, so don't initialize it - li t1, MSTATUS_FS - and t1, t0, t1 - beqz t1, 1f #ifdef __riscv_hard_float + # initialize FPU if we have one + andi t0, t0, 1 << ('f' - 'a') + beqz t0, 1f + fssr x0 fmv.s.x f0, x0 fmv.s.x f1, x0 diff --git a/benchmarks/common/syscalls.c b/benchmarks/common/syscalls.c index 0a43878..316f2fe 100644 --- a/benchmarks/common/syscalls.c +++ b/benchmarks/common/syscalls.c @@ -11,9 +11,6 @@ #define SYS_exit 93 #define SYS_stats 1234 -// initialized in crt.S -int have_vec; - extern volatile uint64_t tohost; extern volatile uint64_t fromhost; diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h index c35bf7c..22f81cf 100644 --- a/benchmarks/common/util.h +++ b/benchmarks/common/util.h @@ -35,8 +35,6 @@ extern void setStats(int enable); #include <stdint.h> -extern int have_vec; - #define static_assert(cond) switch(0) { case 0: case !!(long)(cond): ; } static void printArray(const char name[], int n, const int arr[]) diff --git a/benchmarks/dhrystone/dhrystone.h b/benchmarks/dhrystone/dhrystone.h index 89616af..e350c17 100644 --- a/benchmarks/dhrystone/dhrystone.h +++ b/benchmarks/dhrystone/dhrystone.h @@ -412,7 +412,7 @@ struct tms time_info; #endif /* TIME */ -#define Mic_secs_Per_Second 1000000.0 +#define Mic_secs_Per_Second 1000000 #define NUMBER_OF_RUNS 500 /* Default number of runs */ #ifdef NOSTRUCTASSIGN diff --git a/benchmarks/sort/bmark.mk b/benchmarks/sort/bmark.mk deleted file mode 100644 index 1e76b68..0000000 --- a/benchmarks/sort/bmark.mk +++ /dev/null @@ -1,21 +0,0 @@ - -sort_c_src = \ - sort_main.c \ - sort.c \ - syscalls.c \ - -sort_riscv_src = \ - crt.S - -sort_c_objs = $(patsubst %.c, %.o, $(sort_c_src)) -sort_riscv_objs = $(patsubst %.S, %.o, $(sort_riscv_src)) - -sort_host_bin = sort.host -$(sort_host_bin): $(sort_c_src) - $(HOST_COMP) $^ -o $(sort_host_bin) - -sort_riscv_bin = sort.riscv -$(sort_riscv_bin): $(sort_c_objs) $(sort_riscv_objs) - $(RISCV_LINK) $(sort_c_objs) $(sort_riscv_objs) -o $(sort_riscv_bin) $(RISCV_LINK_OPTS) - -junk += $(sort_c_objs) $(sort_riscv_objs) $(sort_host_bin) $(sort_riscv_bin) diff --git a/benchmarks/sort/dataset.h b/benchmarks/sort/dataset.h deleted file mode 100644 index b04a193..0000000 --- a/benchmarks/sort/dataset.h +++ /dev/null @@ -1,2057 +0,0 @@ -// See LICENSE for license details. - -#define DATA_SIZE_SORT 1024 -float input_data_sort[1024] = { - 0.1757304, - 0.11887336, - 0.31508863, - 0.87429434, - 0.32998228, - 0.8617061, - 0.6609412, - 0.19959801, - 0.98842853, - 0.119490266, - 0.9348168, - 0.65575826, - 0.45825773, - 0.97723013, - 0.38904178, - 0.8539795, - 0.033690035, - 0.019101262, - 0.05240947, - 0.5234229, - 0.14557135, - 0.60703784, - 0.451209, - 0.6935377, - 0.44013077, - 0.33798885, - 0.89433634, - 0.49943197, - 0.23044586, - 0.121301234, - 0.8689161, - 0.593277, - 0.05368501, - 0.053545654, - 0.6745325, - 0.20875269, - 0.21469009, - 0.866569, - 0.49906075, - 0.84484196, - 0.7888443, - 0.6592707, - 0.83318657, - 0.5413125, - 0.32197475, - 0.69631076, - 0.32559925, - 0.49555874, - 0.5204319, - 0.6475523, - 0.80377436, - 0.70680165, - 0.32925904, - 0.95852894, - 0.39906925, - 0.7697948, - 0.59992826, - 0.37073708, - 0.20802563, - 0.42008877, - 0.841509, - 0.56534445, - 0.14839774, - 0.953649, - 0.5110267, - 0.6773647, - 0.098240376, - 0.9053897, - 0.751437, - 0.039974272, - 0.7747411, - 0.027303576, - 0.141011, - 0.06908399, - 0.3673455, - 0.5137753, - 0.72853225, - 0.11327422, - 0.7037065, - 0.8889426, - 0.63771373, - 0.378645, - 0.729311, - 0.011300623, - 0.715438, - 0.52502894, - 0.6201543, - 0.22995687, - 0.84622484, - 0.130499, - 0.73602027, - 0.01398164, - 0.574775, - 0.17442858, - 0.4388845, - 0.99323124, - 0.8751872, - 0.81291664, - 0.14141601, - 0.6210417, - 0.22579539, - 0.6596801, - 0.67486, - 0.8746262, - 0.42942703, - 0.26417083, - 0.5497203, - 0.029295504, - 0.8377925, - 0.54845864, - 0.06822199, - 0.5123382, - 0.16383338, - 0.25521147, - 0.6917526, - 0.79923284, - 0.90598094, - 0.42891055, - 0.9922046, - 0.84964263, - 0.46281397, - 0.13739341, - 0.86184824, - 0.48731065, - 0.3256001, - 0.90518177, - 0.12615639, - 0.65359414, - 0.73031837, - 0.116200924, - 0.017603576, - 0.5591563, - 0.901283, - 0.22194791, - 0.11122882, - 0.32557893, - 0.4873348, - 0.3105452, - 0.7956536, - 0.85483134, - 0.081272185, - 0.12918323, - 0.42289335, - 0.94918406, - 0.3169291, - 0.2620939, - 0.22891188, - 0.3899988, - 0.08985239, - 0.93141407, - 0.49229932, - 0.9866693, - 0.9713107, - 0.97022545, - 0.26418108, - 0.9457844, - 0.04641038, - 0.404957, - 0.18758827, - 0.15739709, - 0.7610722, - 0.84558177, - 0.27376753, - 0.72531575, - 0.1058197, - 0.41215366, - 0.12662953, - 0.8098971, - 0.68366545, - 0.19882846, - 0.6307104, - 0.33636945, - 0.13238782, - 0.5933682, - 0.9342456, - 0.5338107, - 0.61633843, - 0.011111796, - 0.074463665, - 0.49725115, - 0.92839295, - 0.4755246, - 0.47984606, - 0.848783, - 0.2981748, - 0.76883674, - 0.032342672, - 0.15697998, - 0.57827556, - 0.70021665, - 0.33549112, - 0.5544396, - 0.7565379, - 0.08777094, - 0.28177768, - 0.17104203, - 0.040839553, - 0.8449312, - 0.1797567, - 0.7289034, - 0.2951395, - 0.7001151, - 0.33938986, - 0.28042507, - 0.7243572, - 0.48768485, - 0.6393749, - 0.42288208, - 0.154113, - 0.1330601, - 0.7451335, - 0.9043403, - 0.41326004, - 0.74838066, - 0.10847622, - 0.8121712, - 0.47688937, - 0.06848621, - 0.97322446, - 0.17598373, - 0.5801384, - 0.5294491, - 0.41435915, - 0.9434934, - 0.27433473, - 0.94084144, - 0.046301603, - 0.72588295, - 0.8130598, - 0.07384592, - 0.80906665, - 0.23691052, - 0.66352403, - 0.80386925, - 0.05524379, - 0.9488235, - 0.81575716, - 0.26023787, - 0.65764946, - 0.59261876, - 0.7766895, - 0.87673867, - 0.6942928, - 0.87804097, - 0.19702464, - 0.26321357, - 0.36684746, - 0.2907554, - 0.3852964, - 0.4662627, - 0.6096073, - 0.3343132, - 0.055701077, - 0.820616, - 0.55202353, - 0.8699163, - 0.46486145, - 0.15427285, - 0.8291023, - 0.7177797, - 0.18890625, - 0.3706004, - 0.17553282, - 0.823405, - 0.638046, - 0.23785275, - 0.7924014, - 0.66676295, - 0.60373807, - 0.74777824, - 0.4063158, - 0.26180196, - 0.6767176, - 0.41501343, - 0.5319598, - 0.82056034, - 0.89642483, - 0.9608185, - 0.24835157, - 0.65626585, - 0.018087804, - 0.6195284, - 0.3698889, - 0.09212071, - 0.9779671, - 0.8131314, - 0.564712, - 0.39904678, - 0.5557016, - 0.7260277, - 0.0897426, - 0.18171531, - 0.57159394, - 0.7737707, - 0.9843066, - 0.19601238, - 0.802962, - 0.57008445, - 0.9184999, - 0.5441584, - 0.88489395, - 0.5574478, - 0.32001197, - 0.2405588, - 0.8950428, - 0.357908, - 0.81120723, - 0.65982735, - 0.86827475, - 0.330557, - 0.54972917, - 0.7090974, - 0.79445344, - 0.07639384, - 0.46921813, - 0.25367773, - 0.51144004, - 0.32437116, - 0.116015196, - 0.36537987, - 0.49618554, - 0.9566592, - 0.2426961, - 0.056644797, - 0.7008652, - 0.90707433, - 0.2852854, - 0.9642434, - 0.99028367, - 0.3928305, - 0.5690222, - 0.81026703, - 0.263789, - 0.84305465, - 0.5741867, - 0.7049292, - 0.2328471, - 0.97272724, - 0.880976, - 0.47806334, - 0.95803076, - 0.5508898, - 0.79859036, - 0.19994617, - 0.40088493, - 0.43822384, - 0.98203504, - 0.046141088, - 0.33197814, - 0.6607148, - 0.12975866, - 0.29752463, - 0.26210827, - 0.46045, - 0.7308636, - 0.8707063, - 0.5753832, - 0.06716925, - 0.6525864, - 0.62402165, - 0.5776601, - 0.088626266, - 0.50303984, - 0.26159447, - 0.70914066, - 0.97588015, - 0.31242466, - 0.8972134, - 0.07394469, - 0.61121166, - 0.30529517, - 0.8786339, - 0.72101295, - 0.1494422, - 0.8098419, - 0.9022279, - 0.6691359, - 0.3541749, - 0.6060176, - 0.5615999, - 0.5443052, - 0.67311776, - 0.95678174, - 0.51894265, - 0.3206038, - 0.63358235, - 0.91549635, - 0.4147135, - 0.097782075, - 0.08098441, - 0.2429266, - 0.34299248, - 0.07141602, - 0.6783291, - 0.90036285, - 0.32308286, - 0.9576585, - 0.6100172, - 0.8776784, - 0.25210178, - 0.61723447, - 0.8437233, - 0.34890807, - 0.59118164, - 0.61628354, - 0.6825995, - 0.37102014, - 0.73527753, - 0.9893386, - 0.8477641, - 0.6174343, - 0.062403858, - 0.697178, - 0.457215, - 0.79562217, - 0.9244678, - 0.7551755, - 0.0793398, - 0.28252542, - 0.9039292, - 0.9423733, - 0.43258083, - 0.23290926, - 0.046612978, - 0.47474664, - 0.25120294, - 0.6000957, - 0.22257942, - 0.26553988, - 0.64223933, - 0.5474061, - 0.44858456, - 0.019308567, - 0.80046266, - 0.029304922, - 0.8150408, - 0.6731813, - 0.9346345, - 0.5565309, - 0.4383297, - 0.7582761, - 0.47546828, - 0.51790357, - 0.649773, - 0.39620972, - 0.1979565, - 0.86710715, - 0.93260723, - 0.55088305, - 0.49033952, - 0.46529734, - 0.1281203, - 0.14550799, - 0.15954506, - 0.13521653, - 0.30502337, - 0.9410681, - 0.47703332, - 0.28059918, - 0.7785871, - 0.0076212883, - 0.5664016, - 0.27261585, - 0.88764375, - 0.9472175, - 0.2197172, - 0.23516148, - 0.8009327, - 0.13051206, - 0.13636571, - 0.1707949, - 0.2952808, - 0.36281192, - 0.8173559, - 0.87255853, - 0.79568845, - 0.014349699, - 0.6587728, - 0.8428508, - 0.11362362, - 0.5396856, - 0.48779655, - 0.58371586, - 0.089894235, - 0.91859597, - 0.018912792, - 0.49370837, - 0.52069956, - 0.21252477, - 0.7002744, - 0.080859244, - 0.30129594, - 0.6241863, - 0.7223723, - 0.9208161, - 0.09572613, - 0.041391194, - 0.7031407, - 0.41118395, - 0.17094243, - 0.5483958, - 0.7033474, - 0.82030004, - 0.41023225, - 0.19847465, - 0.7997489, - 0.83961886, - 0.2380647, - 1.937151E-5, - 0.8152733, - 0.027657509, - 0.9933987, - 0.5059405, - 0.9178185, - 0.39978993, - 0.63131595, - 0.18378079, - 0.4226243, - 0.4574275, - 0.91688704, - 0.34365255, - 0.11622691, - 0.16326135, - 0.106895626, - 0.41542965, - 0.9394962, - 0.5228724, - 0.5539972, - 0.7887161, - 0.6780639, - 0.30936033, - 0.47677714, - 0.8927699, - 0.99359006, - 0.11455941, - 0.033814907, - 0.22319984, - 0.34991652, - 0.89136845, - 0.73920286, - 0.28290445, - 0.13347423, - 0.795832, - 0.5330783, - 0.95205945, - 0.10473251, - 0.78958845, - 0.54880697, - 0.33227074, - 0.642511, - 0.7335111, - 0.82681596, - 0.2101984, - 0.5292472, - 0.7177714, - 0.1451698, - 0.68357784, - 0.074589014, - 0.023769975, - 0.4533769, - 0.3057692, - 0.5668371, - 0.3066178, - 0.4963051, - 0.09254807, - 0.584813, - 0.4959759, - 0.44029474, - 0.5462275, - 0.88280004, - 0.22653967, - 0.20752531, - 0.27740353, - 0.9925594, - 0.78139514, - 0.7844979, - 0.024319768, - 0.5614426, - 0.031600356, - 0.6963251, - 0.7053268, - 0.78481346, - 0.41900802, - 0.78369737, - 0.3030963, - 0.1929881, - 0.90752304, - 0.24037105, - 0.72266537, - 0.94446266, - 0.03728348, - 0.8753557, - 0.53220785, - 0.66320276, - 0.7888865, - 0.7683766, - 0.5694369, - 0.57122767, - 0.19861305, - 0.85545987, - 0.552156, - 0.11976898, - 0.37410325, - 0.68259144, - 0.9837329, - 0.7521709, - 0.32220656, - 0.2213903, - 0.09883273, - 0.6568185, - 0.41150188, - 0.57682574, - 0.29790616, - 0.034230173, - 0.21160305, - 0.91150093, - 0.3075992, - 0.23267019, - 0.25581092, - 0.44537747, - 0.15596777, - 0.15298265, - 0.10455203, - 0.89859325, - 0.33431584, - 0.21570057, - 0.101569355, - 0.8659252, - 0.24040687, - 0.37985235, - 0.83587176, - 0.93528867, - 0.06015235, - 0.73940843, - 0.48846513, - 0.6833951, - 0.68668723, - 0.964232, - 0.65799284, - 0.24637389, - 0.52766764, - 0.7401162, - 0.64332944, - 0.9220043, - 0.18496239, - 0.6674981, - 0.49924678, - 0.11651373, - 0.9675673, - 0.14938504, - 0.97449046, - 0.0091305375, - 0.12109083, - 0.3126558, - 0.956561, - 0.13129687, - 0.018705726, - 0.21810287, - 0.5664185, - 0.90735143, - 0.49282104, - 0.60635805, - 0.11707395, - 0.29539943, - 0.018318713, - 0.3603375, - 0.83606917, - 0.41994262, - 0.7520571, - 0.22930062, - 0.38228273, - 0.3737226, - 0.045132577, - 0.22242886, - 0.6070589, - 0.7603197, - 0.17040175, - 0.33650416, - 0.8286921, - 0.5796803, - 0.7349129, - 0.9064294, - 0.73378366, - 0.457354, - 0.8027157, - 0.16074997, - 0.2805302, - 0.16938221, - 0.75617754, - 0.4068821, - 0.064817786, - 0.8061867, - 0.63221943, - 0.37044573, - 0.19295168, - 0.59128076, - 0.23321503, - 0.35605943, - 0.97340614, - 0.36811262, - 0.020702302, - 0.1974544, - 0.64824784, - 0.5879169, - 0.3342108, - 0.11516988, - 0.90259147, - 0.47329968, - 0.15869552, - 0.12092799, - 0.25293672, - 0.049723983, - 0.7042008, - 0.09767079, - 0.3734914, - 0.28655404, - 0.81300086, - 0.06994432, - 0.4902075, - 0.48041505, - 0.41573375, - 0.9657087, - 0.68747103, - 0.7590387, - 0.30275953, - 0.6907548, - 0.13004315, - 0.64930385, - 0.6345381, - 0.0018425584, - 0.11642903, - 0.70779675, - 0.30028176, - 0.21370721, - 0.62845016, - 0.377976, - 0.25315416, - 0.5255868, - 0.7201452, - 0.3401265, - 0.74914914, - 0.8504162, - 0.057572365, - 0.43704957, - 0.33240592, - 0.6979439, - 0.05561161, - 0.7713009, - 0.9196396, - 0.45351148, - 6.979704E-5, - 0.2133339, - 0.30875033, - 0.43698066, - 0.9504976, - 0.47181886, - 0.3803134, - 0.3793028, - 0.013994575, - 0.14851558, - 0.5749565, - 0.4536326, - 0.20137453, - 0.12432206, - 0.45463926, - 0.10795635, - 0.7284957, - 0.9475713, - 0.2222321, - 0.60930604, - 0.5270535, - 0.070504844, - 0.55282706, - 0.19628751, - 0.36603934, - 0.20842707, - 0.44382614, - 0.89547896, - 0.35836428, - 0.38479155, - 0.62157434, - 0.5650307, - 0.50342965, - 0.43395442, - 0.34330404, - 0.34038484, - 0.07793331, - 0.6242497, - 0.8382207, - 0.9554563, - 0.18176848, - 0.35321295, - 0.66510236, - 0.0589965, - 0.13699096, - 0.473154, - 0.59084594, - 0.62946135, - 0.0545941, - 0.10092139, - 0.27063727, - 0.4799099, - 0.07096887, - 0.82581013, - 0.7321341, - 0.032769382, - 0.123788476, - 0.08245695, - 0.020152152, - 0.50636065, - 0.81162196, - 0.33269376, - 0.07236695, - 0.19263196, - 0.75444776, - 0.28625458, - 0.088656306, - 0.9984882, - 0.85063785, - 0.072654545, - 0.08569819, - 0.0794332, - 0.08275825, - 0.39629877, - 0.6437189, - 0.50009686, - 0.74817204, - 0.80788136, - 0.84389865, - 0.02585423, - 0.6350247, - 0.30446804, - 0.24354726, - 0.57554376, - 0.19947416, - 0.22851866, - 0.26305282, - 0.5677659, - 0.9613484, - 0.52581614, - 0.27569318, - 0.4710188, - 0.37374723, - 0.70027125, - 0.85122544, - 0.747772, - 0.35405284, - 0.5794416, - 0.24989307, - 0.069361866, - 0.5216087, - 0.29102802, - 0.2789054, - 0.0053359866, - 0.26880872, - 0.6134187, - 0.7829644, - 0.26869857, - 0.9109975, - 0.271482, - 0.25907463, - 0.26668042, - 0.8955092, - 0.42433316, - 0.66934276, - 0.9825553, - 0.99609894, - 0.8599187, - 0.4200377, - 0.74315673, - 0.4362995, - 0.550286, - 0.51775914, - 0.93275, - 0.349836, - 0.71279025, - 0.081686676, - 0.2485407, - 0.03976655, - 0.3007995, - 0.052720666, - 0.28623503, - 0.297701, - 0.5503877, - 0.10466653, - 0.55371666, - 0.01314348, - 0.42787945, - 0.32887244, - 0.97320575, - 0.37917942, - 0.35086995, - 0.27194273, - 0.4114716, - 0.88848966, - 0.6395578, - 0.7869816, - 0.21616459, - 0.73274297, - 0.74610305, - 0.98356473, - 0.40462768, - 0.15415418, - 0.31056094, - 0.2921989, - 0.39827055, - 0.25136715, - 0.6092073, - 0.3979556, - 0.69749975, - 0.97943527, - 0.55431855, - 0.03841853, - 0.9041813, - 0.8877537, - 0.33640724, - 0.5368486, - 0.103672504, - 0.058197737, - 0.28634816, - 0.4769684, - 0.9777305, - 0.80191493, - 0.9947238, - 0.2860303, - 0.62234914, - 0.77631384, - 0.031121552, - 0.23352933, - 0.95816517, - 0.13850504, - 0.33224243, - 0.6703381, - 0.7410319, - 0.268143, - 0.0028386116, - 0.31409484, - 0.4803009, - 0.09725857, - 0.62913793, - 0.25890052, - 0.35405165, - 0.5688682, - 0.4251055, - 0.7689477, - 0.35383534, - 0.6171222, - 0.5053309, - 0.06539601, - 0.10447335, - 0.9923581, - 0.14533323, - 0.38304198, - 0.8731929, - 0.43314546, - 0.094596446, - 0.848147, - 0.32115936, - 0.068326, - 0.3467437, - 0.8918461, - 0.25165737, - 0.4849192, - 0.44514078, - 0.28615254, - 0.4932829, - 0.8579076, - 0.5641911, - 0.6836139, - 0.7221809, - 0.6563289, - 0.61310744, - 0.10970473, - 0.40134054, - 0.23338151, - 0.26957536, - 0.9422157, - 0.6021412, - 0.6086167, - 0.6781688, - 0.89802104, - 0.60672015, - 0.7556083, - 0.008446217, - 0.70907634, - 0.28045171, - 0.032221913, - 0.8293057, - 0.92136437, - 0.9911397, - 0.11186421, - 0.44146562, - 0.39842975, - 0.65281165, - 0.98759604, - 0.7440712, - 0.10141212, - 0.4327789, - 0.68709916, - 0.6727177, - 0.8870143, - 0.004516542, - 0.13116664, - 0.71608186, - 0.89117455, - 0.507684, - 0.73324865, - 0.93142414, - 0.41749775, - 0.7201321, - 0.5298479, - 0.37317383, - 0.63455087, - 0.3130343, - 0.77408105, - 0.014445007, - 0.2043333, - 0.4854672, - 0.45597613, - 0.37260664, - 0.7556518, - 0.123116136, - 0.33716398, - 0.8940141 -}; - -float verify_data_sort[1024] = { - 1.937151E-5, - 6.979704E-5, - 0.0018425584, - 0.0028386116, - 0.004516542, - 0.0053359866, - 0.0076212883, - 0.008446217, - 0.0091305375, - 0.011111796, - 0.011300623, - 0.01314348, - 0.01398164, - 0.013994575, - 0.014349699, - 0.014445007, - 0.017603576, - 0.018087804, - 0.018318713, - 0.018705726, - 0.018912792, - 0.019101262, - 0.019308567, - 0.020152152, - 0.020702302, - 0.023769975, - 0.024319768, - 0.02585423, - 0.027303576, - 0.027657509, - 0.029295504, - 0.029304922, - 0.031121552, - 0.031600356, - 0.032221913, - 0.032342672, - 0.032769382, - 0.033690035, - 0.033814907, - 0.034230173, - 0.03728348, - 0.03841853, - 0.03976655, - 0.039974272, - 0.040839553, - 0.041391194, - 0.045132577, - 0.046141088, - 0.046301603, - 0.04641038, - 0.046612978, - 0.049723983, - 0.05240947, - 0.052720666, - 0.053545654, - 0.05368501, - 0.0545941, - 0.05524379, - 0.05561161, - 0.055701077, - 0.056644797, - 0.057572365, - 0.058197737, - 0.0589965, - 0.06015235, - 0.062403858, - 0.064817786, - 0.06539601, - 0.06716925, - 0.06822199, - 0.068326, - 0.06848621, - 0.06908399, - 0.069361866, - 0.06994432, - 0.070504844, - 0.07096887, - 0.07141602, - 0.07236695, - 0.072654545, - 0.07384592, - 0.07394469, - 0.074463665, - 0.074589014, - 0.07639384, - 0.07793331, - 0.0793398, - 0.0794332, - 0.080859244, - 0.08098441, - 0.081272185, - 0.081686676, - 0.08245695, - 0.08275825, - 0.08569819, - 0.08777094, - 0.088626266, - 0.088656306, - 0.0897426, - 0.08985239, - 0.089894235, - 0.09212071, - 0.09254807, - 0.094596446, - 0.09572613, - 0.09725857, - 0.09767079, - 0.097782075, - 0.098240376, - 0.09883273, - 0.10092139, - 0.10141212, - 0.101569355, - 0.103672504, - 0.10447335, - 0.10455203, - 0.10466653, - 0.10473251, - 0.1058197, - 0.106895626, - 0.10795635, - 0.10847622, - 0.10970473, - 0.11122882, - 0.11186421, - 0.11327422, - 0.11362362, - 0.11455941, - 0.11516988, - 0.116015196, - 0.116200924, - 0.11622691, - 0.11642903, - 0.11651373, - 0.11707395, - 0.11887336, - 0.119490266, - 0.11976898, - 0.12092799, - 0.12109083, - 0.121301234, - 0.123116136, - 0.123788476, - 0.12432206, - 0.12615639, - 0.12662953, - 0.1281203, - 0.12918323, - 0.12975866, - 0.13004315, - 0.130499, - 0.13051206, - 0.13116664, - 0.13129687, - 0.13238782, - 0.1330601, - 0.13347423, - 0.13521653, - 0.13636571, - 0.13699096, - 0.13739341, - 0.13850504, - 0.141011, - 0.14141601, - 0.1451698, - 0.14533323, - 0.14550799, - 0.14557135, - 0.14839774, - 0.14851558, - 0.14938504, - 0.1494422, - 0.15298265, - 0.154113, - 0.15415418, - 0.15427285, - 0.15596777, - 0.15697998, - 0.15739709, - 0.15869552, - 0.15954506, - 0.16074997, - 0.16326135, - 0.16383338, - 0.16938221, - 0.17040175, - 0.1707949, - 0.17094243, - 0.17104203, - 0.17442858, - 0.17553282, - 0.1757304, - 0.17598373, - 0.1797567, - 0.18171531, - 0.18176848, - 0.18378079, - 0.18496239, - 0.18758827, - 0.18890625, - 0.19263196, - 0.19295168, - 0.1929881, - 0.19601238, - 0.19628751, - 0.19702464, - 0.1974544, - 0.1979565, - 0.19847465, - 0.19861305, - 0.19882846, - 0.19947416, - 0.19959801, - 0.19994617, - 0.20137453, - 0.2043333, - 0.20752531, - 0.20802563, - 0.20842707, - 0.20875269, - 0.2101984, - 0.21160305, - 0.21252477, - 0.2133339, - 0.21370721, - 0.21469009, - 0.21570057, - 0.21616459, - 0.21810287, - 0.2197172, - 0.2213903, - 0.22194791, - 0.2222321, - 0.22242886, - 0.22257942, - 0.22319984, - 0.22579539, - 0.22653967, - 0.22851866, - 0.22891188, - 0.22930062, - 0.22995687, - 0.23044586, - 0.23267019, - 0.2328471, - 0.23290926, - 0.23321503, - 0.23338151, - 0.23352933, - 0.23516148, - 0.23691052, - 0.23785275, - 0.2380647, - 0.24037105, - 0.24040687, - 0.2405588, - 0.2426961, - 0.2429266, - 0.24354726, - 0.24637389, - 0.24835157, - 0.2485407, - 0.24989307, - 0.25120294, - 0.25136715, - 0.25165737, - 0.25210178, - 0.25293672, - 0.25315416, - 0.25367773, - 0.25521147, - 0.25581092, - 0.25890052, - 0.25907463, - 0.26023787, - 0.26159447, - 0.26180196, - 0.2620939, - 0.26210827, - 0.26305282, - 0.26321357, - 0.263789, - 0.26417083, - 0.26418108, - 0.26553988, - 0.26668042, - 0.268143, - 0.26869857, - 0.26880872, - 0.26957536, - 0.27063727, - 0.271482, - 0.27194273, - 0.27261585, - 0.27376753, - 0.27433473, - 0.27569318, - 0.27740353, - 0.2789054, - 0.28042507, - 0.28045171, - 0.2805302, - 0.28059918, - 0.28177768, - 0.28252542, - 0.28290445, - 0.2852854, - 0.2860303, - 0.28615254, - 0.28623503, - 0.28625458, - 0.28634816, - 0.28655404, - 0.2907554, - 0.29102802, - 0.2921989, - 0.2951395, - 0.2952808, - 0.29539943, - 0.29752463, - 0.297701, - 0.29790616, - 0.2981748, - 0.30028176, - 0.3007995, - 0.30129594, - 0.30275953, - 0.3030963, - 0.30446804, - 0.30502337, - 0.30529517, - 0.3057692, - 0.3066178, - 0.3075992, - 0.30875033, - 0.30936033, - 0.3105452, - 0.31056094, - 0.31242466, - 0.3126558, - 0.3130343, - 0.31409484, - 0.31508863, - 0.3169291, - 0.32001197, - 0.3206038, - 0.32115936, - 0.32197475, - 0.32220656, - 0.32308286, - 0.32437116, - 0.32557893, - 0.32559925, - 0.3256001, - 0.32887244, - 0.32925904, - 0.32998228, - 0.330557, - 0.33197814, - 0.33224243, - 0.33227074, - 0.33240592, - 0.33269376, - 0.3342108, - 0.3343132, - 0.33431584, - 0.33549112, - 0.33636945, - 0.33640724, - 0.33650416, - 0.33716398, - 0.33798885, - 0.33938986, - 0.3401265, - 0.34038484, - 0.34299248, - 0.34330404, - 0.34365255, - 0.3467437, - 0.34890807, - 0.349836, - 0.34991652, - 0.35086995, - 0.35321295, - 0.35383534, - 0.35405165, - 0.35405284, - 0.3541749, - 0.35605943, - 0.357908, - 0.35836428, - 0.3603375, - 0.36281192, - 0.36537987, - 0.36603934, - 0.36684746, - 0.3673455, - 0.36811262, - 0.3698889, - 0.37044573, - 0.3706004, - 0.37073708, - 0.37102014, - 0.37260664, - 0.37317383, - 0.3734914, - 0.3737226, - 0.37374723, - 0.37410325, - 0.377976, - 0.378645, - 0.37917942, - 0.3793028, - 0.37985235, - 0.3803134, - 0.38228273, - 0.38304198, - 0.38479155, - 0.3852964, - 0.38904178, - 0.3899988, - 0.3928305, - 0.39620972, - 0.39629877, - 0.3979556, - 0.39827055, - 0.39842975, - 0.39904678, - 0.39906925, - 0.39978993, - 0.40088493, - 0.40134054, - 0.40462768, - 0.404957, - 0.4063158, - 0.4068821, - 0.41023225, - 0.41118395, - 0.4114716, - 0.41150188, - 0.41215366, - 0.41326004, - 0.41435915, - 0.4147135, - 0.41501343, - 0.41542965, - 0.41573375, - 0.41749775, - 0.41900802, - 0.41994262, - 0.4200377, - 0.42008877, - 0.4226243, - 0.42288208, - 0.42289335, - 0.42433316, - 0.4251055, - 0.42787945, - 0.42891055, - 0.42942703, - 0.43258083, - 0.4327789, - 0.43314546, - 0.43395442, - 0.4362995, - 0.43698066, - 0.43704957, - 0.43822384, - 0.4383297, - 0.4388845, - 0.44013077, - 0.44029474, - 0.44146562, - 0.44382614, - 0.44514078, - 0.44537747, - 0.44858456, - 0.451209, - 0.4533769, - 0.45351148, - 0.4536326, - 0.45463926, - 0.45597613, - 0.457215, - 0.457354, - 0.4574275, - 0.45825773, - 0.46045, - 0.46281397, - 0.46486145, - 0.46529734, - 0.4662627, - 0.46921813, - 0.4710188, - 0.47181886, - 0.473154, - 0.47329968, - 0.47474664, - 0.47546828, - 0.4755246, - 0.47677714, - 0.47688937, - 0.4769684, - 0.47703332, - 0.47806334, - 0.47984606, - 0.4799099, - 0.4803009, - 0.48041505, - 0.4849192, - 0.4854672, - 0.48731065, - 0.4873348, - 0.48768485, - 0.48779655, - 0.48846513, - 0.4902075, - 0.49033952, - 0.49229932, - 0.49282104, - 0.4932829, - 0.49370837, - 0.49555874, - 0.4959759, - 0.49618554, - 0.4963051, - 0.49725115, - 0.49906075, - 0.49924678, - 0.49943197, - 0.50009686, - 0.50303984, - 0.50342965, - 0.5053309, - 0.5059405, - 0.50636065, - 0.507684, - 0.5110267, - 0.51144004, - 0.5123382, - 0.5137753, - 0.51775914, - 0.51790357, - 0.51894265, - 0.5204319, - 0.52069956, - 0.5216087, - 0.5228724, - 0.5234229, - 0.52502894, - 0.5255868, - 0.52581614, - 0.5270535, - 0.52766764, - 0.5292472, - 0.5294491, - 0.5298479, - 0.5319598, - 0.53220785, - 0.5330783, - 0.5338107, - 0.5368486, - 0.5396856, - 0.5413125, - 0.5441584, - 0.5443052, - 0.5462275, - 0.5474061, - 0.5483958, - 0.54845864, - 0.54880697, - 0.5497203, - 0.54972917, - 0.550286, - 0.5503877, - 0.55088305, - 0.5508898, - 0.55202353, - 0.552156, - 0.55282706, - 0.55371666, - 0.5539972, - 0.55431855, - 0.5544396, - 0.5557016, - 0.5565309, - 0.5574478, - 0.5591563, - 0.5614426, - 0.5615999, - 0.5641911, - 0.564712, - 0.5650307, - 0.56534445, - 0.5664016, - 0.5664185, - 0.5668371, - 0.5677659, - 0.5688682, - 0.5690222, - 0.5694369, - 0.57008445, - 0.57122767, - 0.57159394, - 0.5741867, - 0.574775, - 0.5749565, - 0.5753832, - 0.57554376, - 0.57682574, - 0.5776601, - 0.57827556, - 0.5794416, - 0.5796803, - 0.5801384, - 0.58371586, - 0.584813, - 0.5879169, - 0.59084594, - 0.59118164, - 0.59128076, - 0.59261876, - 0.593277, - 0.5933682, - 0.59992826, - 0.6000957, - 0.6021412, - 0.60373807, - 0.6060176, - 0.60635805, - 0.60672015, - 0.60703784, - 0.6070589, - 0.6086167, - 0.6092073, - 0.60930604, - 0.6096073, - 0.6100172, - 0.61121166, - 0.61310744, - 0.6134187, - 0.61628354, - 0.61633843, - 0.6171222, - 0.61723447, - 0.6174343, - 0.6195284, - 0.6201543, - 0.6210417, - 0.62157434, - 0.62234914, - 0.62402165, - 0.6241863, - 0.6242497, - 0.62845016, - 0.62913793, - 0.62946135, - 0.6307104, - 0.63131595, - 0.63221943, - 0.63358235, - 0.6345381, - 0.63455087, - 0.6350247, - 0.63771373, - 0.638046, - 0.6393749, - 0.6395578, - 0.64223933, - 0.642511, - 0.64332944, - 0.6437189, - 0.6475523, - 0.64824784, - 0.64930385, - 0.649773, - 0.6525864, - 0.65281165, - 0.65359414, - 0.65575826, - 0.65626585, - 0.6563289, - 0.6568185, - 0.65764946, - 0.65799284, - 0.6587728, - 0.6592707, - 0.6596801, - 0.65982735, - 0.6607148, - 0.6609412, - 0.66320276, - 0.66352403, - 0.66510236, - 0.66676295, - 0.6674981, - 0.6691359, - 0.66934276, - 0.6703381, - 0.6727177, - 0.67311776, - 0.6731813, - 0.6745325, - 0.67486, - 0.6767176, - 0.6773647, - 0.6780639, - 0.6781688, - 0.6783291, - 0.68259144, - 0.6825995, - 0.6833951, - 0.68357784, - 0.6836139, - 0.68366545, - 0.68668723, - 0.68709916, - 0.68747103, - 0.6907548, - 0.6917526, - 0.6935377, - 0.6942928, - 0.69631076, - 0.6963251, - 0.697178, - 0.69749975, - 0.6979439, - 0.7001151, - 0.70021665, - 0.70027125, - 0.7002744, - 0.7008652, - 0.7031407, - 0.7033474, - 0.7037065, - 0.7042008, - 0.7049292, - 0.7053268, - 0.70680165, - 0.70779675, - 0.70907634, - 0.7090974, - 0.70914066, - 0.71279025, - 0.715438, - 0.71608186, - 0.7177714, - 0.7177797, - 0.7201321, - 0.7201452, - 0.72101295, - 0.7221809, - 0.7223723, - 0.72266537, - 0.7243572, - 0.72531575, - 0.72588295, - 0.7260277, - 0.7284957, - 0.72853225, - 0.7289034, - 0.729311, - 0.73031837, - 0.7308636, - 0.7321341, - 0.73274297, - 0.73324865, - 0.7335111, - 0.73378366, - 0.7349129, - 0.73527753, - 0.73602027, - 0.73920286, - 0.73940843, - 0.7401162, - 0.7410319, - 0.74315673, - 0.7440712, - 0.7451335, - 0.74610305, - 0.747772, - 0.74777824, - 0.74817204, - 0.74838066, - 0.74914914, - 0.751437, - 0.7520571, - 0.7521709, - 0.75444776, - 0.7551755, - 0.7556083, - 0.7556518, - 0.75617754, - 0.7565379, - 0.7582761, - 0.7590387, - 0.7603197, - 0.7610722, - 0.7683766, - 0.76883674, - 0.7689477, - 0.7697948, - 0.7713009, - 0.7737707, - 0.77408105, - 0.7747411, - 0.77631384, - 0.7766895, - 0.7785871, - 0.78139514, - 0.7829644, - 0.78369737, - 0.7844979, - 0.78481346, - 0.7869816, - 0.7887161, - 0.7888443, - 0.7888865, - 0.78958845, - 0.7924014, - 0.79445344, - 0.79562217, - 0.7956536, - 0.79568845, - 0.795832, - 0.79859036, - 0.79923284, - 0.7997489, - 0.80046266, - 0.8009327, - 0.80191493, - 0.8027157, - 0.802962, - 0.80377436, - 0.80386925, - 0.8061867, - 0.80788136, - 0.80906665, - 0.8098419, - 0.8098971, - 0.81026703, - 0.81120723, - 0.81162196, - 0.8121712, - 0.81291664, - 0.81300086, - 0.8130598, - 0.8131314, - 0.8150408, - 0.8152733, - 0.81575716, - 0.8173559, - 0.82030004, - 0.82056034, - 0.820616, - 0.823405, - 0.82581013, - 0.82681596, - 0.8286921, - 0.8291023, - 0.8293057, - 0.83318657, - 0.83587176, - 0.83606917, - 0.8377925, - 0.8382207, - 0.83961886, - 0.841509, - 0.8428508, - 0.84305465, - 0.8437233, - 0.84389865, - 0.84484196, - 0.8449312, - 0.84558177, - 0.84622484, - 0.8477641, - 0.848147, - 0.848783, - 0.84964263, - 0.8504162, - 0.85063785, - 0.85122544, - 0.8539795, - 0.85483134, - 0.85545987, - 0.8579076, - 0.8599187, - 0.8617061, - 0.86184824, - 0.8659252, - 0.866569, - 0.86710715, - 0.86827475, - 0.8689161, - 0.8699163, - 0.8707063, - 0.87255853, - 0.8731929, - 0.87429434, - 0.8746262, - 0.8751872, - 0.8753557, - 0.87673867, - 0.8776784, - 0.87804097, - 0.8786339, - 0.880976, - 0.88280004, - 0.88489395, - 0.8870143, - 0.88764375, - 0.8877537, - 0.88848966, - 0.8889426, - 0.89117455, - 0.89136845, - 0.8918461, - 0.8927699, - 0.8940141, - 0.89433634, - 0.8950428, - 0.89547896, - 0.8955092, - 0.89642483, - 0.8972134, - 0.89802104, - 0.89859325, - 0.90036285, - 0.901283, - 0.9022279, - 0.90259147, - 0.9039292, - 0.9041813, - 0.9043403, - 0.90518177, - 0.9053897, - 0.90598094, - 0.9064294, - 0.90707433, - 0.90735143, - 0.90752304, - 0.9109975, - 0.91150093, - 0.91549635, - 0.91688704, - 0.9178185, - 0.9184999, - 0.91859597, - 0.9196396, - 0.9208161, - 0.92136437, - 0.9220043, - 0.9244678, - 0.92839295, - 0.93141407, - 0.93142414, - 0.93260723, - 0.93275, - 0.9342456, - 0.9346345, - 0.9348168, - 0.93528867, - 0.9394962, - 0.94084144, - 0.9410681, - 0.9422157, - 0.9423733, - 0.9434934, - 0.94446266, - 0.9457844, - 0.9472175, - 0.9475713, - 0.9488235, - 0.94918406, - 0.9504976, - 0.95205945, - 0.953649, - 0.9554563, - 0.956561, - 0.9566592, - 0.95678174, - 0.9576585, - 0.95803076, - 0.95816517, - 0.95852894, - 0.9608185, - 0.9613484, - 0.964232, - 0.9642434, - 0.9657087, - 0.9675673, - 0.97022545, - 0.9713107, - 0.97272724, - 0.97320575, - 0.97322446, - 0.97340614, - 0.97449046, - 0.97588015, - 0.97723013, - 0.9777305, - 0.9779671, - 0.97943527, - 0.98203504, - 0.9825553, - 0.98356473, - 0.9837329, - 0.9843066, - 0.9866693, - 0.98759604, - 0.98842853, - 0.9893386, - 0.99028367, - 0.9911397, - 0.9922046, - 0.9923581, - 0.9925594, - 0.99323124, - 0.9933987, - 0.99359006, - 0.9947238, - 0.99609894, - 0.9984882 -}; - diff --git a/benchmarks/sort/sort.c b/benchmarks/sort/sort.c deleted file mode 100644 index 9490361..0000000 --- a/benchmarks/sort/sort.c +++ /dev/null @@ -1,255 +0,0 @@ -// See LICENSE for license details. - -#include "sort.h" - -int -n_squared_sort (float * value, int * index, int len) -{ - int i, j; - - for (i = 0; i < len-1; i++) - { - for (j = 0; j < len-1; j++) - { - if (value[j] > value[j+1]) - { - double val_tmp; - int idx_tmp; - - val_tmp = value[j]; - value[j] = value[j+1]; - value[j+1] = val_tmp; - - idx_tmp = index[j]; - index[j] = index[j+1]; - index[j+1] = idx_tmp; - } - } - } - - return 0; -} - - -extern void* fake_malloc_radix(size_t size); - -int -radix_sort_tuples (int * value, int * index, int len, int radix_bits) -{ - int i, j; - int max, min; - int numBuckets = 1 << radix_bits; - int bitMask = numBuckets - 1; - int denShift; - - int * buckets = fake_malloc_radix ((numBuckets + 2) * sizeof(int)); - int * copy1_value = fake_malloc_radix (sizeof(int) * len); - int * copy1_index = fake_malloc_radix (sizeof(int) * len); - int * copy2_value = fake_malloc_radix (sizeof(int) * len); - int * copy2_index = fake_malloc_radix (sizeof(int) * len); - int * tmp_value; - int * tmp_index; - - max = value[0]; - min = value[0]; - for (i = 0; i < len; i++) { - copy1_value[i] = value[i]; - copy1_index[i] = index[i]; - if (max < value[i]) { - max = value[i]; - } - if (min > value[i]) { - min = value[i]; - } - } - min = -min; - max += min; - - for (i = 0; i < len; i++) - { - copy1_value[i] += min; - } - - denShift = 0; - for (i = 0; max != 0; max = max / numBuckets, i++) - { - for (j = 0; j < numBuckets + 2; j++) - { - buckets[j] = 0; - } - - buckets += 2; - - for (j = 0; j < len; j++) - { - int myBucket = (int) (((int) copy1_value[j]) >> denShift) & bitMask; - buckets[myBucket]++; - } - - for (j = 1; j < numBuckets; j++) - { - buckets[j] += buckets[j-1]; - } - - buckets--; - - for (j = 0; j < len; j++) - { - int myBucket = (int) (((int) copy1_value[j]) >> denShift) & bitMask; - int index = buckets[myBucket]++; - copy2_value[index] = copy1_value[j]; - copy2_index[index] = copy1_index[j]; - } - - buckets--; - denShift += radix_bits; - - tmp_value = copy1_value; - copy1_value = copy2_value; - copy2_value = tmp_value; - - tmp_index = copy1_index; - copy1_index = copy2_index; - copy2_index = tmp_index; - } - - max = copy1_value[0]; - for (i = 0; i < len; i++) { - if (max < copy1_value[i]) { - max = copy1_value[i]; - } - } - - for (i = 0; i < len; i++) - { - copy1_value[i] -= min; - } - - for (i = 0; i < len; i++) - { - value[i] = copy1_value[i]; - index[i] = copy1_index[i]; - } - - return 0; -} - -int -insertion_sort (float * value, int * index, int len) -{ - int i; - - for (i = 1; i < len; i++) - { - double current; - int cur_index; - int empty; - - current = value[i]; - cur_index = index[i]; - empty = i; - - while (empty > 0 && current < value[empty-1]) - { - value[empty] = value[empty-1]; - index[empty] = index[empty-1]; - empty--; - } - - value[empty] = current; - index[empty] = cur_index; - } - - return 0; -} - - -int -partition (float * array, int * index, int low, int high) -{ - int left, right, mid; - int pivot; - float cur; - int idx; - - mid = (low + high) / 2; - left = low; - right = high; - - /* choose pivot as median of 3: low, high, and mid */ - if ((array[low] - array[mid]) * (array[high] - array[low]) >= 0) - pivot = low; - else if ((array[mid] - array[low]) * (array[high] - array[mid]) >= 0) - pivot = mid; - else - pivot = high; - - /* store value,index at the pivot */ - cur = array[pivot]; - idx = index[pivot]; - - /* swap pivot with the first entry in the list */ - array[pivot] = array[low]; - array[low] = cur; - - index[pivot] = array[pivot]; - index[low] = idx; - - /* the quicksort itself */ - while (left < right) - { - while (array[left] <= cur && left < high) - left++; - while (array[right] > cur) - right--; - if (left < right) - { - float tmp_val; - int tmp_idx; - - tmp_val = array[right]; - array[right] = array[left]; - array[left] = tmp_val; - - tmp_idx = index[right]; - index[right] = index[left]; - index[left] = tmp_idx; - } - } - - /* pivot was in low, but now moves into position at right */ - array[low] = array[right]; - array[right] = cur; - - index[low] = index[right]; - index[right] = idx; - - return right; -} - - -int -quicksort_inner (float * array, int * index, int low, int high) -{ - int pivot; - int length = high - low + 1; - - if (high > low) - { - if (length > MAX_THRESH) { - pivot = partition (array, index, low, high); - quicksort_inner (array, index, low, pivot-1); - quicksort_inner (array, index, pivot+1, high); - } - } - - return 0; -} - -int quicksort (float * array, int * index, int len) -{ - quicksort_inner (array, index, 0, len-1); - insertion_sort (array, index, len); - - return 0; -} diff --git a/benchmarks/sort/sort.h b/benchmarks/sort/sort.h deleted file mode 100644 index 149744a..0000000 --- a/benchmarks/sort/sort.h +++ /dev/null @@ -1,57 +0,0 @@ -// See LICENSE for license details. - -#include <string.h> -#include <stdint.h> -#include <stdbool.h> - -#define USE_N_SQUARED_SORT - -#define FAKE_MALLOC_INIT(words, name) \ - uint32_t heap_##name[words]; \ - const size_t max_alloc_##name = (words) * sizeof(uint32_t); \ - size_t cur_pos_##name; \ - void* fake_malloc_##name( size_t size ) \ - { \ - static bool init = false; \ - if(!init) { \ - cur_pos_##name = 0; \ - init = true; \ - } \ - if(cur_pos_##name < (words)) { \ - void *ptr = (void*) &heap_##name[cur_pos_##name]; \ - cur_pos_##name += size & ~((uint32_t)3) + 1; \ - return ptr; \ - } else { \ - return NULL; \ - } \ - } - - - -#ifndef _TAV_SORT_H_ -#define _TAV_SORT_H_ - - -int -n_squared_sort (float * value, int * index, int len); - -int -radix_sort_tuples (int * value, int * index, int len, int radix_bits); - -int -insertion_sort (float * value, int * index, int len); - -int -quicksort (float * array, int * index, int len); - -/* This defines the length at quicksort switches to insertion sort */ -#ifndef MAX_THRESH -#define MAX_THRESH 10 -#endif - -#ifndef RADIX_BITS -#define RADIX_BITS (8) -#endif - - -#endif /* _TAV_SORT_H_ */ diff --git a/benchmarks/sort/sort_gendata.scala b/benchmarks/sort/sort_gendata.scala deleted file mode 100755 index 2f44074..0000000 --- a/benchmarks/sort/sort_gendata.scala +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env scala - -import scala.util.Sorting - -if(args.size < 2) { - println("Usage: sort_gendata <# elements> <# trials>") - System.exit(1) -} - -val size = args(0).toInt -val trials = args(1).toInt - -def rand_array(size: Int) = { - var r = new scala.util.Random - Array.fill(size) { r.nextFloat() } -} - -def print_array(name: String, size: Int, arr: Array[Float]) { - println("float "+name+"["+size+"] = {") - for(i <- 0 to size-2) - println(" "+arr(i)+",") - println(" "+arr(size-1)+"\n};\n") -} - -println("#define DATA_SIZE_SORT " + size) -println("#define TRIALS_SORT " + trials) - -val a = rand_array(size * trials) - -print_array("input_data_sort", size * trials, a) diff --git a/benchmarks/sort/sort_main.c b/benchmarks/sort/sort_main.c deleted file mode 100644 index 29b46c5..0000000 --- a/benchmarks/sort/sort_main.c +++ /dev/null @@ -1,119 +0,0 @@ -// See LICENSE for license details. - -// **************************************************************************** -// sort benchmark from DARPA PERFECT TAV suite -// ---------------------------------------------------------------------------- -#include "sort.h" -#include "util.h" -#include "dataset.h" - - -// Need 7 times the input size for: input data, indices, -// four copies, and buckets. -FAKE_MALLOC_INIT( (8 * DATA_SIZE_SORT * TRIALS_SORT), radix ) - - -#if defined(USE_N_SQUARED_SORT) -const char* algo = "N_SQUARED"; -#elif defined(USE_RADIX_SORT) -const char* algo = "RADIX"; -#elif defined(USE_INSERTION_SORT) -const char* algo = "INSERTION"; -#else -const char* algo = "QUICKSORT"; -#endif - - - -int main( int argc, char* argv[] ) -{ - int err; - - int* index = fake_malloc_radix (sizeof(int) * DATA_SIZE_SORT * TRIALS_SORT); - for(int trial = 0; trial < TRIALS_SORT; trial++) - for ( int i = 0; i < DATA_SIZE_SORT; i++ ) - index[i + (DATA_SIZE_SORT * trial)] = i; - -#ifdef PREALLOCATE - // Access every element of input_data_sort to make sure it's in cache - // (or at least that as much as possible of its beginning is). - float sum = 0; - for(int i = (DATA_SIZE_SORT * TRIALS_SORT)-1; i >= 0; i--) { - sum += input_data_sort[i]; - } - if(sum < 0.1) - return 1; - - const bool prealloc = true; -#else - const bool prealloc = false; -#endif - - setStats(1); - -#define read_csr_safe(reg) ({ long __tmp = 0; \ - asm volatile ("csrr %0, " #reg : "+r"(__tmp)); \ - __tmp; }) - - - long cycles_total = 0; - long instret_total = 0; - - for(int i = 0; i < TRIALS_SORT; i++) { - long cycles = read_csr_safe(cycle); - long instret = read_csr_safe(instret); - - float* input_data_trial = &input_data_sort[DATA_SIZE_SORT * i]; - int* index_trial = &index[DATA_SIZE_SORT * i]; - -#if defined(USE_N_SQUARED_SORT) - err = n_squared_sort ( input_data_trial, index_trial, DATA_SIZE_SORT ); -#elif defined(USE_RADIX_SORT) - err = radix_sort_tuples ( (int *) input_data_trial, index_trial, DATA_SIZE_SORT, RADIX_BITS ); -#elif defined(USE_INSERTION_SORT) - err = insertion_sort ( input_data_trial, index_trial, DATA_SIZE_SORT ); -#else - err = quicksort ( input_data_trial, index_trial, DATA_SIZE_SORT ); -#endif - - cycles_total += read_csr_safe(cycle) - cycles; - instret_total += read_csr_safe(instret) - instret; - } - - setStats(0); - - printf("DONE SORTING.\n", 0); - - // Validate results - err = 0; - for(int trial = 0; trial < TRIALS_SORT; trial++) - { - float* input_data_trial = &input_data_sort[DATA_SIZE_SORT * trial]; - int* index_trial = &index[DATA_SIZE_SORT * trial]; - - for(int i = 0; i < DATA_SIZE_SORT-1; i++) - { - if((unsigned int) input_data_trial[i] > (unsigned int) input_data_trial[i+1]) - { - err = i; - for(int j = 0; j < DATA_SIZE_SORT; j++) - printf("TRIAL %d, element %d:\t%d\n", trial, j, input_data_trial[j]); - break; - } - } - } - - printf("sort_cycles = %ld\n", cycles_total/TRIALS_SORT); - printf("sort_instret = %d\n", instret_total/TRIALS_SORT); - printf("sort_size = %d\n", DATA_SIZE_SORT); - printf("sort_trials = %d\n", TRIALS_SORT); - printf("sort_algo = %s\n", algo); - printf("sort_radix_bits = %d\n", RADIX_BITS); - printf("sort_prealloc = %s\n", prealloc ? "true" : "false"); - printf("sort_err = %d\n", err); - - return err; -} - - - diff --git a/env b/env -Subproject 4944be4d45cafabce0519f223124d2934b9dcac +Subproject 92fb0bd7d7d2723f90896bb351f5cdb0eb36b73 diff --git a/isa/Makefile b/isa/Makefile index 636cbbe..4e1af6c 100644 --- a/isa/Makefile +++ b/isa/Makefile @@ -5,10 +5,15 @@ src_dir := . include $(src_dir)/rv64ui/Makefrag +include $(src_dir)/rv64um/Makefrag +include $(src_dir)/rv64ua/Makefrag include $(src_dir)/rv64uf/Makefrag +include $(src_dir)/rv64ud/Makefrag include $(src_dir)/rv64si/Makefrag include $(src_dir)/rv64mi/Makefrag include $(src_dir)/rv32ui/Makefrag +include $(src_dir)/rv32um/Makefrag +include $(src_dir)/rv32ua/Makefrag include $(src_dir)/rv32si/Makefrag include $(src_dir)/rv32mi/Makefrag @@ -61,11 +66,16 @@ tests += $$($(1)_tests) endef $(eval $(call compile_template,rv32ui,-m32)) +$(eval $(call compile_template,rv32um,-m32)) +$(eval $(call compile_template,rv32ua,-m32)) $(eval $(call compile_template,rv32si,-m32)) $(eval $(call compile_template,rv32mi,-m32)) ifeq ($(XLEN),64) $(eval $(call compile_template,rv64ui)) +$(eval $(call compile_template,rv64um)) +$(eval $(call compile_template,rv64ua)) $(eval $(call compile_template,rv64uf)) +$(eval $(call compile_template,rv64ud)) $(eval $(call compile_template,rv64si)) $(eval $(call compile_template,rv64mi)) endif diff --git a/isa/rv32mi/Makefrag b/isa/rv32mi/Makefrag index 9aeb12d..c8fbcf4 100644 --- a/isa/rv32mi/Makefrag +++ b/isa/rv32mi/Makefrag @@ -12,7 +12,6 @@ rv32mi_sc_tests = \ scall \ sbreak \ shamt \ - wfi \ rv32mi_mc_tests = \ ipi \ diff --git a/isa/rv32mi/wfi.S b/isa/rv32mi/wfi.S deleted file mode 100644 index d5cb3cb..0000000 --- a/isa/rv32mi/wfi.S +++ /dev/null @@ -1,8 +0,0 @@ -# See LICENSE for license details. - -#include "riscv_test.h" -#undef RVTEST_RV64S -#define RVTEST_RV64S RVTEST_RV32M -#define __MACHINE_MODE - -#include "../rv64si/wfi.S" diff --git a/isa/rv32ua/Makefrag b/isa/rv32ua/Makefrag new file mode 100644 index 0000000..575dc6a --- /dev/null +++ b/isa/rv32ua/Makefrag @@ -0,0 +1,12 @@ +#======================================================================= +# Makefrag for rv32ua tests +#----------------------------------------------------------------------- + +rv32ua_sc_tests = \ + amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoxor_w amoswap_w \ + lrsc \ + +rv32ua_p_tests = $(addprefix rv32ua-p-, $(rv32ua_sc_tests)) +rv32ua_v_tests = $(addprefix rv32ua-v-, $(rv32ua_sc_tests)) + +spike32_tests += $(rv32ua_p_tests) $(rv32ua_v_tests) diff --git a/isa/rv32ui/amoadd_w.S b/isa/rv32ua/amoadd_w.S index 975ae1d..975ae1d 100644 --- a/isa/rv32ui/amoadd_w.S +++ b/isa/rv32ua/amoadd_w.S diff --git a/isa/rv32ui/amoand_w.S b/isa/rv32ua/amoand_w.S index 7c989c2..7c989c2 100644 --- a/isa/rv32ui/amoand_w.S +++ b/isa/rv32ua/amoand_w.S diff --git a/isa/rv32ui/amomax_w.S b/isa/rv32ua/amomax_w.S index 698cf26..698cf26 100644 --- a/isa/rv32ui/amomax_w.S +++ b/isa/rv32ua/amomax_w.S diff --git a/isa/rv32ui/amomaxu_w.S b/isa/rv32ua/amomaxu_w.S index 27c4ddf..27c4ddf 100644 --- a/isa/rv32ui/amomaxu_w.S +++ b/isa/rv32ua/amomaxu_w.S diff --git a/isa/rv32ui/amomin_w.S b/isa/rv32ua/amomin_w.S index a6a0947..a6a0947 100644 --- a/isa/rv32ui/amomin_w.S +++ b/isa/rv32ua/amomin_w.S diff --git a/isa/rv32ui/amominu_w.S b/isa/rv32ua/amominu_w.S index ce06e1c..ce06e1c 100644 --- a/isa/rv32ui/amominu_w.S +++ b/isa/rv32ua/amominu_w.S diff --git a/isa/rv32ui/amoor_w.S b/isa/rv32ua/amoor_w.S index 0988c66..0988c66 100644 --- a/isa/rv32ui/amoor_w.S +++ b/isa/rv32ua/amoor_w.S diff --git a/isa/rv32ui/amoswap_w.S b/isa/rv32ua/amoswap_w.S index a32ae74..a32ae74 100644 --- a/isa/rv32ui/amoswap_w.S +++ b/isa/rv32ua/amoswap_w.S diff --git a/isa/rv32ui/amoxor_w.S b/isa/rv32ua/amoxor_w.S index d4b775f..d4b775f 100644 --- a/isa/rv32ui/amoxor_w.S +++ b/isa/rv32ua/amoxor_w.S diff --git a/isa/rv32ui/lrsc.S b/isa/rv32ua/lrsc.S index 3a3d05a..3a3d05a 100644 --- a/isa/rv32ui/lrsc.S +++ b/isa/rv32ua/lrsc.S diff --git a/isa/rv32ui/Makefrag b/isa/rv32ui/Makefrag index 4bdebb5..6cb6c08 100644 --- a/isa/rv32ui/Makefrag +++ b/isa/rv32ui/Makefrag @@ -5,19 +5,14 @@ rv32ui_sc_tests = \ simple \ add addi \ - amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoxor_w amoswap_w \ - lrsc \ and andi \ auipc \ beq bge bgeu blt bltu bne \ - div divu \ fence_i \ j jal jalr \ lb lbu lh lhu lw \ lui \ - mul mulh mulhu mulhsu \ or ori \ - rem remu \ sb sh sw \ sll slli \ slt slti \ diff --git a/isa/rv32ui/divuw.S b/isa/rv32ui/divuw.S deleted file mode 100644 index 0868eeb..0000000 --- a/isa/rv32ui/divuw.S +++ /dev/null @@ -1,41 +0,0 @@ -# See LICENSE for license details. - -#***************************************************************************** -# divuw.S -#----------------------------------------------------------------------------- -# -# Test divuw instruction. -# - -#include "riscv_test.h" -#include "test_macros.h" - -RVTEST_RV32U -RVTEST_CODE_BEGIN - - #------------------------------------------------------------- - # Arithmetic tests - #------------------------------------------------------------- - - TEST_RR_OP( 2, divuw, 3, 20, 6 ); - TEST_RR_OP( 3, divuw, 715827879, -20 << 32 >> 32, 6 ); - TEST_RR_OP( 4, divuw, 0, 20, -6 ); - TEST_RR_OP( 5, divuw, 0, -20, -6 ); - - TEST_RR_OP( 6, divuw, -1<<31, -1<<31, 1 ); - TEST_RR_OP( 7, divuw, 0, -1<<31, -1 ); - - TEST_RR_OP( 8, divuw, -1, -1<<31, 0 ); - TEST_RR_OP( 9, divuw, -1, 1, 0 ); - TEST_RR_OP(10, divuw, -1, 0, 0 ); - - TEST_PASSFAIL - -RVTEST_CODE_END - - .data -RVTEST_DATA_BEGIN - - TEST_DATA - -RVTEST_DATA_END diff --git a/isa/rv32ui/divw.S b/isa/rv32ui/divw.S deleted file mode 100644 index 4d91749..0000000 --- a/isa/rv32ui/divw.S +++ /dev/null @@ -1,41 +0,0 @@ -# See LICENSE for license details. - -#***************************************************************************** -# divw.S -#----------------------------------------------------------------------------- -# -# Test divw instruction. -# - -#include "riscv_test.h" -#include "test_macros.h" - -RVTEST_RV32U -RVTEST_CODE_BEGIN - - #------------------------------------------------------------- - # Arithmetic tests - #------------------------------------------------------------- - - TEST_RR_OP( 2, divw, 3, 20, 6 ); - TEST_RR_OP( 3, divw, -3, -20, 6 ); - TEST_RR_OP( 4, divw, -3, 20, -6 ); - TEST_RR_OP( 5, divw, 3, -20, -6 ); - - TEST_RR_OP( 6, divw, -1<<31, -1<<31, 1 ); - TEST_RR_OP( 7, divw, -1<<31, -1<<31, -1 ); - - TEST_RR_OP( 8, divw, -1, -1<<31, 0 ); - TEST_RR_OP( 9, divw, -1, 1, 0 ); - TEST_RR_OP(10, divw, -1, 0, 0 ); - - TEST_PASSFAIL - -RVTEST_CODE_END - - .data -RVTEST_DATA_BEGIN - - TEST_DATA - -RVTEST_DATA_END diff --git a/isa/rv32ui/mulw.S b/isa/rv32ui/mulw.S deleted file mode 100644 index 577c93e..0000000 --- a/isa/rv32ui/mulw.S +++ /dev/null @@ -1,72 +0,0 @@ -# See LICENSE for license details. - -#***************************************************************************** -# mulw.S -#----------------------------------------------------------------------------- -# -# Test mulw instruction. -# - -#include "riscv_test.h" -#include "test_macros.h" - -RVTEST_RV32U -RVTEST_CODE_BEGIN - - #------------------------------------------------------------- - # Arithmetic tests - #------------------------------------------------------------- - - TEST_RR_OP( 2, mulw, 0x00000000, 0x00000000, 0x00000000 ); - TEST_RR_OP( 3, mulw, 0x00000001, 0x00000001, 0x00000001 ); - TEST_RR_OP( 4, mulw, 0x00000015, 0x00000003, 0x00000007 ); - - TEST_RR_OP( 5, mulw, 0x00000000, 0x00000000, 0xffff8000 ); - TEST_RR_OP( 6, mulw, 0x00000000, 0x80000000, 0x00000000 ); - TEST_RR_OP( 7, mulw, 0x00000000, 0x80000000, 0xffff8000 ); - - #------------------------------------------------------------- - # Source/Destination tests - #------------------------------------------------------------- - - TEST_RR_SRC1_EQ_DEST( 8, mulw, 143, 13, 11 ); - TEST_RR_SRC2_EQ_DEST( 9, mulw, 154, 14, 11 ); - TEST_RR_SRC12_EQ_DEST( 10, mulw, 169, 13 ); - - #------------------------------------------------------------- - # Bypassing tests - #------------------------------------------------------------- - - TEST_RR_DEST_BYPASS( 11, 0, mulw, 143, 13, 11 ); - TEST_RR_DEST_BYPASS( 12, 1, mulw, 154, 14, 11 ); - TEST_RR_DEST_BYPASS( 13, 2, mulw, 165, 15, 11 ); - - TEST_RR_SRC12_BYPASS( 14, 0, 0, mulw, 143, 13, 11 ); - TEST_RR_SRC12_BYPASS( 15, 0, 1, mulw, 154, 14, 11 ); - TEST_RR_SRC12_BYPASS( 16, 0, 2, mulw, 165, 15, 11 ); - TEST_RR_SRC12_BYPASS( 17, 1, 0, mulw, 143, 13, 11 ); - TEST_RR_SRC12_BYPASS( 18, 1, 1, mulw, 154, 14, 11 ); - TEST_RR_SRC12_BYPASS( 19, 2, 0, mulw, 165, 15, 11 ); - - TEST_RR_SRC21_BYPASS( 20, 0, 0, mulw, 143, 13, 11 ); - TEST_RR_SRC21_BYPASS( 21, 0, 1, mulw, 154, 14, 11 ); - TEST_RR_SRC21_BYPASS( 22, 0, 2, mulw, 165, 15, 11 ); - TEST_RR_SRC21_BYPASS( 23, 1, 0, mulw, 143, 13, 11 ); - TEST_RR_SRC21_BYPASS( 24, 1, 1, mulw, 154, 14, 11 ); - TEST_RR_SRC21_BYPASS( 25, 2, 0, mulw, 165, 15, 11 ); - - TEST_RR_ZEROSRC1( 26, mulw, 0, 31 ); - TEST_RR_ZEROSRC2( 27, mulw, 0, 32 ); - TEST_RR_ZEROSRC12( 28, mulw, 0 ); - TEST_RR_ZERODEST( 29, mulw, 33, 34 ); - - TEST_PASSFAIL - -RVTEST_CODE_END - - .data -RVTEST_DATA_BEGIN - - TEST_DATA - -RVTEST_DATA_END diff --git a/isa/rv32ui/sh.S b/isa/rv32ui/sh.S index 387e181..6c47274 100644 --- a/isa/rv32ui/sh.S +++ b/isa/rv32ui/sh.S @@ -68,6 +68,23 @@ RVTEST_CODE_BEGIN TEST_ST_SRC21_BYPASS( 22, 1, 1, lh, sh, 0x0011, 8, tdat ); TEST_ST_SRC21_BYPASS( 23, 2, 0, lh, sh, 0x3001, 10, tdat ); + #--------------------------------------------------------------- + # Side effect tests + #--------------------------------------------------------------- + + # sh to a word aligned address should only affect the 2 lower bytes + # and should leave the 2 upper bytes unmodified. + # + # In this test we write 2 bytes to the lower 2 bytes of the word + # tdat11 and then ensure that the both the upper 2 bytes and + # lower 2 bytes are as expected. + TEST_CASE( 24, x3, 0x12343098, \ + la x1, tdat11; \ + li x2, 0x00003098; \ + sh x2, 0(x1); \ + lw x3, 0(x1); \ + ) + li a0, 0xbeef la a1, tdat sh a0, 6(a1) @@ -92,5 +109,6 @@ tdat7: .half 0xbeef tdat8: .half 0xbeef tdat9: .half 0xbeef tdat10: .half 0xbeef +tdat11: .word 0x12345678 RVTEST_DATA_END diff --git a/isa/rv32um/Makefrag b/isa/rv32um/Makefrag new file mode 100644 index 0000000..1391c6a --- /dev/null +++ b/isa/rv32um/Makefrag @@ -0,0 +1,13 @@ +#======================================================================= +# Makefrag for rv32um tests +#----------------------------------------------------------------------- + +rv32um_sc_tests = \ + div divu \ + mul mulh mulhsu mulhu \ + rem remu \ + +rv32um_p_tests = $(addprefix rv32um-p-, $(rv32um_sc_tests)) +rv32um_v_tests = $(addprefix rv32um-v-, $(rv32um_sc_tests)) + +spike32_tests += $(rv32um_p_tests) $(rv32um_v_tests) diff --git a/isa/rv32ui/div.S b/isa/rv32um/div.S index a4504a7..a4504a7 100644 --- a/isa/rv32ui/div.S +++ b/isa/rv32um/div.S diff --git a/isa/rv32ui/divu.S b/isa/rv32um/divu.S index cd348c9..cd348c9 100644 --- a/isa/rv32ui/divu.S +++ b/isa/rv32um/divu.S diff --git a/isa/rv32ui/mul.S b/isa/rv32um/mul.S index 0368629..0368629 100644 --- a/isa/rv32ui/mul.S +++ b/isa/rv32um/mul.S diff --git a/isa/rv32ui/mulh.S b/isa/rv32um/mulh.S index e583f5f..e583f5f 100644 --- a/isa/rv32ui/mulh.S +++ b/isa/rv32um/mulh.S diff --git a/isa/rv32ui/mulhsu.S b/isa/rv32um/mulhsu.S index 28b3690..28b3690 100644 --- a/isa/rv32ui/mulhsu.S +++ b/isa/rv32um/mulhsu.S diff --git a/isa/rv32ui/mulhu.S b/isa/rv32um/mulhu.S index 601dcff..601dcff 100644 --- a/isa/rv32ui/mulhu.S +++ b/isa/rv32um/mulhu.S diff --git a/isa/rv32ui/rem.S b/isa/rv32um/rem.S index c318e2c..c318e2c 100644 --- a/isa/rv32ui/rem.S +++ b/isa/rv32um/rem.S diff --git a/isa/rv32ui/remu.S b/isa/rv32um/remu.S index 38d641d..38d641d 100644 --- a/isa/rv32ui/remu.S +++ b/isa/rv32um/remu.S diff --git a/isa/rv64mi/breakpoint.S b/isa/rv64mi/breakpoint.S index 5e4dfbb..77c9509 100644 --- a/isa/rv64mi/breakpoint.S +++ b/isa/rv64mi/breakpoint.S @@ -16,87 +16,117 @@ RVTEST_CODE_BEGIN # Set up breakpoint to trap on M-mode fetches. li TESTNUM, 2 - # Skip tdrselect is hard-wired. - li t0, 1<<(_RISCV_SZLONG-1) - csrw tdrselect, t0 - csrr t1, tdrselect - bne t0, t1, pass + # Skip tdrselect if hard-wired. + li a0, 1<<(_RISCV_SZLONG-1) + csrw tdrselect, a0 + csrr a1, tdrselect + bne a0, a1, pass # Make sure there's a breakpoint there. - csrr t0, tdrdata1 - srli t0, t0, _RISCV_SZLONG-4 - li t1, 1 - bne t0, t1, pass - - la t2, 1f - csrw tdrdata2, t2 - li t0, BPCONTROL_M | BPCONTROL_X - csrw tdrdata1, t0 + csrr a0, tdrdata1 + srli a0, a0, _RISCV_SZLONG-4 + li a1, 1 + bne a0, a1, pass + + la a2, 1f + csrw tdrdata2, a2 + li a0, BPCONTROL_M | BPCONTROL_X + csrw tdrdata1, a0 # Skip if breakpoint type is unsupported. - csrr t1, tdrdata1 - andi t1, t1, 0x7ff - bne t0, t1, 2f + csrr a1, tdrdata1 + andi a1, a1, 0x7ff + bne a0, a1, 2f 1: # Trap handler should skip this instruction. j fail # Make sure reads don't trap. li TESTNUM, 3 - lw t0, (t2) + lw a0, (a2) 2: # Set up breakpoint to trap on M-mode reads. li TESTNUM, 4 - li t0, BPCONTROL_M | BPCONTROL_R - csrw tdrdata1, t0 + li a0, BPCONTROL_M | BPCONTROL_R + csrw tdrdata1, a0 # Skip if breakpoint type is unsupported. - csrr t1, tdrdata1 - andi t1, t1, 0x7ff - bne t0, t1, 2f - la t2, write_data - csrw tdrdata2, t2 + csrr a1, tdrdata1 + andi a1, a1, 0x7ff + bne a0, a1, 2f + la a2, data1 + csrw tdrdata2, a2 # Trap handler should skip this instruction. - lw t2, (t2) - beqz t2, fail + lw a2, (a2) + beqz a2, fail # Make sure writes don't trap. li TESTNUM, 5 - sw x0, (t2) + sw x0, (a2) 2: # Set up breakpoint to trap on M-mode stores. li TESTNUM, 6 - li t0, BPCONTROL_M | BPCONTROL_W - csrw tdrdata1, t0 + li a0, BPCONTROL_M | BPCONTROL_W + csrw tdrdata1, a0 # Skip if breakpoint type is unsupported. - csrr t1, tdrdata1 - andi t1, t1, 0x7ff - bne t0, t1, 2f + csrr a1, tdrdata1 + andi a1, a1, 0x7ff + bne a0, a1, 2f # Trap handler should skip this instruction. - sw t2, (t2) + sw a2, (a2) # Make sure store didn't succeed. li TESTNUM, 7 - lw t2, (t2) - bnez t2, fail + lw a2, (a2) + bnez a2, fail + + # Try to set up a second breakpoint. + li a0, (1<<(_RISCV_SZLONG-1)) + 1 + csrw tdrselect, a0 + csrr a1, tdrselect + bne a0, a1, pass + + # Make sure there's a breakpoint there. + csrr a0, tdrdata1 + srli a0, a0, _RISCV_SZLONG-4 + li a1, 1 + bne a0, a1, pass + + li a0, BPCONTROL_M | BPCONTROL_R + csrw tdrdata1, a0 + la a3, data2 + csrw tdrdata2, a3 + + # Make sure the second breakpoint triggers. + li TESTNUM, 8 + lw a3, (a3) + beqz a3, fail + + # Make sure the first breakpoint still triggers. + li TESTNUM, 10 + la a2, data1 + sw a2, (a2) + li TESTNUM, 11 + lw a2, (a2) + bnez a2, fail 2: TEST_PASSFAIL mtvec_handler: # Only even-numbered tests should trap. - andi a0, TESTNUM, 1 - bnez a0, fail + andi t0, TESTNUM, 1 + bnez t0, fail - li a0, CAUSE_BREAKPOINT - csrr a1, mcause - bne a0, a1, fail + li t0, CAUSE_BREAKPOINT + csrr t1, mcause + bne t0, t1, fail - csrr a0, mepc - addi a0, a0, 4 - csrw mepc, a0 + csrr t0, mepc + addi t0, t0, 4 + csrw mepc, t0 mret RVTEST_CODE_END @@ -106,6 +136,7 @@ RVTEST_DATA_BEGIN TEST_DATA -write_data: .word 0 +data1: .word 0 +data2: .word 0 RVTEST_DATA_END diff --git a/isa/rv64mi/dirty.S b/isa/rv64mi/dirty.S index 9de358b..66ed5a0 100644 --- a/isa/rv64mi/dirty.S +++ b/isa/rv64mi/dirty.S @@ -44,7 +44,7 @@ RVTEST_CODE_BEGIN # Make sure R and D bits are set lw t0, page_table_2 - li t1, PTE_R | PTE_D + li t1, PTE_A | PTE_D and t0, t0, t1 bne t0, t1, die @@ -58,7 +58,7 @@ stvec_handler: bne TESTNUM, t1, 1f # Make sure R bit is set lw t0, page_table_1 - li t1, PTE_R + li t1, PTE_A and t0, t0, t1 bne t0, t1, die @@ -84,9 +84,9 @@ RVTEST_DATA_BEGIN TEST_DATA .align 12 -page_table_1: .dword (DRAM_BASE/RISCV_PGSIZE << PTE_PPN_SHIFT) | PTE_V | PTE_TYPE_URX_SRX +page_table_1: .dword (DRAM_BASE/RISCV_PGSIZE << PTE_PPN_SHIFT) | PTE_V | PTE_U | PTE_R | PTE_X dummy: .dword 0 .align 12 -page_table_2: .dword (DRAM_BASE/RISCV_PGSIZE << PTE_PPN_SHIFT) | PTE_V | PTE_TYPE_URWX_SRWX +page_table_2: .dword (DRAM_BASE/RISCV_PGSIZE << PTE_PPN_SHIFT) | PTE_V | PTE_U | PTE_R | PTE_X | PTE_W RVTEST_DATA_END diff --git a/isa/rv64si/wfi.S b/isa/rv64si/wfi.S index 8e56909..0302034 100644 --- a/isa/rv64si/wfi.S +++ b/isa/rv64si/wfi.S @@ -13,9 +13,10 @@ RVTEST_RV64S RVTEST_CODE_BEGIN - # Make sure wfi doesn't stall if an interrupt is pending, even if masked + # Make sure wfi doesn't halt the hart, even if interrupts are disabled csrc sstatus, SSTATUS_SIE - csrs sip, MIP_SSIP + csrs sie, SIP_SSIP + csrs sip, SIP_SSIP wfi RVTEST_PASS diff --git a/isa/rv64ua/Makefrag b/isa/rv64ua/Makefrag new file mode 100644 index 0000000..3af8856 --- /dev/null +++ b/isa/rv64ua/Makefrag @@ -0,0 +1,13 @@ +#======================================================================= +# Makefrag for rv64ua tests +#----------------------------------------------------------------------- + +rv64ua_sc_tests = \ + amoadd_d amoand_d amomax_d amomaxu_d amomin_d amominu_d amoor_d amoxor_d amoswap_d \ + amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoxor_w amoswap_w \ + lrsc \ + +rv64ua_p_tests = $(addprefix rv64ua-p-, $(rv64ua_sc_tests)) +rv64ua_v_tests = $(addprefix rv64ua-v-, $(rv64ua_sc_tests)) + +spike_tests += $(rv64ua_p_tests) $(rv64ua_v_tests) diff --git a/isa/rv64ui/amoadd_d.S b/isa/rv64ua/amoadd_d.S index c356bed..c356bed 100644 --- a/isa/rv64ui/amoadd_d.S +++ b/isa/rv64ua/amoadd_d.S diff --git a/isa/rv64ui/amoadd_w.S b/isa/rv64ua/amoadd_w.S index b3d1953..b3d1953 100644 --- a/isa/rv64ui/amoadd_w.S +++ b/isa/rv64ua/amoadd_w.S diff --git a/isa/rv64ui/amoand_d.S b/isa/rv64ua/amoand_d.S index 13019ae..13019ae 100644 --- a/isa/rv64ui/amoand_d.S +++ b/isa/rv64ua/amoand_d.S diff --git a/isa/rv64ui/amoand_w.S b/isa/rv64ua/amoand_w.S index a843888..a843888 100644 --- a/isa/rv64ui/amoand_w.S +++ b/isa/rv64ua/amoand_w.S diff --git a/isa/rv64ui/amomax_d.S b/isa/rv64ua/amomax_d.S index ea7e2d3..ea7e2d3 100644 --- a/isa/rv64ui/amomax_d.S +++ b/isa/rv64ua/amomax_d.S diff --git a/isa/rv64ui/amomax_w.S b/isa/rv64ua/amomax_w.S index b3adbf0..b3adbf0 100644 --- a/isa/rv64ui/amomax_w.S +++ b/isa/rv64ua/amomax_w.S diff --git a/isa/rv64ui/amomaxu_d.S b/isa/rv64ua/amomaxu_d.S index b340873..b340873 100644 --- a/isa/rv64ui/amomaxu_d.S +++ b/isa/rv64ua/amomaxu_d.S diff --git a/isa/rv64ui/amomaxu_w.S b/isa/rv64ua/amomaxu_w.S index 41346d1..41346d1 100644 --- a/isa/rv64ui/amomaxu_w.S +++ b/isa/rv64ua/amomaxu_w.S diff --git a/isa/rv64ui/amomin_d.S b/isa/rv64ua/amomin_d.S index e6febbb..e6febbb 100644 --- a/isa/rv64ui/amomin_d.S +++ b/isa/rv64ua/amomin_d.S diff --git a/isa/rv64ui/amomin_w.S b/isa/rv64ua/amomin_w.S index 96b547b..96b547b 100644 --- a/isa/rv64ui/amomin_w.S +++ b/isa/rv64ua/amomin_w.S diff --git a/isa/rv64ui/amominu_d.S b/isa/rv64ua/amominu_d.S index a1013f3..a1013f3 100644 --- a/isa/rv64ui/amominu_d.S +++ b/isa/rv64ua/amominu_d.S diff --git a/isa/rv64ui/amominu_w.S b/isa/rv64ua/amominu_w.S index 0a9e265..0a9e265 100644 --- a/isa/rv64ui/amominu_w.S +++ b/isa/rv64ua/amominu_w.S diff --git a/isa/rv64ui/amoor_d.S b/isa/rv64ua/amoor_d.S index 507e877..507e877 100644 --- a/isa/rv64ui/amoor_d.S +++ b/isa/rv64ua/amoor_d.S diff --git a/isa/rv64ui/amoor_w.S b/isa/rv64ua/amoor_w.S index 47978ba..47978ba 100644 --- a/isa/rv64ui/amoor_w.S +++ b/isa/rv64ua/amoor_w.S diff --git a/isa/rv64ui/amoswap_d.S b/isa/rv64ua/amoswap_d.S index 628f537..628f537 100644 --- a/isa/rv64ui/amoswap_d.S +++ b/isa/rv64ua/amoswap_d.S diff --git a/isa/rv64ui/amoswap_w.S b/isa/rv64ua/amoswap_w.S index c09b866..c09b866 100644 --- a/isa/rv64ui/amoswap_w.S +++ b/isa/rv64ua/amoswap_w.S diff --git a/isa/rv64ui/amoxor_d.S b/isa/rv64ua/amoxor_d.S index f446121..f446121 100644 --- a/isa/rv64ui/amoxor_d.S +++ b/isa/rv64ua/amoxor_d.S diff --git a/isa/rv64ui/amoxor_w.S b/isa/rv64ua/amoxor_w.S index 2b92323..2b92323 100644 --- a/isa/rv64ui/amoxor_w.S +++ b/isa/rv64ua/amoxor_w.S diff --git a/isa/rv64ui/lrsc.S b/isa/rv64ua/lrsc.S index 9422739..9422739 100644 --- a/isa/rv64ui/lrsc.S +++ b/isa/rv64ua/lrsc.S diff --git a/isa/rv64ud/Makefrag b/isa/rv64ud/Makefrag new file mode 100644 index 0000000..6e8be9c --- /dev/null +++ b/isa/rv64ud/Makefrag @@ -0,0 +1,12 @@ +#======================================================================= +# Makefrag for rv64ud tests +#----------------------------------------------------------------------- + +rv64ud_sc_tests = \ + fadd fdiv fclass fcmp fcvt fcvt_w fmadd fmin fsgnj \ + ldst move structural recoding \ + +rv64ud_p_tests = $(addprefix rv64ud-p-, $(rv64ud_sc_tests)) +rv64ud_v_tests = $(addprefix rv64ud-v-, $(rv64ud_sc_tests)) + +spike_tests += $(rv64ud_p_tests) $(rv64ud_v_tests) diff --git a/isa/rv64ud/fadd.S b/isa/rv64ud/fadd.S new file mode 100644 index 0000000..4a314da --- /dev/null +++ b/isa/rv64ud/fadd.S @@ -0,0 +1,44 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fadd.S +#----------------------------------------------------------------------------- +# +# Test f{add|sub|mul}.d instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP2_D( 2, fadd.d, 0, 3.5, 2.5, 1.0 ); + TEST_FP_OP2_D( 3, fadd.d, 1, -1234, -1235.1, 1.1 ); + TEST_FP_OP2_D( 4, fadd.d, 1, 3.14159266, 3.14159265, 0.00000001 ); + + TEST_FP_OP2_D( 5, fsub.d, 0, 1.5, 2.5, 1.0 ); + TEST_FP_OP2_D( 6, fsub.d, 1, -1234, -1235.1, -1.1 ); + TEST_FP_OP2_D( 7, fsub.d, 1, 3.1415926400000001, 3.14159265, 0.00000001 ); + + TEST_FP_OP2_D( 8, fmul.d, 0, 2.5, 2.5, 1.0 ); + TEST_FP_OP2_D( 9, fmul.d, 1, 1358.61, -1235.1, -1.1 ); + TEST_FP_OP2_D(10, fmul.d, 1, 3.14159265e-8, 3.14159265, 0.00000001 ); + + # Is the canonical NaN generated for Inf - Inf? + TEST_FP_OP2_D(11, fsub.d, 0x10, 0d:7ff8000000000000, Inf, Inf); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/fclass.S b/isa/rv64ud/fclass.S new file mode 100644 index 0000000..3daace0 --- /dev/null +++ b/isa/rv64ud/fclass.S @@ -0,0 +1,44 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fclass.S +#----------------------------------------------------------------------------- +# +# Test fclass.d instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + #define TEST_FCLASS_D(testnum, correct, input) \ + TEST_CASE(testnum, a0, correct, li a0, input; fmv.d.x fa0, a0; \ + fclass.d a0, fa0) + + TEST_FCLASS_D( 2, 1 << 0, 0xfff0000000000000 ) + TEST_FCLASS_D( 3, 1 << 1, 0xbff0000000000000 ) + TEST_FCLASS_D( 4, 1 << 2, 0x800fffffffffffff ) + TEST_FCLASS_D( 5, 1 << 3, 0x8000000000000000 ) + TEST_FCLASS_D( 6, 1 << 4, 0x0000000000000000 ) + TEST_FCLASS_D( 7, 1 << 5, 0x000fffffffffffff ) + TEST_FCLASS_D( 8, 1 << 6, 0x3ff0000000000000 ) + TEST_FCLASS_D( 9, 1 << 7, 0x7ff0000000000000 ) + TEST_FCLASS_D(10, 1 << 8, 0x7ff0000000000001 ) + TEST_FCLASS_D(11, 1 << 9, 0x7ff8000000000000 ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/fcmp.S b/isa/rv64ud/fcmp.S new file mode 100644 index 0000000..173dc88 --- /dev/null +++ b/isa/rv64ud/fcmp.S @@ -0,0 +1,37 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fcmp.S +#----------------------------------------------------------------------------- +# +# Test f{eq|lt|le}.d instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_CMP_OP_D( 2, feq.d, 1, -1.36, -1.36) + TEST_FP_CMP_OP_D( 3, fle.d, 1, -1.36, -1.36) + TEST_FP_CMP_OP_D( 4, flt.d, 0, -1.36, -1.36) + + TEST_FP_CMP_OP_D( 5, feq.d, 0, -1.37, -1.36) + TEST_FP_CMP_OP_D( 6, fle.d, 1, -1.37, -1.36) + TEST_FP_CMP_OP_D( 7, flt.d, 1, -1.37, -1.36) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/fcvt.S b/isa/rv64ud/fcvt.S new file mode 100644 index 0000000..4f25d07 --- /dev/null +++ b/isa/rv64ud/fcvt.S @@ -0,0 +1,56 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fcvt.S +#----------------------------------------------------------------------------- +# +# Test fcvt.d.{wu|w|lu|l}, fcvt.s.d, and fcvt.d.s instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_INT_FP_OP_D(2, fcvt.d.w, 2.0, 2); + TEST_INT_FP_OP_D(3, fcvt.d.w, -2.0, -2); + + TEST_INT_FP_OP_D(4, fcvt.d.wu, 2.0, 2); + TEST_INT_FP_OP_D(5, fcvt.d.wu, 4294967294, -2); + + TEST_INT_FP_OP_D(6, fcvt.d.l, 2.0, 2); + TEST_INT_FP_OP_D(7, fcvt.d.l, -2.0, -2); + + TEST_INT_FP_OP_D(8, fcvt.d.lu, 2.0, 2); + TEST_INT_FP_OP_D(9, fcvt.d.lu, 1.8446744073709552e19, -2); + + TEST_FCVT_S_D(10, -1.5, -1.5) + TEST_FCVT_D_S(11, -1.5, -1.5) + + TEST_CASE(12, a0, 0x7ff8000000000000, + la a1, test_data_22; + ld a2, 0(a1); + fmv.d.x f2, a2; + fcvt.s.d f2, f2; + fcvt.d.s f2, f2; + fmv.x.d a0, f2; + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +test_data_22: + .dword 0x7ffcffffffff8004 + +RVTEST_DATA_END diff --git a/isa/rv64ud/fcvt_w.S b/isa/rv64ud/fcvt_w.S new file mode 100644 index 0000000..50e794c --- /dev/null +++ b/isa/rv64ud/fcvt_w.S @@ -0,0 +1,102 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fcvt_w.S +#----------------------------------------------------------------------------- +# +# Test fcvt{wu|w|lu|l}.d instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_INT_OP_D( 2, fcvt.w.d, 0x01, -1, -1.1, rtz); + TEST_FP_INT_OP_D( 3, fcvt.w.d, 0x00, -1, -1.0, rtz); + TEST_FP_INT_OP_D( 4, fcvt.w.d, 0x01, 0, -0.9, rtz); + TEST_FP_INT_OP_D( 5, fcvt.w.d, 0x01, 0, 0.9, rtz); + TEST_FP_INT_OP_D( 6, fcvt.w.d, 0x00, 1, 1.0, rtz); + TEST_FP_INT_OP_D( 7, fcvt.w.d, 0x01, 1, 1.1, rtz); + TEST_FP_INT_OP_D( 8, fcvt.w.d, 0x10, -1<<31, -3e9, rtz); + TEST_FP_INT_OP_D( 9, fcvt.w.d, 0x10, (1<<31)-1, 3e9, rtz); + + TEST_FP_INT_OP_D(12, fcvt.wu.d, 0x10, 0, -3.0, rtz); + TEST_FP_INT_OP_D(13, fcvt.wu.d, 0x10, 0, -1.0, rtz); + TEST_FP_INT_OP_D(14, fcvt.wu.d, 0x01, 0, -0.9, rtz); + TEST_FP_INT_OP_D(15, fcvt.wu.d, 0x01, 0, 0.9, rtz); + TEST_FP_INT_OP_D(16, fcvt.wu.d, 0x00, 1, 1.0, rtz); + TEST_FP_INT_OP_D(17, fcvt.wu.d, 0x01, 1, 1.1, rtz); + TEST_FP_INT_OP_D(18, fcvt.wu.d, 0x10, 0, -3e9, rtz); + TEST_FP_INT_OP_D(19, fcvt.wu.d, 0x00, 0xffffffffb2d05e00, 3e9, rtz); + + TEST_FP_INT_OP_D(22, fcvt.l.d, 0x01, -1, -1.1, rtz); + TEST_FP_INT_OP_D(23, fcvt.l.d, 0x00, -1, -1.0, rtz); + TEST_FP_INT_OP_D(24, fcvt.l.d, 0x01, 0, -0.9, rtz); + TEST_FP_INT_OP_D(25, fcvt.l.d, 0x01, 0, 0.9, rtz); + TEST_FP_INT_OP_D(26, fcvt.l.d, 0x00, 1, 1.0, rtz); + TEST_FP_INT_OP_D(27, fcvt.l.d, 0x01, 1, 1.1, rtz); + TEST_FP_INT_OP_D(28, fcvt.l.d, 0x00,-3000000000, -3e9, rtz); + TEST_FP_INT_OP_D(29, fcvt.l.d, 0x00, 3000000000, 3e9, rtz); + TEST_FP_INT_OP_D(20, fcvt.l.d, 0x10, -1<<63,-3e19, rtz); + TEST_FP_INT_OP_D(21, fcvt.l.d, 0x10, (1<<63)-1, 3e19, rtz); + + TEST_FP_INT_OP_D(32, fcvt.lu.d, 0x10, 0, -3.0, rtz); + TEST_FP_INT_OP_D(33, fcvt.lu.d, 0x10, 0, -1.0, rtz); + TEST_FP_INT_OP_D(34, fcvt.lu.d, 0x01, 0, -0.9, rtz); + TEST_FP_INT_OP_D(35, fcvt.lu.d, 0x01, 0, 0.9, rtz); + TEST_FP_INT_OP_D(36, fcvt.lu.d, 0x00, 1, 1.0, rtz); + TEST_FP_INT_OP_D(37, fcvt.lu.d, 0x01, 1, 1.1, rtz); + TEST_FP_INT_OP_D(38, fcvt.lu.d, 0x10, 0, -3e9, rtz); + TEST_FP_INT_OP_D(39, fcvt.lu.d, 0x00, 3000000000, 3e9, rtz); + + # test negative NaN, negative infinity conversion + TEST_CASE(42, x1, 0x000000007fffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.w.d x1, f1) + TEST_CASE(43, x1, 0x7fffffffffffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.l.d x1, f1) + TEST_CASE(44, x1, 0xffffffff80000000, la x1, tdat_d; fld f1, 16(x1); fcvt.w.d x1, f1) + TEST_CASE(45, x1, 0x8000000000000000, la x1, tdat_d; fld f1, 16(x1); fcvt.l.d x1, f1) + + # test positive NaN, positive infinity conversion + TEST_CASE(52, x1, 0x000000007fffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.w.d x1, f1) + TEST_CASE(53, x1, 0x7fffffffffffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.l.d x1, f1) + TEST_CASE(54, x1, 0x000000007fffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.w.d x1, f1) + TEST_CASE(55, x1, 0x7fffffffffffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.l.d x1, f1) + + # test NaN, infinity conversions to unsigned integer + TEST_CASE(62, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.wu.d x1, f1) + TEST_CASE(63, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.wu.d x1, f1) + TEST_CASE(64, x1, 0, la x1, tdat_d; fld f1, 16(x1); fcvt.wu.d x1, f1) + TEST_CASE(65, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.wu.d x1, f1) + TEST_CASE(66, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.lu.d x1, f1) + TEST_CASE(67, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.lu.d x1, f1) + TEST_CASE(68, x1, 0, la x1, tdat_d; fld f1, 16(x1); fcvt.lu.d x1, f1) + TEST_CASE(69, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.lu.d x1, f1) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +# -NaN, NaN, -inf, +inf +tdat: +.word 0xffffffff +.word 0x7fffffff +.word 0xff800000 +.word 0x7f800000 + +tdat_d: +.dword 0xffffffffffffffff +.dword 0x7fffffffffffffff +.dword 0xfff0000000000000 +.dword 0x7ff0000000000000 + +RVTEST_DATA_END diff --git a/isa/rv64ud/fdiv.S b/isa/rv64ud/fdiv.S new file mode 100644 index 0000000..8a9fd4d --- /dev/null +++ b/isa/rv64ud/fdiv.S @@ -0,0 +1,42 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fdiv.S +#----------------------------------------------------------------------------- +# +# Test f{div|sqrt}.d instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP2_D( 2, fdiv.d, 1, 1.1557273520668288, 3.14159265, 2.71828182 ); + TEST_FP_OP2_D( 3, fdiv.d, 1,-0.9991093838555584, -1234, 1235.1 ); + TEST_FP_OP2_D( 4, fdiv.d, 0, 3.14159265, 3.14159265, 1.0 ); + + TEST_FP_OP1_D( 5, fsqrt.d, 1, 1.7724538498928541, 3.14159265 ); + TEST_FP_OP1_D( 6, fsqrt.d, 0, 100, 10000 ); + + TEST_FP_OP1_D_DWORD_RESULT(16, fsqrt.d, 0x10, 0x7FF8000000000000, -1.0 ); + + TEST_FP_OP1_D( 7, fsqrt.d, 1, 13.076696830622021, 171.0); + + TEST_FP_OP1_D( 8, fsqrt.d, 1,0.00040099251863345283320230749702, 1.60795e-7); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/fmadd.S b/isa/rv64ud/fmadd.S new file mode 100644 index 0000000..7a69aad --- /dev/null +++ b/isa/rv64ud/fmadd.S @@ -0,0 +1,45 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fmadd.S +#----------------------------------------------------------------------------- +# +# Test f[n]m{add|sub}.s and f[n]m{add|sub}.d instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP3_D( 2, fmadd.d, 0, 3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D( 3, fmadd.d, 1, 1236.1999999999999, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D( 4, fmadd.d, 0, -12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_D( 5, fnmadd.d, 0, -3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D( 6, fnmadd.d, 1, -1236.1999999999999, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D( 7, fnmadd.d, 0, 12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_D( 8, fmsub.d, 0, 1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D( 9, fmsub.d, 1, 1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D(10, fmsub.d, 0, -8.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_D(11, fnmsub.d, 0, -1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D(12, fnmsub.d, 1, -1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D(13, fnmsub.d, 0, 8.0, 2.0, -5.0, -2.0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/fmin.S b/isa/rv64ud/fmin.S new file mode 100644 index 0000000..82641bc --- /dev/null +++ b/isa/rv64ud/fmin.S @@ -0,0 +1,43 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fmin.S +#----------------------------------------------------------------------------- +# +# Test f{min|max}.d instructinos. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP2_D( 2, fmin.d, 0, 1.0, 2.5, 1.0 ); + TEST_FP_OP2_D( 3, fmin.d, 0, -1235.1, -1235.1, 1.1 ); + TEST_FP_OP2_D( 4, fmin.d, 0, -1235.1, 1.1, -1235.1 ); + TEST_FP_OP2_D( 5, fmin.d, 0, -1235.1, NaN, -1235.1 ); + TEST_FP_OP2_D( 6, fmin.d, 0, 0.00000001, 3.14159265, 0.00000001 ); + TEST_FP_OP2_D( 7, fmin.d, 0, -2.0, -1.0, -2.0 ); + + TEST_FP_OP2_D(12, fmax.d, 0, 2.5, 2.5, 1.0 ); + TEST_FP_OP2_D(13, fmax.d, 0, 1.1, -1235.1, 1.1 ); + TEST_FP_OP2_D(14, fmax.d, 0, 1.1, 1.1, -1235.1 ); + TEST_FP_OP2_D(15, fmax.d, 0, -1235.1, NaN, -1235.1 ); + TEST_FP_OP2_D(16, fmax.d, 0, 3.14159265, 3.14159265, 0.00000001 ); + TEST_FP_OP2_D(17, fmax.d, 0, -1.0, -1.0, -2.0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/fsgnj.S b/isa/rv64ud/fsgnj.S new file mode 100644 index 0000000..e914777 --- /dev/null +++ b/isa/rv64ud/fsgnj.S @@ -0,0 +1,44 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fsgnj.S +#----------------------------------------------------------------------------- +# +# Test fsgn{j|jn|x}.d instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP2_D( 2, fsgnj.d, 0, -6.3, 6.3, -1.0 ); + TEST_FP_OP2_D( 3, fsgnj.d, 0, 7.3, 7.3, 2.0 ); + TEST_FP_OP2_D( 4, fsgnj.d, 0, -8.3, -8.3, -3.0 ); + TEST_FP_OP2_D( 5, fsgnj.d, 0, 9.3, -9.3, 4.0 ); + + TEST_FP_OP2_D(12, fsgnjn.d, 0, 6.3, 6.3, -1.0 ); + TEST_FP_OP2_D(13, fsgnjn.d, 0, -7.3, 7.3, 2.0 ); + TEST_FP_OP2_D(14, fsgnjn.d, 0, 8.3, -8.3, -3.0 ); + TEST_FP_OP2_D(15, fsgnjn.d, 0, -9.3, -9.3, 4.0 ); + + TEST_FP_OP2_D(22, fsgnjx.d, 0, -6.3, 6.3, -1.0 ); + TEST_FP_OP2_D(23, fsgnjx.d, 0, 7.3, 7.3, 2.0 ); + TEST_FP_OP2_D(24, fsgnjx.d, 0, 8.3, -8.3, -3.0 ); + TEST_FP_OP2_D(25, fsgnjx.d, 0, -9.3, -9.3, 4.0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/ldst.S b/isa/rv64ud/ldst.S new file mode 100644 index 0000000..59084e3 --- /dev/null +++ b/isa/rv64ud/ldst.S @@ -0,0 +1,38 @@ +# See LICENSE for license details. + +#***************************************************************************** +# ldst.S +#----------------------------------------------------------------------------- +# +# This test verifies that flw, fld, fsw, and fsd work properly. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + TEST_CASE(2, a0, 0x40000000bf800000, la a1, tdat; fld f2, 0(a1); fsd f2, 16(a1); ld a0, 16(a1)) + TEST_CASE(3, a0, 0xc080000040400000, la a1, tdat; fld f2, 8(a1); fsd f2, 16(a1); ld a0, 16(a1)) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +.word 0xbf800000 +.word 0x40000000 +.word 0x40400000 +.word 0xc0800000 +.word 0xdeadbeef +.word 0xcafebabe +.word 0xabad1dea +.word 0x1337d00d + +RVTEST_DATA_END diff --git a/isa/rv64ud/move.S b/isa/rv64ud/move.S new file mode 100644 index 0000000..806d4de --- /dev/null +++ b/isa/rv64ud/move.S @@ -0,0 +1,36 @@ +# See LICENSE for license details. + +#***************************************************************************** +# move.S +#----------------------------------------------------------------------------- +# +# This test verifies that mxtf.[s,d], mftx.[s,d], fssr, frsr, +# and fsgnj[x|n].d work properly. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + +li a0, 1 +fssr 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, 0x3FF02468A0000000, li a1, 0x3FF02468A0000000; fmv.d.x f1, a1; fmv.x.d a0, f1) + TEST_CASE(6, 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 + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64ud/recoding.S b/isa/rv64ud/recoding.S new file mode 100644 index 0000000..69ad665 --- /dev/null +++ b/isa/rv64ud/recoding.S @@ -0,0 +1,67 @@ +# See LICENSE for license details. + +#***************************************************************************** +# recoding.S +#----------------------------------------------------------------------------- +# +# Test corner cases of John Hauser's microarchitectural recoding scheme. +# There are twice as many recoded values as IEEE-754 values; some of these +# extras are redundant (e.g. Inf) and others are illegal (subnormals with +# too many bits set). +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + # Make sure infinities with different mantissas compare as equal. + fld f0, minf, a0 + fld f1, three, a0 + fmul.d f1, f1, f0 + TEST_CASE( 2, a0, 1, feq.d a0, f0, f1) + TEST_CASE( 3, a0, 1, fle.d a0, f0, f1) + TEST_CASE( 4, a0, 0, flt.d a0, f0, f1) + + # Likewise, but for zeroes. + fcvt.d.w f0, x0 + li a0, 1 + fcvt.d.w f1, a0 + fmul.d f1, f1, f0 + TEST_CASE(5, a0, 1, feq.d a0, f0, f1) + TEST_CASE(6, a0, 1, fle.d a0, f0, f1) + TEST_CASE(7, a0, 0, flt.d a0, f0, f1) + + # When converting small doubles to single-precision subnormals, + # ensure that the extra precision is discarded. + flw f0, big, a0 + fld f1, tiny, a0 + fcvt.s.d f1, f1 + fmul.s f0, f0, f1 + fmv.x.s a0, f0 + lw a1, small + TEST_CASE(10, a0, 0, sub a0, a0, a1) + + # Make sure FSD+FLD correctly saves and restores a single-precision value. + flw f0, three, a0 + fadd.s f1, f0, f0 + fadd.s f0, f0, f0 + fsd f0, tiny, a0 + fld f0, tiny, a0 + TEST_CASE(20, a0, 1, feq.s a0, f0, f1) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + +minf: .double -Inf +three: .double 3.0 +big: .float 1221 +small: .float 2.9133121e-37 +tiny: .double 2.3860049081905093e-40 + +RVTEST_DATA_END diff --git a/isa/rv64uf/structural.S b/isa/rv64ud/structural.S index 76c6691..76c6691 100644 --- a/isa/rv64uf/structural.S +++ b/isa/rv64ud/structural.S diff --git a/isa/rv64uf/Makefrag b/isa/rv64uf/Makefrag index 978084a..d3c3f23 100644 --- a/isa/rv64uf/Makefrag +++ b/isa/rv64uf/Makefrag @@ -4,7 +4,7 @@ rv64uf_sc_tests = \ fadd fdiv fclass fcmp fcvt fcvt_w fmadd fmin fsgnj \ - ldst move structural recoding \ + ldst move recoding \ rv64uf_p_tests = $(addprefix rv64uf-p-, $(rv64uf_sc_tests)) rv64uf_v_tests = $(addprefix rv64uf-v-, $(rv64uf_sc_tests)) diff --git a/isa/rv64uf/fadd.S b/isa/rv64uf/fadd.S index a5f3e42..800dc8c 100644 --- a/isa/rv64uf/fadd.S +++ b/isa/rv64uf/fadd.S @@ -4,7 +4,7 @@ # fadd.S #----------------------------------------------------------------------------- # -# Test f{add|sub|mul}.{s|d} instructions. +# Test f{add|sub|mul}.s instructions. # #include "riscv_test.h" @@ -21,29 +21,16 @@ RVTEST_CODE_BEGIN TEST_FP_OP2_S( 3, fadd.s, 1, -1234, -1235.1, 1.1 ); TEST_FP_OP2_S( 4, fadd.s, 1, 3.14159265, 3.14159265, 0.00000001 ); - TEST_FP_OP2_D( 5, fadd.d, 0, 3.5, 2.5, 1.0 ); - TEST_FP_OP2_D( 6, fadd.d, 1, -1234, -1235.1, 1.1 ); - TEST_FP_OP2_D( 7, fadd.d, 1, 3.14159266, 3.14159265, 0.00000001 ); + TEST_FP_OP2_S( 5, fsub.s, 0, 1.5, 2.5, 1.0 ); + TEST_FP_OP2_S( 6, fsub.s, 1, -1234, -1235.1, -1.1 ); + TEST_FP_OP2_S( 7, fsub.s, 1, 3.14159265, 3.14159265, 0.00000001 ); - TEST_FP_OP2_S(12, fsub.s, 0, 1.5, 2.5, 1.0 ); - TEST_FP_OP2_S(13, fsub.s, 1, -1234, -1235.1, -1.1 ); - TEST_FP_OP2_S(14, fsub.s, 1, 3.14159265, 3.14159265, 0.00000001 ); - - TEST_FP_OP2_D(15, fsub.d, 0, 1.5, 2.5, 1.0 ); - TEST_FP_OP2_D(16, fsub.d, 1, -1234, -1235.1, -1.1 ); - TEST_FP_OP2_D(17, fsub.d, 1, 3.1415926400000001, 3.14159265, 0.00000001 ); - - TEST_FP_OP2_S(22, fmul.s, 0, 2.5, 2.5, 1.0 ); - TEST_FP_OP2_S(23, fmul.s, 1, 1358.61, -1235.1, -1.1 ); - TEST_FP_OP2_S(24, fmul.s, 1, 3.14159265e-8, 3.14159265, 0.00000001 ); - - TEST_FP_OP2_D(25, fmul.d, 0, 2.5, 2.5, 1.0 ); - TEST_FP_OP2_D(26, fmul.d, 1, 1358.61, -1235.1, -1.1 ); - TEST_FP_OP2_D(27, fmul.d, 1, 3.14159265e-8, 3.14159265, 0.00000001 ); + TEST_FP_OP2_S( 8, fmul.s, 0, 2.5, 2.5, 1.0 ); + TEST_FP_OP2_S( 9, fmul.s, 1, 1358.61, -1235.1, -1.1 ); + TEST_FP_OP2_S(10, fmul.s, 1, 3.14159265e-8, 3.14159265, 0.00000001 ); # Is the canonical NaN generated for Inf - Inf? - TEST_FP_OP2_S(28, fsub.s, 0x10, 0f:7fc00000, Inf, Inf); - TEST_FP_OP2_D(29, fsub.d, 0x10, 0d:7ff8000000000000, Inf, Inf); + TEST_FP_OP2_S(11, fsub.s, 0x10, 0f:7fc00000, Inf, Inf); TEST_PASSFAIL diff --git a/isa/rv64uf/fclass.S b/isa/rv64uf/fclass.S index bcebbf8..5a6361e 100644 --- a/isa/rv64uf/fclass.S +++ b/isa/rv64uf/fclass.S @@ -4,7 +4,7 @@ # fclass.S #----------------------------------------------------------------------------- # -# Test fclass.{s|d} instructions. +# Test fclass.s instructions. # #include "riscv_test.h" @@ -32,21 +32,6 @@ RVTEST_CODE_BEGIN TEST_FCLASS_S(10, 1 << 8, 0x7f800001 ) TEST_FCLASS_S(11, 1 << 9, 0x7fc00000 ) - #define TEST_FCLASS_D(testnum, correct, input) \ - TEST_CASE(testnum, a0, correct, li a0, input; fmv.d.x fa0, a0; \ - fclass.d a0, fa0) - - TEST_FCLASS_D(12, 1 << 0, 0xfff0000000000000 ) - TEST_FCLASS_D(13, 1 << 1, 0xbff0000000000000 ) - TEST_FCLASS_D(14, 1 << 2, 0x800fffffffffffff ) - TEST_FCLASS_D(15, 1 << 3, 0x8000000000000000 ) - TEST_FCLASS_D(16, 1 << 4, 0x0000000000000000 ) - TEST_FCLASS_D(17, 1 << 5, 0x000fffffffffffff ) - TEST_FCLASS_D(18, 1 << 6, 0x3ff0000000000000 ) - TEST_FCLASS_D(19, 1 << 7, 0x7ff0000000000000 ) - TEST_FCLASS_D(20, 1 << 8, 0x7ff0000000000001 ) - TEST_FCLASS_D(21, 1 << 9, 0x7ff8000000000000 ) - TEST_PASSFAIL RVTEST_CODE_END diff --git a/isa/rv64uf/fcmp.S b/isa/rv64uf/fcmp.S index 252ad29..24b08c7 100644 --- a/isa/rv64uf/fcmp.S +++ b/isa/rv64uf/fcmp.S @@ -4,7 +4,7 @@ # fcmp.S #----------------------------------------------------------------------------- # -# Test f{eq|lt|le}.{s|d} instructions. +# Test f{eq|lt|le}.s instructions. # #include "riscv_test.h" diff --git a/isa/rv64uf/fcvt.S b/isa/rv64uf/fcvt.S index cbaf6d3..7bcb49a 100644 --- a/isa/rv64uf/fcvt.S +++ b/isa/rv64uf/fcvt.S @@ -4,7 +4,7 @@ # fcvt.S #----------------------------------------------------------------------------- # -# Test fcvt.{s|d}.{wu|w|lu|l}, fcvt.s.d, and fcvt.d.s instructions. +# Test fcvt.s.{wu|w|lu|l}, fcvt.s.d, and fcvt.d.s instructions. # #include "riscv_test.h" @@ -29,30 +29,6 @@ RVTEST_CODE_BEGIN TEST_INT_FP_OP_S( 8, fcvt.s.lu, 2.0, 2); TEST_INT_FP_OP_S( 9, fcvt.s.lu, 1.8446744e19, -2); - TEST_INT_FP_OP_D(12, fcvt.d.w, 2.0, 2); - TEST_INT_FP_OP_D(13, fcvt.d.w, -2.0, -2); - - TEST_INT_FP_OP_D(14, fcvt.d.wu, 2.0, 2); - TEST_INT_FP_OP_D(15, fcvt.d.wu, 4294967294, -2); - - TEST_INT_FP_OP_D(16, fcvt.d.l, 2.0, 2); - TEST_INT_FP_OP_D(17, fcvt.d.l, -2.0, -2); - - TEST_INT_FP_OP_D(18, fcvt.d.lu, 2.0, 2); - TEST_INT_FP_OP_D(19, fcvt.d.lu, 1.8446744073709552e19, -2); - - TEST_FCVT_S_D(20, -1.5, -1.5) - TEST_FCVT_D_S(21, -1.5, -1.5) - - TEST_CASE(22, a0, 0x7ff8000000000000, - la a1, test_data_22; - ld a2, 0(a1); - fmv.d.x f2, a2; - fcvt.s.d f2, f2; - fcvt.d.s f2, f2; - fmv.x.d a0, f2; - ) - TEST_PASSFAIL RVTEST_CODE_END @@ -62,7 +38,4 @@ RVTEST_DATA_BEGIN TEST_DATA -test_data_22: - .dword 0x7ffcffffffff8004 - RVTEST_DATA_END diff --git a/isa/rv64uf/fcvt_w.S b/isa/rv64uf/fcvt_w.S index 7b78eec..92faffa 100644 --- a/isa/rv64uf/fcvt_w.S +++ b/isa/rv64uf/fcvt_w.S @@ -4,7 +4,7 @@ # fcvt_w.S #----------------------------------------------------------------------------- # -# Test fcvt{wu|w|lu|l}.{s|d} instructions. +# Test fcvt{wu|w|lu|l}.s instructions. # #include "riscv_test.h" @@ -50,85 +50,28 @@ RVTEST_CODE_BEGIN TEST_FP_INT_OP_S(37, fcvt.lu.s, 0x01, 1, 1.1, rtz); TEST_FP_INT_OP_S(38, fcvt.lu.s, 0x10, 0, -3e9, rtz); - TEST_FP_INT_OP_D(42, fcvt.w.d, 0x01, -1, -1.1, rtz); - TEST_FP_INT_OP_D(43, fcvt.w.d, 0x00, -1, -1.0, rtz); - TEST_FP_INT_OP_D(44, fcvt.w.d, 0x01, 0, -0.9, rtz); - TEST_FP_INT_OP_D(45, fcvt.w.d, 0x01, 0, 0.9, rtz); - TEST_FP_INT_OP_D(46, fcvt.w.d, 0x00, 1, 1.0, rtz); - TEST_FP_INT_OP_D(47, fcvt.w.d, 0x01, 1, 1.1, rtz); - TEST_FP_INT_OP_D(48, fcvt.w.d, 0x10, -1<<31, -3e9, rtz); - TEST_FP_INT_OP_D(49, fcvt.w.d, 0x10, (1<<31)-1, 3e9, rtz); - - TEST_FP_INT_OP_D(52, fcvt.wu.d, 0x10, 0, -3.0, rtz); - TEST_FP_INT_OP_D(53, fcvt.wu.d, 0x10, 0, -1.0, rtz); - TEST_FP_INT_OP_D(54, fcvt.wu.d, 0x01, 0, -0.9, rtz); - TEST_FP_INT_OP_D(55, fcvt.wu.d, 0x01, 0, 0.9, rtz); - TEST_FP_INT_OP_D(56, fcvt.wu.d, 0x00, 1, 1.0, rtz); - TEST_FP_INT_OP_D(57, fcvt.wu.d, 0x01, 1, 1.1, rtz); - TEST_FP_INT_OP_D(58, fcvt.wu.d, 0x10, 0, -3e9, rtz); - TEST_FP_INT_OP_D(59, fcvt.wu.d, 0x00, 0xffffffffb2d05e00, 3e9, rtz); - - TEST_FP_INT_OP_D(62, fcvt.l.d, 0x01, -1, -1.1, rtz); - TEST_FP_INT_OP_D(63, fcvt.l.d, 0x00, -1, -1.0, rtz); - TEST_FP_INT_OP_D(64, fcvt.l.d, 0x01, 0, -0.9, rtz); - TEST_FP_INT_OP_D(65, fcvt.l.d, 0x01, 0, 0.9, rtz); - TEST_FP_INT_OP_D(66, fcvt.l.d, 0x00, 1, 1.0, rtz); - TEST_FP_INT_OP_D(67, fcvt.l.d, 0x01, 1, 1.1, rtz); - TEST_FP_INT_OP_D(68, fcvt.l.d, 0x00,-3000000000, -3e9, rtz); - TEST_FP_INT_OP_D(69, fcvt.l.d, 0x00, 3000000000, 3e9, rtz); - TEST_FP_INT_OP_D(60, fcvt.l.d, 0x10, -1<<63,-3e19, rtz); - TEST_FP_INT_OP_D(61, fcvt.l.d, 0x10, (1<<63)-1, 3e19, rtz); - - TEST_FP_INT_OP_D(72, fcvt.lu.d, 0x10, 0, -3.0, rtz); - TEST_FP_INT_OP_D(73, fcvt.lu.d, 0x10, 0, -1.0, rtz); - TEST_FP_INT_OP_D(74, fcvt.lu.d, 0x01, 0, -0.9, rtz); - TEST_FP_INT_OP_D(75, fcvt.lu.d, 0x01, 0, 0.9, rtz); - TEST_FP_INT_OP_D(76, fcvt.lu.d, 0x00, 1, 1.0, rtz); - TEST_FP_INT_OP_D(77, fcvt.lu.d, 0x01, 1, 1.1, rtz); - TEST_FP_INT_OP_D(78, fcvt.lu.d, 0x10, 0, -3e9, rtz); - TEST_FP_INT_OP_D(79, fcvt.lu.d, 0x00, 3000000000, 3e9, rtz); - # test negative NaN, negative infinity conversion - TEST_CASE( 80, x1, 0x000000007fffffff, la x1, tdat ; flw f1, 0(x1); fcvt.w.s x1, f1) - TEST_CASE( 81, x1, 0x7fffffffffffffff, la x1, tdat ; flw f1, 0(x1); fcvt.l.s x1, f1) - TEST_CASE( 82, x1, 0xffffffff80000000, la x1, tdat ; flw f1, 8(x1); fcvt.w.s x1, f1) - TEST_CASE( 83, x1, 0x8000000000000000, la x1, tdat ; flw f1, 8(x1); fcvt.l.s x1, f1) - - TEST_CASE( 84, x1, 0x000000007fffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.w.d x1, f1) - TEST_CASE( 85, x1, 0x7fffffffffffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.l.d x1, f1) - TEST_CASE( 86, x1, 0xffffffff80000000, la x1, tdat_d; fld f1, 16(x1); fcvt.w.d x1, f1) - TEST_CASE( 87, x1, 0x8000000000000000, la x1, tdat_d; fld f1, 16(x1); fcvt.l.d x1, f1) + TEST_CASE( 42, x1, 0x000000007fffffff, la x1, tdat ; flw f1, 0(x1); fcvt.w.s x1, f1) + TEST_CASE( 43, x1, 0x7fffffffffffffff, la x1, tdat ; flw f1, 0(x1); fcvt.l.s x1, f1) + TEST_CASE( 44, x1, 0xffffffff80000000, la x1, tdat ; flw f1, 8(x1); fcvt.w.s x1, f1) + TEST_CASE( 45, x1, 0x8000000000000000, la x1, tdat ; flw f1, 8(x1); fcvt.l.s x1, f1) # test positive NaN, positive infinity conversion - TEST_CASE( 88, x1, 0x000000007fffffff, la x1, tdat ; flw f1, 4(x1); fcvt.w.s x1, f1) - TEST_CASE( 89, x1, 0x7fffffffffffffff, la x1, tdat ; flw f1, 4(x1); fcvt.l.s x1, f1) - TEST_CASE( 90, x1, 0x000000007fffffff, la x1, tdat ; flw f1, 12(x1); fcvt.w.s x1, f1) - TEST_CASE( 91, x1, 0x7fffffffffffffff, la x1, tdat ; flw f1, 12(x1); fcvt.l.s x1, f1) - - TEST_CASE( 92, x1, 0x000000007fffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.w.d x1, f1) - TEST_CASE( 93, x1, 0x7fffffffffffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.l.d x1, f1) - TEST_CASE( 94, x1, 0x000000007fffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.w.d x1, f1) - TEST_CASE( 95, x1, 0x7fffffffffffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.l.d x1, f1) + TEST_CASE( 52, x1, 0x000000007fffffff, la x1, tdat ; flw f1, 4(x1); fcvt.w.s x1, f1) + TEST_CASE( 53, x1, 0x7fffffffffffffff, la x1, tdat ; flw f1, 4(x1); fcvt.l.s x1, f1) + TEST_CASE( 54, x1, 0x000000007fffffff, la x1, tdat ; flw f1, 12(x1); fcvt.w.s x1, f1) + TEST_CASE( 55, x1, 0x7fffffffffffffff, la x1, tdat ; flw f1, 12(x1); fcvt.l.s x1, f1) # test NaN, infinity conversions to unsigned integer - TEST_CASE( 96, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 0(x1); fcvt.wu.s x1, f1) - TEST_CASE( 97, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 4(x1); fcvt.wu.s x1, f1) - TEST_CASE( 98, x1, 0, la x1, tdat ; flw f1, 8(x1); fcvt.wu.s x1, f1) - TEST_CASE( 99, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 12(x1); fcvt.wu.s x1, f1) - TEST_CASE(100, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 0(x1); fcvt.lu.s x1, f1) - TEST_CASE(101, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 4(x1); fcvt.lu.s x1, f1) - TEST_CASE(102, x1, 0, la x1, tdat ; flw f1, 8(x1); fcvt.lu.s x1, f1) - TEST_CASE(103, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 12(x1); fcvt.lu.s x1, f1) + TEST_CASE( 62, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 0(x1); fcvt.wu.s x1, f1) + TEST_CASE( 63, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 4(x1); fcvt.wu.s x1, f1) + TEST_CASE( 64, x1, 0, la x1, tdat ; flw f1, 8(x1); fcvt.wu.s x1, f1) + TEST_CASE( 65, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 12(x1); fcvt.wu.s x1, f1) + TEST_CASE( 66, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 0(x1); fcvt.lu.s x1, f1) + TEST_CASE( 67, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 4(x1); fcvt.lu.s x1, f1) + TEST_CASE( 68, x1, 0, la x1, tdat ; flw f1, 8(x1); fcvt.lu.s x1, f1) + TEST_CASE( 69, x1, 0xffffffffffffffff, la x1, tdat ; flw f1, 12(x1); fcvt.lu.s x1, f1) - TEST_CASE(104, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.wu.d x1, f1) - TEST_CASE(105, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.wu.d x1, f1) - TEST_CASE(106, x1, 0, la x1, tdat_d; fld f1, 16(x1); fcvt.wu.d x1, f1) - TEST_CASE(107, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.wu.d x1, f1) - TEST_CASE(108, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 0(x1); fcvt.lu.d x1, f1) - TEST_CASE(109, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 8(x1); fcvt.lu.d x1, f1) - TEST_CASE(110, x1, 0, la x1, tdat_d; fld f1, 16(x1); fcvt.lu.d x1, f1) - TEST_CASE(111, x1, 0xffffffffffffffff, la x1, tdat_d; fld f1, 24(x1); fcvt.lu.d x1, f1) - TEST_PASSFAIL RVTEST_CODE_END diff --git a/isa/rv64uf/fdiv.S b/isa/rv64uf/fdiv.S index 688f635..a75a23d 100644 --- a/isa/rv64uf/fdiv.S +++ b/isa/rv64uf/fdiv.S @@ -4,7 +4,7 @@ # fdiv.S #----------------------------------------------------------------------------- # -# Test f{div|sqrt}.{s|d} instructions. +# Test f{div|sqrt}.s instructions. # #include "riscv_test.h" @@ -17,27 +17,16 @@ RVTEST_CODE_BEGIN # Arithmetic tests #------------------------------------------------------------- - TEST_FP_OP2_S( 2, fdiv.s, 1, 1.1557273520668288, 3.14159265, 2.71828182 ); - TEST_FP_OP2_S( 3, fdiv.s, 1,-0.9991093838555584, -1234, 1235.1 ); - TEST_FP_OP2_S( 4, fdiv.s, 0, 3.14159265, 3.14159265, 1.0 ); + TEST_FP_OP2_S(2, fdiv.s, 1, 1.1557273520668288, 3.14159265, 2.71828182 ); + TEST_FP_OP2_S(3, fdiv.s, 1,-0.9991093838555584, -1234, 1235.1 ); + TEST_FP_OP2_S(4, fdiv.s, 0, 3.14159265, 3.14159265, 1.0 ); - TEST_FP_OP2_D( 5, fdiv.d, 1, 1.1557273520668288, 3.14159265, 2.71828182 ); - TEST_FP_OP2_D( 6, fdiv.d, 1,-0.9991093838555584, -1234, 1235.1 ); - TEST_FP_OP2_D( 7, fdiv.d, 0, 3.14159265, 3.14159265, 1.0 ); + TEST_FP_OP1_S(5, fsqrt.s, 1, 1.7724538498928541, 3.14159265 ); + TEST_FP_OP1_S(6, fsqrt.s, 0, 100, 10000 ); - TEST_FP_OP1_S(11, fsqrt.s, 1, 1.7724538498928541, 3.14159265 ); - TEST_FP_OP1_S(12, fsqrt.s, 0, 100, 10000 ); + TEST_FP_OP1_S_DWORD_RESULT(7, fsqrt.s, 0x10, 0x7FC00000, -1.0 ); - TEST_FP_OP1_D(13, fsqrt.d, 1, 1.7724538498928541, 3.14159265 ); - TEST_FP_OP1_D(14, fsqrt.d, 0, 100, 10000 ); - - TEST_FP_OP1_S_DWORD_RESULT(15, fsqrt.s, 0x10, 0x7FC00000, -1.0 ); - TEST_FP_OP1_D_DWORD_RESULT(16, fsqrt.d, 0x10, 0x7FF8000000000000, -1.0 ); - - TEST_FP_OP1_S(17, fsqrt.s, 1, 13.076696, 171.0); - TEST_FP_OP1_D(18, fsqrt.d, 1, 13.076696830622021, 171.0); - - TEST_FP_OP1_D(19, fsqrt.d, 1,0.00040099251863345283320230749702, 1.60795e-7); + TEST_FP_OP1_S(8, fsqrt.s, 1, 13.076696, 171.0); TEST_PASSFAIL diff --git a/isa/rv64uf/fmadd.S b/isa/rv64uf/fmadd.S index 62ea102..241bead 100644 --- a/isa/rv64uf/fmadd.S +++ b/isa/rv64uf/fmadd.S @@ -21,33 +21,17 @@ RVTEST_CODE_BEGIN TEST_FP_OP3_S( 3, fmadd.s, 1, 1236.2, -1.0, -1235.1, 1.1 ); TEST_FP_OP3_S( 4, fmadd.s, 0, -12.0, 2.0, -5.0, -2.0 ); - TEST_FP_OP3_D( 5, fmadd.d, 0, 3.5, 1.0, 2.5, 1.0 ); - TEST_FP_OP3_D( 6, fmadd.d, 1, 1236.1999999999999, -1.0, -1235.1, 1.1 ); - TEST_FP_OP3_D( 7, fmadd.d, 0, -12.0, 2.0, -5.0, -2.0 ); + TEST_FP_OP3_S( 5, fnmadd.s, 0, -3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_S( 6, fnmadd.s, 1, -1236.2, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_S( 7, fnmadd.s, 0, 12.0, 2.0, -5.0, -2.0 ); - TEST_FP_OP3_S( 8, fnmadd.s, 0, -3.5, 1.0, 2.5, 1.0 ); - TEST_FP_OP3_S( 9, fnmadd.s, 1, -1236.2, -1.0, -1235.1, 1.1 ); - TEST_FP_OP3_S(10, fnmadd.s, 0, 12.0, 2.0, -5.0, -2.0 ); + TEST_FP_OP3_S( 8, fmsub.s, 0, 1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_S( 9, fmsub.s, 1, 1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_S(10, fmsub.s, 0, -8.0, 2.0, -5.0, -2.0 ); - TEST_FP_OP3_D(11, fnmadd.d, 0, -3.5, 1.0, 2.5, 1.0 ); - TEST_FP_OP3_D(12, fnmadd.d, 1, -1236.1999999999999, -1.0, -1235.1, 1.1 ); - TEST_FP_OP3_D(13, fnmadd.d, 0, 12.0, 2.0, -5.0, -2.0 ); - - TEST_FP_OP3_S(14, fmsub.s, 0, 1.5, 1.0, 2.5, 1.0 ); - TEST_FP_OP3_S(15, fmsub.s, 1, 1234, -1.0, -1235.1, 1.1 ); - TEST_FP_OP3_S(16, fmsub.s, 0, -8.0, 2.0, -5.0, -2.0 ); - - TEST_FP_OP3_D(17, fmsub.d, 0, 1.5, 1.0, 2.5, 1.0 ); - TEST_FP_OP3_D(18, fmsub.d, 1, 1234, -1.0, -1235.1, 1.1 ); - TEST_FP_OP3_D(19, fmsub.d, 0, -8.0, 2.0, -5.0, -2.0 ); - - TEST_FP_OP3_S(20, fnmsub.s, 0, -1.5, 1.0, 2.5, 1.0 ); - TEST_FP_OP3_S(21, fnmsub.s, 1, -1234, -1.0, -1235.1, 1.1 ); - TEST_FP_OP3_S(22, fnmsub.s, 0, 8.0, 2.0, -5.0, -2.0 ); - - TEST_FP_OP3_D(23, fnmsub.d, 0, -1.5, 1.0, 2.5, 1.0 ); - TEST_FP_OP3_D(24, fnmsub.d, 1, -1234, -1.0, -1235.1, 1.1 ); - TEST_FP_OP3_D(25, fnmsub.d, 0, 8.0, 2.0, -5.0, -2.0 ); + TEST_FP_OP3_S(11, fnmsub.s, 0, -1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_S(12, fnmsub.s, 1, -1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_S(13, fnmsub.s, 0, 8.0, 2.0, -5.0, -2.0 ); TEST_PASSFAIL diff --git a/isa/rv64uf/fmin.S b/isa/rv64uf/fmin.S index 56a6e7b..a2650e5 100644 --- a/isa/rv64uf/fmin.S +++ b/isa/rv64uf/fmin.S @@ -4,7 +4,7 @@ # fmin.S #----------------------------------------------------------------------------- # -# Test f{min|max}.{s|d} instructinos. +# Test f{min|max}.s instructinos. # #include "riscv_test.h" @@ -31,20 +31,6 @@ RVTEST_CODE_BEGIN TEST_FP_OP2_S(16, fmax.s, 0, 3.14159265, 3.14159265, 0.00000001 ); TEST_FP_OP2_S(17, fmax.s, 0, -1.0, -1.0, -2.0 ); - TEST_FP_OP2_D(22, fmin.d, 0, 1.0, 2.5, 1.0 ); - TEST_FP_OP2_D(23, fmin.d, 0, -1235.1, -1235.1, 1.1 ); - TEST_FP_OP2_D(24, fmin.d, 0, -1235.1, 1.1, -1235.1 ); - TEST_FP_OP2_D(25, fmin.d, 0, -1235.1, NaN, -1235.1 ); - TEST_FP_OP2_D(26, fmin.d, 0, 0.00000001, 3.14159265, 0.00000001 ); - TEST_FP_OP2_D(27, fmin.d, 0, -2.0, -1.0, -2.0 ); - - TEST_FP_OP2_D(32, fmax.d, 0, 2.5, 2.5, 1.0 ); - TEST_FP_OP2_D(33, fmax.d, 0, 1.1, -1235.1, 1.1 ); - TEST_FP_OP2_D(34, fmax.d, 0, 1.1, 1.1, -1235.1 ); - TEST_FP_OP2_D(35, fmax.d, 0, -1235.1, NaN, -1235.1 ); - TEST_FP_OP2_D(36, fmax.d, 0, 3.14159265, 3.14159265, 0.00000001 ); - TEST_FP_OP2_D(37, fmax.d, 0, -1.0, -1.0, -2.0 ); - TEST_PASSFAIL RVTEST_CODE_END diff --git a/isa/rv64uf/fsgnj.S b/isa/rv64uf/fsgnj.S index 68d5ee6..6d4bdb4 100644 --- a/isa/rv64uf/fsgnj.S +++ b/isa/rv64uf/fsgnj.S @@ -4,7 +4,7 @@ # fsgnj.S #----------------------------------------------------------------------------- # -# Test fsgn{j|jn|x}.{s|d} instructions. +# Test fsgn{j|jn|x}.s instructions. # #include "riscv_test.h" @@ -32,21 +32,6 @@ RVTEST_CODE_BEGIN TEST_FP_OP2_S(24, fsgnjx.s, 0, 8.3, -8.3, -3.0 ); TEST_FP_OP2_S(25, fsgnjx.s, 0, -9.3, -9.3, 4.0 ); - TEST_FP_OP2_D(32, fsgnj.d, 0, -6.3, 6.3, -1.0 ); - TEST_FP_OP2_D(33, fsgnj.d, 0, 7.3, 7.3, 2.0 ); - TEST_FP_OP2_D(34, fsgnj.d, 0, -8.3, -8.3, -3.0 ); - TEST_FP_OP2_D(35, fsgnj.d, 0, 9.3, -9.3, 4.0 ); - - TEST_FP_OP2_D(42, fsgnjn.d, 0, 6.3, 6.3, -1.0 ); - TEST_FP_OP2_D(43, fsgnjn.d, 0, -7.3, 7.3, 2.0 ); - TEST_FP_OP2_D(44, fsgnjn.d, 0, 8.3, -8.3, -3.0 ); - TEST_FP_OP2_D(45, fsgnjn.d, 0, -9.3, -9.3, 4.0 ); - - TEST_FP_OP2_D(52, fsgnjx.d, 0, -6.3, 6.3, -1.0 ); - TEST_FP_OP2_D(53, fsgnjx.d, 0, 7.3, 7.3, 2.0 ); - TEST_FP_OP2_D(54, fsgnjx.d, 0, 8.3, -8.3, -3.0 ); - TEST_FP_OP2_D(55, fsgnjx.d, 0, -9.3, -9.3, 4.0 ); - TEST_PASSFAIL RVTEST_CODE_END diff --git a/isa/rv64uf/ldst.S b/isa/rv64uf/ldst.S index 63123f2..c35dd8d 100644 --- a/isa/rv64uf/ldst.S +++ b/isa/rv64uf/ldst.S @@ -15,8 +15,6 @@ RVTEST_CODE_BEGIN TEST_CASE(2, a0, 0x40000000deadbeef, la a1, tdat; flw f1, 4(a1); fsw f1, 20(a1); ld a0, 16(a1)) TEST_CASE(3, a0, 0x1337d00dbf800000, la a1, tdat; flw f1, 0(a1); fsw f1, 24(a1); ld a0, 24(a1)) - TEST_CASE(4, a0, 0x40000000bf800000, la a1, tdat; fld f2, 0(a1); fsd f2, 16(a1); ld a0, 16(a1)) - TEST_CASE(5, a0, 0xc080000040400000, la a1, tdat; fld f2, 8(a1); fsd f2, 16(a1); ld a0, 16(a1)) TEST_PASSFAIL diff --git a/isa/rv64uf/move.S b/isa/rv64uf/move.S index 53b8cf3..a94af55 100644 --- a/isa/rv64uf/move.S +++ b/isa/rv64uf/move.S @@ -5,7 +5,7 @@ #----------------------------------------------------------------------------- # # This test verifies that mxtf.[s,d], mftx.[s,d], fssr, frsr, -# and fsgnj[x|n].[s|d] work properly. +# and fsgnj[x|n].s work properly. # #include "riscv_test.h" @@ -22,12 +22,10 @@ fssr a0 TEST_CASE(4, a0, 0x34, frsr a0) 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; 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_CASE(6, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; fmv.s.x f0, a1; fsgnj.s f1, f0, f0; fmv.x.s a0, f1) + TEST_CASE(7, a0, 0x000000004BA98765, li a1, 0xFFFFFFFFCBA98765; fmv.s.x f0, a1; fsgnjx.s f1, f0, f0; fmv.x.s a0, f1) + TEST_CASE(8, a0, 0x000000005EADBEEF, li a1, 0xFFFFFFFFDEADBEEF; fmv.s.x f0, a1; fsgnjn.s f1, f0, f0; fmv.x.s a0, f1) TEST_PASSFAIL diff --git a/isa/rv64uf/recoding.S b/isa/rv64uf/recoding.S index 2ab17e2..802be66 100644 --- a/isa/rv64uf/recoding.S +++ b/isa/rv64uf/recoding.S @@ -25,31 +25,13 @@ RVTEST_CODE_BEGIN TEST_CASE( 4, a0, 0, flt.s a0, f0, f1) # Likewise, but for zeroes. - fcvt.d.w f0, x0 + fcvt.s.w f0, x0 li a0, 1 - fcvt.d.w f1, a0 - fmul.d f1, f1, f0 - TEST_CASE(5, a0, 1, feq.d a0, f0, f1) - TEST_CASE(6, a0, 1, fle.d a0, f0, f1) - TEST_CASE(7, a0, 0, flt.d a0, f0, f1) - - # When converting small doubles to single-precision subnormals, - # ensure that the extra precision is discarded. - flw f0, big, a0 - fld f1, tiny, a0 - fcvt.s.d f1, f1 - fmul.s f0, f0, f1 - fmv.x.s a0, f0 - lw a1, small - TEST_CASE(10, a0, 0, sub a0, a0, a1) - - # Make sure FSD+FLD correctly saves and restores a single-precision value. - flw f0, three, a0 - fadd.s f1, f0, f0 - fadd.s f0, f0, f0 - fsd f0, tiny, a0 - fld f0, tiny, a0 - TEST_CASE(20, a0, 1, feq.s a0, f0, f1) + fcvt.s.w f1, a0 + fmul.s f1, f1, f0 + TEST_CASE(5, a0, 1, feq.s a0, f0, f1) + TEST_CASE(6, a0, 1, fle.s a0, f0, f1) + TEST_CASE(7, a0, 0, flt.s a0, f0, f1) TEST_PASSFAIL @@ -60,8 +42,5 @@ RVTEST_DATA_BEGIN minf: .float -Inf three: .float 3.0 -big: .float 1221 -small: .float 2.9133121e-37 -tiny: .double 2.3860049081905093e-40 RVTEST_DATA_END diff --git a/isa/rv64ui/Makefrag b/isa/rv64ui/Makefrag index 4af2504..7920b99 100644 --- a/isa/rv64ui/Makefrag +++ b/isa/rv64ui/Makefrag @@ -4,21 +4,15 @@ rv64ui_sc_tests = \ add addi addiw addw \ - amoadd_d amoand_d amomax_d amomaxu_d amomin_d amominu_d amoor_d amoxor_d amoswap_d \ - amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoxor_w amoswap_w \ - lrsc \ and andi \ auipc \ beq bge bgeu blt bltu bne \ - div divu divuw divw \ example simple \ fence_i \ j jal jalr \ lb lbu lh lhu lw lwu ld \ lui \ - mul mulh mulhsu mulhu mulw \ or ori \ - rem remu remuw remw \ sb sh sw sd \ sll slli slliw sllw \ slt slti sltiu sltu \ diff --git a/isa/rv64um/Makefrag b/isa/rv64um/Makefrag new file mode 100644 index 0000000..360bd7a --- /dev/null +++ b/isa/rv64um/Makefrag @@ -0,0 +1,13 @@ +#======================================================================= +# Makefrag for rv64um tests +#----------------------------------------------------------------------- + +rv64um_sc_tests = \ + div divu divuw divw \ + mul mulh mulhsu mulhu mulw \ + rem remu remuw remw \ + +rv64um_p_tests = $(addprefix rv64um-p-, $(rv64um_sc_tests)) +rv64um_v_tests = $(addprefix rv64um-v-, $(rv64um_sc_tests)) + +spike_tests += $(rv64um_p_tests) $(rv64um_v_tests) diff --git a/isa/rv64ui/div.S b/isa/rv64um/div.S index ee21f0c..ee21f0c 100644 --- a/isa/rv64ui/div.S +++ b/isa/rv64um/div.S diff --git a/isa/rv64ui/divu.S b/isa/rv64um/divu.S index e63fd65..e63fd65 100644 --- a/isa/rv64ui/divu.S +++ b/isa/rv64um/divu.S diff --git a/isa/rv64ui/divuw.S b/isa/rv64um/divuw.S index 4c9eee7..4c9eee7 100644 --- a/isa/rv64ui/divuw.S +++ b/isa/rv64um/divuw.S diff --git a/isa/rv64ui/divw.S b/isa/rv64um/divw.S index 4cffa1a..4cffa1a 100644 --- a/isa/rv64ui/divw.S +++ b/isa/rv64um/divw.S diff --git a/isa/rv64ui/mul.S b/isa/rv64um/mul.S index c647e97..c647e97 100644 --- a/isa/rv64ui/mul.S +++ b/isa/rv64um/mul.S diff --git a/isa/rv64ui/mulh.S b/isa/rv64um/mulh.S index 1fd12a1..1fd12a1 100644 --- a/isa/rv64ui/mulh.S +++ b/isa/rv64um/mulh.S diff --git a/isa/rv64ui/mulhsu.S b/isa/rv64um/mulhsu.S index c037db2..c037db2 100644 --- a/isa/rv64ui/mulhsu.S +++ b/isa/rv64um/mulhsu.S diff --git a/isa/rv64ui/mulhu.S b/isa/rv64um/mulhu.S index aa7b762..aa7b762 100644 --- a/isa/rv64ui/mulhu.S +++ b/isa/rv64um/mulhu.S diff --git a/isa/rv64ui/mulw.S b/isa/rv64um/mulw.S index 379c3f2..379c3f2 100644 --- a/isa/rv64ui/mulw.S +++ b/isa/rv64um/mulw.S diff --git a/isa/rv64ui/rem.S b/isa/rv64um/rem.S index e3248ff..e3248ff 100644 --- a/isa/rv64ui/rem.S +++ b/isa/rv64um/rem.S diff --git a/isa/rv64ui/remu.S b/isa/rv64um/remu.S index 6946d0d..6946d0d 100644 --- a/isa/rv64ui/remu.S +++ b/isa/rv64um/remu.S diff --git a/isa/rv64ui/remuw.S b/isa/rv64um/remuw.S index 334b5c5..334b5c5 100644 --- a/isa/rv64ui/remuw.S +++ b/isa/rv64um/remuw.S diff --git a/isa/rv64ui/remw.S b/isa/rv64um/remw.S index 3ae8e3d..3ae8e3d 100644 --- a/isa/rv64ui/remw.S +++ b/isa/rv64um/remw.S |