Skip to content

Commit 6b23d29

Browse files
committed
vector ISA updates
1 parent 5d91fe5 commit 6b23d29

File tree

13 files changed

+874
-875
lines changed

13 files changed

+874
-875
lines changed

ci/regression.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ vector()
394394
{
395395
echo "begin vector tests..."
396396

397-
make -C sim/simx
397+
make -C sim/simx clean && CONFIGS="-DEXT_V_ENABLE" make -C sim/simx
398398
TOOLDIR=@TOOLDIR@ XLEN=@XLEN@ VLEN=256 REG_TESTS=1 ./tests/riscv/riscv-vector-tests/run-test.sh
399399

400400
echo "vector tests done!"

hw/rtl/VX_config.vh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,12 @@
830830
`define EXT_M_ENABLED 0
831831
`endif
832832

833+
`ifdef EXT_V_ENABLE
834+
`define EXT_V_ENABLED 1
835+
`else
836+
`define EXT_V_ENABLED 0
837+
`endif
838+
833839
`ifdef EXT_ZICOND_ENABLE
834840
`define EXT_ZICOND_ENABLED 1
835841
`else
@@ -846,7 +852,7 @@
846852
`define ISA_STD_N 13
847853
`define ISA_STD_Q 16
848854
`define ISA_STD_S 18
849-
`define ISA_STD_U 20
855+
`define ISA_STD_V 21
850856

851857
`define ISA_EXT_ICACHE 0
852858
`define ISA_EXT_DCACHE 1
@@ -883,7 +889,7 @@
883889
| (0 << 18) /* S - Supervisor mode implemented */ \
884890
| (0 << 19) /* T - Tentatively reserved for Transactional Memory extension */ \
885891
| (1 << 20) /* U - User mode implemented */ \
886-
| (0 << 21) /* V - Tentatively reserved for Vector extension */ \
892+
| (`EXT_V_ENABLED << 21) /* V - Tentatively reserved for Vector extension */ \
887893
| (0 << 22) /* W - Reserved */ \
888894
| (1 << 23) /* X - Non-standard extensions present */ \
889895
| (0 << 24) /* Y - Reserved */ \

sim/common/rvfloats.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// Copyright © 2019-2023
2-
//
2+
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
// http://www.apache.org/licenses/LICENSE-2.0
7-
//
7+
//
88
// Unless required by applicable law or agreed to in writing, software
99
// distributed under the License is distributed on an "AS IS" BASIS,
1010
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
// See the License for the specific language governing permissions and
1212
// limitations under the License.
1313

1414
#include "rvfloats.h"
15-
#include "softfloat_ext.h"
1615
#include <stdio.h>
1716

