Take into account step sign in pre-condition for simple progression
So far, all non-end-inclusive progressions had step > 0. With intrinsics for 'reversed' this will change.
This commit is contained in:
+12
-2
@@ -77,10 +77,20 @@ class ForInSimpleProgressionLoopGenerator(
|
||||
v.load(endVar, asmElementType)
|
||||
if (asmElementType.sort == Type.LONG) {
|
||||
v.lcmp()
|
||||
v.ifge(loopExit)
|
||||
if (step > 0) {
|
||||
v.ifge(loopExit)
|
||||
}
|
||||
else {
|
||||
v.ifle(loopExit)
|
||||
}
|
||||
}
|
||||
else {
|
||||
v.ificmpge(loopExit)
|
||||
if (step > 0) {
|
||||
v.ificmpge(loopExit)
|
||||
}
|
||||
else {
|
||||
v.ificmple(loopExit)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user