|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. |
| 2 | + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. |
3 | 3 | * Copyright (c) 2014, Regents of the University of California
|
4 | 4 | *
|
5 | 5 | * All rights reserved.
|
@@ -1118,6 +1118,11 @@ boolean doDL(double x, long y) {
|
1118 | 1118 | return x <= y;
|
1119 | 1119 | }
|
1120 | 1120 |
|
| 1121 | + @Specialization |
| 1122 | + boolean doPI(double x, PInt y) { |
| 1123 | + return x <= y.doubleValue(); |
| 1124 | + } |
| 1125 | + |
1121 | 1126 | @Specialization(guards = "fromNativeNode.isFloatSubtype(frame, y, getClass, isSubtype, context)", limit = "1")
|
1122 | 1127 | boolean doDN(VirtualFrame frame, double x, PythonNativeObject y,
|
1123 | 1128 | @SuppressWarnings("unused") @CachedContext(PythonLanguage.class) PythonContext context,
|
@@ -1243,6 +1248,50 @@ boolean doDL(double x, long y) {
|
1243 | 1248 | return x >= y;
|
1244 | 1249 | }
|
1245 | 1250 |
|
| 1251 | + @Specialization |
| 1252 | + boolean doPI(double x, PInt y) { |
| 1253 | + return x >= y.doubleValue(); |
| 1254 | + } |
| 1255 | + |
| 1256 | + @Specialization(guards = "fromNativeNode.isFloatSubtype(frame, y, getClass, isSubtype, context)", limit = "1") |
| 1257 | + boolean doDN(VirtualFrame frame, double x, PythonNativeObject y, |
| 1258 | + @SuppressWarnings("unused") @CachedContext(PythonLanguage.class) PythonContext context, |
| 1259 | + @SuppressWarnings("unused") @Cached GetClassNode getClass, |
| 1260 | + @SuppressWarnings("unused") @Cached IsSubtypeNode isSubtype, |
| 1261 | + @Cached FromNativeSubclassNode fromNativeNode) { |
| 1262 | + return x >= fromNativeNode.execute(frame, y); |
| 1263 | + } |
| 1264 | + |
| 1265 | + @Specialization(guards = { |
| 1266 | + "nativeLeft.isFloatSubtype(frame, x, getClass, isSubtype, context)", |
| 1267 | + "nativeRight.isFloatSubtype(frame, y, getClass, isSubtype, context)"}, limit = "1") |
| 1268 | + boolean doNN(VirtualFrame frame, PythonNativeObject x, PythonNativeObject y, |
| 1269 | + @SuppressWarnings("unused") @CachedContext(PythonLanguage.class) PythonContext context, |
| 1270 | + @SuppressWarnings("unused") @Cached GetClassNode getClass, |
| 1271 | + @SuppressWarnings("unused") @Cached IsSubtypeNode isSubtype, |
| 1272 | + @Cached FromNativeSubclassNode nativeLeft, |
| 1273 | + @Cached FromNativeSubclassNode nativeRight) { |
| 1274 | + return nativeLeft.execute(frame, x) >= nativeRight.execute(frame, y); |
| 1275 | + } |
| 1276 | + |
| 1277 | + @Specialization(guards = "fromNativeNode.isFloatSubtype(frame, x, getClass, isSubtype, context)", limit = "1") |
| 1278 | + boolean doND(VirtualFrame frame, PythonNativeObject x, double y, |
| 1279 | + @SuppressWarnings("unused") @CachedContext(PythonLanguage.class) PythonContext context, |
| 1280 | + @SuppressWarnings("unused") @Cached GetClassNode getClass, |
| 1281 | + @SuppressWarnings("unused") @Cached IsSubtypeNode isSubtype, |
| 1282 | + @Cached FromNativeSubclassNode fromNativeNode) { |
| 1283 | + return fromNativeNode.execute(frame, x) >= y; |
| 1284 | + } |
| 1285 | + |
| 1286 | + @Specialization(guards = "fromNativeNode.isFloatSubtype(frame, x, getClass, isSubtype, context)", limit = "1") |
| 1287 | + boolean doNL(VirtualFrame frame, PythonNativeObject x, long y, |
| 1288 | + @SuppressWarnings("unused") @CachedContext(PythonLanguage.class) PythonContext context, |
| 1289 | + @SuppressWarnings("unused") @Cached GetClassNode getClass, |
| 1290 | + @SuppressWarnings("unused") @Cached IsSubtypeNode isSubtype, |
| 1291 | + @Cached FromNativeSubclassNode fromNativeNode) { |
| 1292 | + return fromNativeNode.execute(frame, x) >= y; |
| 1293 | + } |
| 1294 | + |
1246 | 1295 | @Fallback
|
1247 | 1296 | @SuppressWarnings("unused")
|
1248 | 1297 | PNotImplemented doGeneric(Object a, Object b) {
|
|
0 commit comments