Skip to content

Commit

Permalink
Merge pull request #252 from beehive-lab/fix/riscv-executors
Browse files Browse the repository at this point in the history
Fixed the executors on RISCV and ran dacapo and specjvm
  • Loading branch information
zakkak committed Sep 30, 2019
2 parents 24c9f17 + 98c4dcc commit b15f7bf
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ public void pop(int size, boolean unsigned, CiRegister... registers) {
}


public void membar(int barriers) {
public void membar() {
fence(0b1111, 0b1111);
fencei();
}
Expand All @@ -752,30 +752,18 @@ public void membar(int barriers) {
* @param address
*/
public void cas(int size, CiRegister newValue, CiRegister compareValue, RISCV64Address address) {
//TODO At the moment we don't know how to implement memory barriers in RISC-V.
// This implementation must be changed to be atmoic and use a memory barrier.
// See Aarch64MacroAssembler.cas() for example of implementation

assert scratchRegister != compareValue;
assert newValue != compareValue;
assert size <= 64;

CiRegister cmpVal;
if (size < 64) {
slli(scratchRegister1, compareValue, 64 - size);
srli(scratchRegister1, scratchRegister1, 64 - size);
cmpVal = scratchRegister1;
} else {
cmpVal = compareValue;
}

membar();
Label notEqualTocmpValue = new Label();
ldru(size, scratchRegister, address);
branchConditionally(ConditionFlag.NE, cmpVal, scratchRegister, notEqualTocmpValue);
ldr(size, scratchRegister, address);
branchConditionally(ConditionFlag.NE, compareValue, scratchRegister, notEqualTocmpValue);
str(size, newValue, address);
mov(scratchRegister, cmpVal); // set scratch register to the cmp value to indicate success

mov(scratchRegister, compareValue); // set scratch register to the cmp value to indicate success
bind(notEqualTocmpValue);
membar();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ protected void emitVolatileMove(CiValue src, CiValue dest, CiKind kind, LIRDebug

@Override
protected void emitMemoryBarriers(int barriers) {
masm.membar(barriers);
masm.membar();
}

@Override
Expand Down Expand Up @@ -1932,13 +1932,7 @@ private void emitXirCompare(XirInstruction inst, Condition condition, CiValue[]
CiValue x = ops[inst.x().index];
CiValue y = ops[inst.y().index];
emitCompare(condition, x, y, null);
Label skip = new Label();
// Check if NV flag in fflags is set to 1. If it is, then one of the operands from emitCompare was NaN.
masm.csrrci(scratchRegister, 0x001, 0b10000); // Read and clear NV flag
masm.andi(scratchRegister, scratchRegister, 0b10000);
masm.branchConditionally(RISCV64MacroAssembler.ConditionFlag.NE, scratchRegister, RISCV64.zero, skip);
masm.branchConditionally(cflag, RISCV64.x31, RISCV64.zero, label);
masm.bind(skip);
masm.nop(3);
}

Expand Down
249 changes: 127 additions & 122 deletions docs/Status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Maxine is being developed and tested on the following configurations:
+----------------+----------------------+--------------------------+--------------------+
| Aarch64 | Ubuntu 18.04 | OpenJDK 8 (u222) | 2.9.0 |
+----------------+----------------------+--------------------------+--------------------+
| RISC-V64 | Fedora 31 (on QEMU) | OpenJDK 8 (u222) | 2.9.0 |
+----------------+----------------------+--------------------------+--------------------+
| ARMv7 | Ubuntu 16.04 | OpenJDK 7 u151 | 2.4.0 |
+----------------+----------------------+--------------------------+--------------------+

Expand Down Expand Up @@ -83,132 +85,135 @@ The following tables show the status of each benchmark on each supported platfor
SpecJVM2008
~~~~~~~~~~~

+-----------------------------+---------+---------+---------+
| Benchmark | X86 | AArch64 | ARMv7 |
+=============================+=========+=========+=========+
| startup.helloworld | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.compiler.compiler | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.compiler.sunflow | NA | NA | NA |
+-----------------------------+---------+---------+---------+
| startup.compress | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.crypto.aes | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.crypto.rsa | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.crypto.signverify | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.mpegaudio | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.scimark.fft | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.scimark.lu | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.scimark.monte_carlo | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.scimark.sor | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.scimark.sparse | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.serial | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.sunflow | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.xml.transform | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| startup.xml.validation | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.fft.large | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.lu.large | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.sor.large | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.sparse.large | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.fft.small | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.lu.small | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.sor.small | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.sparse.small | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| scimark.monte_carlo | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| compiler.compiler | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| compiler.sunflow | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| compress | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| crypto.aes | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| crypto.rsa | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| crypto.signverify | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| derby | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| mpegaudio | PASS | FAIL | |
+-----------------------------+---------+---------+---------+
| serial | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| sunflow | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| xml.transform | PASS | FAIL | |
+-----------------------------+---------+---------+---------+
| xml.validation | PASS | PASS | |
+-----------------------------+---------+---------+---------+
| pass-rate | 100% | 94% | |
+-----------------------------+---------+---------+---------+

.. note::
startup.compiler.sunflow runs infinitely both on Maxine and on HotSpot, thus it's not included in the pass-rate calculation
+-----------------------------+---------+---------+---------+---------+
| Benchmark | X86 | AArch64 | ARMv7 | RISC-V64|
+=============================+=========+=========+=========+=========+
| startup.helloworld | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.compiler.compiler | PASS | PASS | | FAIL |
+-----------------------------+---------+---------+---------+---------+
| startup.compiler.sunflow | NA | NA | NA | FAIL |
+-----------------------------+---------+---------+---------+---------+
| startup.compress | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.crypto.aes | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.crypto.rsa | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.crypto.signverify | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.mpegaudio | PASS | PASS | | FAIL |
+-----------------------------+---------+---------+---------+---------+
| startup.scimark.fft | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.scimark.lu | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.scimark.monte_carlo | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.scimark.sor | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.scimark.sparse | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.serial | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.sunflow | PASS | PASS | | FAIL |
+-----------------------------+---------+---------+---------+---------+
| startup.xml.transform | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| startup.xml.validation | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.fft.large | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.lu.large | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.sor.large | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.sparse.large | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.fft.small | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.lu.small | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.sor.small | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.sparse.small | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| scimark.monte_carlo | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| compiler.compiler | PASS | PASS | | FAIL |
+-----------------------------+---------+---------+---------+---------+
| compiler.sunflow | PASS | PASS | | FAIL |
+-----------------------------+---------+---------+---------+---------+
| compress | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| crypto.aes | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| crypto.rsa | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| crypto.signverify | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| derby | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| mpegaudio | PASS | FAIL | | FAIL |
+-----------------------------+---------+---------+---------+---------+
| serial | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| sunflow | PASS | PASS | | FAIL |
+-----------------------------+---------+---------+---------+---------+
| xml.transform | PASS | FAIL | | PASS |
+-----------------------------+---------+---------+---------+---------+
| xml.validation | PASS | PASS | | PASS |
+-----------------------------+---------+---------+---------+---------+
| pass-rate | 100% | 94% | | 79% |
+-----------------------------+---------+---------+---------+---------+

.. notes::
- startup.compiler.sunflow runs infinitely both on Maxine and on HotSpot, thus it's not included in the pass-rate calculation
- on RISC-V64, startup.compiler.sunflow fails before running infinitely (therefore, we include it in the pass rate).

DaCapo-9.12-bach-MR1
~~~~~~~~~~~~~~~~~~~~

+--------------+-----------+---------+---------+
| Benchmark | X86 | AArch64 | ARMv7 |
+==============+===========+=========+=========+
| avrora | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| batik | NA | NA | NA |
+--------------+-----------+---------+---------+
| eclipse | PASS | FAIL | FAIL |
+--------------+-----------+---------+---------+
| fop | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| h2 | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| jython | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| luindex | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| lusearch | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| lusearch-fix | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| pmd | PASS | PASS | FAIL |
+--------------+-----------+---------+---------+
| sunflow | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| tomcat | PASS | PASS | FAIL |
+--------------+-----------+---------+---------+
| tradebeans | PASS | FAIL | FAIL |
+--------------+-----------+---------+---------+
| tradesoap | PASS | FAIL | FAIL |
+--------------+-----------+---------+---------+
| xalan | PASS | PASS | PASS |
+--------------+-----------+---------+---------+
| pass-rate | 100% | 78% | 62% |
+--------------+-----------+---------+---------+

.. note::
batik fails due to a library that is not available on openJDK, it is thus omitted from the pass-rate.
+--------------+-----------+---------+---------+---------+
| Benchmark | X86 | AArch64 | ARMv7 | RISC-V64|
+==============+===========+=========+=========+=========+
| avrora | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| batik | NA | NA | NA | FAIL |
+--------------+-----------+---------+---------+---------+
| eclipse | PASS | FAIL | FAIL | FAIL |
+--------------+-----------+---------+---------+---------+
| fop | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| h2 | PASS | PASS | PASS | FAIL |
+--------------+-----------+---------+---------+---------+
| jython | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| luindex | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| lusearch | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| lusearch-fix | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| pmd | PASS | PASS | FAIL | PASS |
+--------------+-----------+---------+---------+---------+
| sunflow | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| tomcat | PASS | PASS | FAIL | FAIL |
+--------------+-----------+---------+---------+---------+
| tradebeans | PASS | FAIL | FAIL | FAIL |
+--------------+-----------+---------+---------+---------+
| tradesoap | PASS | FAIL | FAIL | FAIL |
+--------------+-----------+---------+---------+---------+
| xalan | PASS | PASS | PASS | PASS |
+--------------+-----------+---------+---------+---------+
| pass-rate | 100% | 78% | 62% | 60% |
+--------------+-----------+---------+---------+---------+

.. notes::
- batik fails due to a library that is not available on openJDK, it is thus omitted from the pass-rate.
- on RISC-V64, batik fails before trying to load the missing library from openJDK (therefore, we include it in the pass rate).


Issues
------
Expand Down

0 comments on commit b15f7bf

Please sign in to comment.