Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -500,4 +500,4 @@ address TemplateInterpreterGenerator::generate_currentThread() {
__ jmp(rcx);

return entry_point;
}
}
39 changes: 39 additions & 0 deletions test/micro/org/openjdk/bench/java/lang/CbrtPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,45 @@ public double cbrtConstDouble512() {
}
}

@Warmup(iterations = 3, time = 5, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 4, time = 5, timeUnit = TimeUnit.SECONDS)
@Fork(2)
@BenchmarkMode(Mode.Throughput)
@State(Scope.Thread)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public static class CbrtPerfSpecialValues {
public double double0 = 0.0;
public double doubleNegative0 = -0.0;
public double doubleInf = Double.POSITIVE_INFINITY;
public double doubleNegativeInf = Double.NEGATIVE_INFINITY;
public double doubleNaN = Double.NaN;

@Benchmark
public double cbrtDouble0() {
return Math.cbrt(double0);
}

@Benchmark
public double cbrtDoubleNegative0() {
return Math.cbrt(doubleNegative0);
}

@Benchmark
public double cbrtDoubleInf() {
return Math.cbrt(doubleInf);
}

@Benchmark
public double cbrtDoubleNegativeInf() {
return Math.cbrt(doubleNegativeInf);
}

@Benchmark
public double cbrtDoubleNaN() {
return Math.cbrt(doubleNaN);
}
}

public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder()
.include(CbrtPerfRanges.class.getSimpleName())
Expand Down