Originally found here:
http://stackoverflow.com/a/24899011/2613885
The benchmark from http://cr.openjdk.java.net/~shade/8051725/ yields:
o.o.IfSetneBench.test0 2.286 0.011 ns/op
o.o.IfSetneBench.test1 1.010 0.003 ns/op
o.o.IfSetneBench.test1neg 1.010 0.003 ns/op
o.o.IfSetneBench.test42 1.011 0.005 ns/op
o.o.IfSetneBench.test42neg 1.008 0.002 ns/op
Notice test0 is slower than any other variant. This is because it indeed uses the weird SETNE optimization:
http://cr.openjdk.java.net/~shade/8051725/test0.perfasm
...while other tests are doing the plain cmp:
http://cr.openjdk.java.net/~shade/8051725/test1.perfasm
http://stackoverflow.com/a/24899011/2613885
The benchmark from http://cr.openjdk.java.net/~shade/8051725/ yields:
o.o.IfSetneBench.test0 2.286 0.011 ns/op
o.o.IfSetneBench.test1 1.010 0.003 ns/op
o.o.IfSetneBench.test1neg 1.010 0.003 ns/op
o.o.IfSetneBench.test42 1.011 0.005 ns/op
o.o.IfSetneBench.test42neg 1.008 0.002 ns/op
Notice test0 is slower than any other variant. This is because it indeed uses the weird SETNE optimization:
http://cr.openjdk.java.net/~shade/8051725/test0.perfasm
...while other tests are doing the plain cmp:
http://cr.openjdk.java.net/~shade/8051725/test1.perfasm
- causes
-
JDK-8357885 Assert failed: Unrecognized comparison for Conv2B: Con
-
- New
-