1817
extern "C" {
1918
#include <softfloat.h>
19+
#include "softfloat_ext.h"
2020
#include <internals.h>
2121
#include <../RISCV/specialize.h>
2222
}
@@ -344,7 +344,7 @@ bool rv_fle_d(uint64_t a, uint64_t b, uint32_t* fflags) {
344344
bool rv_feq_s(uint32_t a, uint32_t b, uint32_t* fflags) {
345345
rv_init(0);
346346
auto r = f32_eq(to_float32_t(a), to_float32_t(b));
347-
if (fflags) { *fflags = softfloat_exceptionFlags; }
347+
if (fflags) { *fflags = softfloat_exceptionFlags; }
348348
return r;
349349
}
350350

@@ -355,11 +355,11 @@ bool rv_feq_d(uint64_t a, uint64_t b, uint32_t* fflags) {
355355
return r;
356356
}
357357

358-
uint32_t rv_fmin_s(uint32_t a, uint32_t b, uint32_t* fflags) {
358+
uint32_t rv_fmin_s(uint32_t a, uint32_t b, uint32_t* fflags) {
359359
uint32_t r;
360360
rv_init(0);
361361
if (isNaNF32UI(a) && isNaNF32UI(b)) {
362-
r = defaultNaNF32UI;
362+
r = defaultNaNF32UI;
363363
} else {
364364
auto fa = to_float32_t(a);
365365
auto fb = to_float32_t(b);
@@ -374,11 +374,11 @@ uint32_t rv_fmin_s(uint32_t a, uint32_t b, uint32_t* fflags) {
374374
return r;
375375
}
376376

377-
uint64_t rv_fmin_d(uint64_t a, uint64_t b, uint32_t* fflags) {
377+
uint64_t rv_fmin_d(uint64_t a, uint64_t b, uint32_t* fflags) {
378378
uint64_t r;
379379
rv_init(0);
380380
if (isNaNF64UI(a) && isNaNF64UI(b)) {
381-
r = defaultNaNF64UI;
381+
r = defaultNaNF64UI;
382382
} else {
383383
auto fa = to_float64_t(a);
384384
auto fb = to_float64_t(b);
@@ -397,7 +397,7 @@ uint32_t rv_fmax_s(uint32_t a, uint32_t b, uint32_t* fflags) {
397397
uint32_t r;
398398
rv_init(0);
399399
if (isNaNF32UI(a) && isNaNF32UI(b)) {
400-
r = defaultNaNF32UI;
400+
r = defaultNaNF32UI;
401401
} else {
402402
auto fa = to_float32_t(a);
403403
auto fb = to_float32_t(b);
@@ -416,7 +416,7 @@ uint64_t rv_fmax_d(uint64_t a, uint64_t b, uint32_t* fflags) {
416416
uint64_t r;
417417
rv_init(0);
418418
if (isNaNF64UI(a) && isNaNF64UI(b)) {
419-
r = defaultNaNF64UI;
419+
r = defaultNaNF64UI;
420420
} else {
421421
auto fa = to_float64_t(a);
422422
auto fb = to_float64_t(b);
@@ -449,8 +449,8 @@ uint32_t rv_fclss_s(uint32_t a) {
449449
( !sign && subnormOrZero && !fracZero ) << 5 |
450450
( !sign && subnormOrZero && fracZero ) << 4 |
451451
( isNaN && isSNaN ) << 8 |
452-
( isNaN && !isSNaN ) << 9;
453-
452+
( isNaN && !isSNaN ) << 9;
453+
454454
return r;
455455
}
456456

@@ -472,8 +472,8 @@ uint32_t rv_fclss_d(uint64_t a) {
472472
( !sign && subnormOrZero && !fracZero ) << 5 |
473473
( !sign && subnormOrZero && fracZero ) << 4 |
474474
( isNaN && isSNaN ) << 8 |
475-
( isNaN && !isSNaN ) << 9;
476-
475+
( isNaN && !isSNaN ) << 9;
476+
477477
return r;
478478
}
479479

@@ -483,7 +483,7 @@ uint32_t rv_fsgnj_s(uint32_t a, uint32_t b) {
483483
return r;
484484
}
485485

486-
uint64_t rv_fsgnj_d(uint64_t a, uint64_t b) {
486+
uint64_t rv_fsgnj_d(uint64_t a, uint64_t b) {
487487
auto sign = b & F64_SIGN;
488488
auto r = sign | (a & ~F64_SIGN);
489489
return r;
@@ -495,7 +495,7 @@ uint32_t rv_fsgnjn_s(uint32_t a, uint32_t b) {
495495
return r;
496496
}
497497

498-
uint64_t rv_fsgnjn_d(uint64_t a, uint64_t b) {
498+
uint64_t rv_fsgnjn_d(uint64_t a, uint64_t b) {
499499
auto sign = ~b & F64_SIGN;
500500
auto r = sign | (a & ~F64_SIGN);
501501
return r;
@@ -508,7 +508,7 @@ uint32_t rv_fsgnjx_s(uint32_t a, uint32_t b) {
508508
return r;
509509
}
510510

511-
uint64_t rv_fsgnjx_d(uint64_t a, uint64_t b) {
511+
uint64_t rv_fsgnjx_d(uint64_t a, uint64_t b) {
512512
auto sign1 = a & F64_SIGN;
513513
auto sign2 = b & F64_SIGN;
514514
auto r = (sign1 ^ sign2) | (a & ~F64_SIGN);

0 commit comments

Comments
 (0)