Skip to content

Commit

Permalink
Fix !isExactDouble() specializations
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Nov 5, 2024
1 parent 16e6186 commit 26d378d
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected static final boolean doLongDouble(final long lhs, final double rhs) {
return BooleanObject.wrap(lhs > rhs);
}

@Specialization(guards = "isExactDouble(lhs)")
@Specialization(guards = "!isExactDouble(lhs)")
protected static final boolean doLongDoubleNotExact(final long lhs, final double rhs) {
return BooleanObject.wrap(compareNotExact(lhs, rhs) > 0);
}
Expand All @@ -175,7 +175,7 @@ protected static final boolean doLongDouble(final long lhs, final double rhs) {
return BooleanObject.wrap(lhs <= rhs);
}

@Specialization(guards = "isExactDouble(lhs)")
@Specialization(guards = "!isExactDouble(lhs)")
protected static final boolean doLongDoubleNotExact(final long lhs, final double rhs) {
return BooleanObject.wrap(compareNotExact(lhs, rhs) <= 0);
}
Expand All @@ -199,7 +199,7 @@ protected static final boolean doLongDouble(final long lhs, final double rhs) {
return BooleanObject.wrap(lhs >= rhs);
}

@Specialization(guards = "isExactDouble(lhs)")
@Specialization(guards = "!isExactDouble(lhs)")
protected static final boolean doLongDoubleNotExact(final long lhs, final double rhs) {
return BooleanObject.wrap(compareNotExact(lhs, rhs) >= 0);
}
Expand Down Expand Up @@ -868,7 +868,7 @@ protected static final boolean doDoubleLong(final FloatObject lhs, final long rh
return BooleanObject.wrap(lhs.getValue() < rhs);
}

@Specialization(guards = "isExactDouble(rhs)")
@Specialization(guards = "!isExactDouble(rhs)")
protected static final boolean doDoubleLongNotExact(final FloatObject lhs, final long rhs) {
return BooleanObject.wrap(compareNotExact(lhs.getValue(), rhs) < 0);
}
Expand All @@ -892,7 +892,7 @@ protected static final boolean doDoubleLong(final FloatObject lhs, final long rh
return BooleanObject.wrap(lhs.getValue() > rhs);
}

@Specialization(guards = "isExactDouble(rhs)")
@Specialization(guards = "!isExactDouble(rhs)")
protected static final boolean doDoubleLongNotExact(final FloatObject lhs, final long rhs) {
return BooleanObject.wrap(compareNotExact(lhs.getValue(), rhs) > 0);
}
Expand All @@ -916,7 +916,7 @@ protected static final boolean doDoubleLong(final FloatObject lhs, final long rh
return BooleanObject.wrap(lhs.getValue() <= rhs);
}

@Specialization(guards = "isExactDouble(rhs)")
@Specialization(guards = "!isExactDouble(rhs)")
protected static final boolean doDoubleLongNotExact(final FloatObject lhs, final long rhs) {
return BooleanObject.wrap(compareNotExact(lhs.getValue(), rhs) <= 0);
}
Expand All @@ -940,7 +940,7 @@ protected static final boolean doDoubleLong(final FloatObject lhs, final long rh
return BooleanObject.wrap(lhs.getValue() >= rhs);
}

@Specialization(guards = "isExactDouble(rhs)")
@Specialization(guards = "!isExactDouble(rhs)")
protected static final boolean doDoubleLongNotExact(final FloatObject lhs, final long rhs) {
return BooleanObject.wrap(compareNotExact(lhs.getValue(), rhs) >= 0);
}
Expand Down

1 comment on commit 26d378d

@TruffleSqueak-Bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance Report (26d378d)

Benchmarks ran on 23.0.1-graal.

Steady (after 100 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 521 578 525.64 522 525.59 105127 1.75
CD 477 498 482.7 478 482.64 96539 1.61
DeltaBlue 300 433 401.26 403 400.83 80251 1.34
Havlak 1093 1151 1123.61 1123 1123.55 224721 3.75
Json 340 355 343.25 340 343.21 68649 1.14
List 309 336 311.43 310 311.38 62285 1.04
Mandelbrot 129 158 130.81 130 130.75 26161 0.44
NBody 243 270 247.68 245 247.62 49536 0.83
Permute 155 176 156.41 156 156.38 31281 0.52
Queens 216 248 219.22 218 219.16 43844 0.73
Richards 1261 1284 1267.09 1263.5 1267.08 253418 4.22
Sieve 177 208 178.23 177 178.19 35645 0.59
Storage 138 159 141.27 139 141.2 28254 0.47
Towers 177 200 179.64 178 179.57 35927 0.6
5536 6054 5708.19 5682.5 5707.16 1141638 19.03

26d378d-2-steady.svg

Warmup (first 100 iterations)

26d378d-3-warmup.svg

Please sign in to comment.