Skip to content

Commit

Permalink
zicond tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Nov 21, 2024
1 parent 53148c7 commit 474662a
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion src/hotspot/cpu/riscv/interp_masm_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,63 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index,
ShouldNotReachHere();
}
}
#define TESTME(COP,CMP1,CMP2,DST,SRC,RESULT) \
Label fail##COP##RESULT, start##COP##RESULT; \
j(start##COP##RESULT); \
bind(fail##COP##RESULT); \
stop("HERE" #COP #RESULT); \
bind(start##COP##RESULT); \
li(t0, CMP1); \
li(t1, CMP2); \
li(result, DST); \
li(tmp, SRC); \
COP(t0, t1, result, tmp); \
li(tmp, RESULT); \
bne(result, tmp, fail##COP##RESULT);


// Load object from cpool->resolved_references(index)
void InterpreterMacroAssembler::load_resolved_reference_at_index(
Register result, Register index, Register tmp) {
assert_different_registers(result, index);
assert_different_registers(result, index, t0, t1);
// MY TEST
TESTME(cmov_eq, 66, 67, 0, 88, 0);
TESTME(cmov_eq, 66, 66, 0, 88, 88);

TESTME(cmov_ne, 66, 67, 0, 88, 88);
TESTME(cmov_ne, 66, 66, 0, 88, 0);

TESTME(cmov_le, 66, 67, 0, 88, 88);
TESTME(cmov_le, 66, 66, 0, 99, 99);
TESTME(cmov_le, 66, -1, 0, 88, 0);

TESTME(cmov_leu, 66, -1, 0, 88, 88);
TESTME(cmov_leu, 66, 66, 0, 99, 99);
TESTME(cmov_leu, 66, 65, 0, 88, 0);

TESTME(cmov_ge, 67, -1, 0, 88, 88);
TESTME(cmov_ge, 66, 66, 0, 99, 99);
TESTME(cmov_ge, 65, 66, 0, 88, 0);

TESTME(cmov_geu, -1, 66, 0, 88, 88);
TESTME(cmov_geu, 66, 66, 0, 99, 99);
TESTME(cmov_geu, 65, 66, 0, 88, 0);

TESTME(cmov_lt, 66, 67, 0, 88, 88);
TESTME(cmov_lt, 66, 66, 1, 99, 1);
TESTME(cmov_lt, 66, -1, 0, 88, 0);

TESTME(cmov_ltu, 66, -1, 0, 88, 88);
TESTME(cmov_ltu, 66, 66, 1, 99, 1);
TESTME(cmov_ltu, 66, 65, 0, 88, 0);

TESTME(cmov_gt, 67, -1, 0, 88, 88);
TESTME(cmov_gt, 66, 66, 1, 99, 1);
TESTME(cmov_gt, 65, 66, 0, 88, 0);

TESTME(cmov_gtu, -1, 66, 0, 88, 88);
TESTME(cmov_gtu, 66, 66, 1, 99, 1);
TESTME(cmov_gtu, 65, 66, 0, 88, 0);

get_constant_pool(result);
// Load pointer for resolved_references[] objArray
Expand Down

0 comments on commit 474662a

Please sign in to comment.