@@ -849,18 +849,38 @@ def test_worst_jumpdests(
849
849
(
850
850
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F ,
851
851
# We want the first divisor to be slightly bigger than 2**128:
852
- # this is the worst case for the division algorithm.
852
+ # this is the worst case for the division algorithm with optimized paths
853
+ # for division by 1 and 2 words.
853
854
0x100000000000000000000000000000033 ,
854
855
),
855
856
),
856
857
(
857
- # Same as DIV, but the numerator made positive, and the divisor made negative.
858
+ # This has the cycle of 2, see above.
859
+ Op .DIV ,
860
+ (
861
+ 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F ,
862
+ # We want the first divisor to be slightly bigger than 2**64:
863
+ # this is the worst case for the division algorithm with an optimized path
864
+ # for division by 1 word.
865
+ 0x10000000000000033 ,
866
+ ),
867
+ ),
868
+ (
869
+ # Same as DIV-0, but the numerator made positive, and the divisor made negative.
858
870
Op .SDIV ,
859
871
(
860
872
0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F ,
861
873
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD ,
862
874
),
863
875
),
876
+ (
877
+ # Same as DIV-1, but the numerator made positive, and the divisor made negative.
878
+ Op .SDIV ,
879
+ (
880
+ 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F ,
881
+ 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFCD ,
882
+ ),
883
+ ),
864
884
(
865
885
# This scenario is not suitable for MOD because the values quickly become 0.
866
886
Op .MOD ,
0 commit comments