Skip to content

Commit

Permalink
Patch for issue 240. Fixes #240
Browse files Browse the repository at this point in the history
  • Loading branch information
pawks committed Mar 17, 2022
1 parent 5932678 commit f8727cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## [2.6.4] - 2022-03-17
- Fix bug in auto-offset update for SIGUPD macros.

## [2.6.3] - 2022-03-04
- import and synchronize P-ext changes in arch_test.h from riscv-ctg
- automatically adjust base and offset if offset gets too big
Expand Down
24 changes: 12 additions & 12 deletions riscv-test-suite/env/arch_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,37 +578,37 @@
/* RVTEST_SIGUPD(basereg, sigreg) stores sigreg at offset(basereg) and updates offset by regwidth */
/* RVTEST_SIGUPD(basereg, sigreg,newoff) stores sigreg at newoff(basereg) and updates offset to regwidth+newoff */
#define RVTEST_SIGUPD(_BR,_R,...) \
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
.if offset+REGWIDTH>=2048 ;\
addi _BR, _BR, offset ;\
.set offset, 0 ;\
.endif ;\
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
SREG _R,offset(_BR) ;\
.set offset,offset+REGWIDTH

#define RVTEST_SIGUPD_F(_BR,_R,_F,...) \
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
.if offset+2*REGWIDTH>=2048 ;\
addi _BR, _BR,offset ;\
.set offset, 0 ;\
.endif ;\
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
FSREG _R,offset(_BR) ;\
SREG _F,offset+REGWIDTH(_BR) ;\
.set offset,offset+(2*REGWIDTH)


#define RVTEST_SIGUPD_FID(_BR,_R,_F,...) \
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
.if offset+2*REGWIDTH>=2048 ;\
addi _BR, _BR,offset ;\
.set offset, 0 ;\
.endif ;\
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
SREG _R,offset(_BR) ;\
SREG _F,offset+REGWIDTH(_BR) ;\
.set offset,offset+(2*REGWIDTH)
Expand All @@ -632,13 +632,13 @@

// for updating signatures that include flagreg when 'rd' is a paired register (64-bit) in Zpsfoperand extension in RV32.
#define RVTEST_SIGUPD_PK64(_BR,_R,_R_HI,_F,...)\
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
.if offset+3*REGWIDTH>=2048 ;\
addi _BR, _BR,offset ;\
.set offset, 0 ;\
.endif ;\
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
SREG _R,offset(_BR) ;\
SREG _R_HI,offset+REGWIDTH(_BR) ;\
RDOV(_F) ;\
Expand Down

0 comments on commit f8727cc

Please sign in to comment.