Am 06.12.2011 18:22, schrieb Jonathan "Duke" Leto:
I am +1 to adding this op, with tests. I can help with the tests if needed.
Please take a look at t/op/inf_nan.t function test_is_inf_or_nan. It's not very comprehensive, but there are really just 4 cases to consider, afaict (Inf/-Inf/NaN/normal)
I would very much like to see some benchmark data of Rakudo with and without this opcode to see what kind of performance change this entails.
I don't have a benchmark here, but considering that the alternative to that op is something like (Inf|-Inf|NaN).ACCEPTS($value) which involves calls to at least 6 other routines, and thus 12 additional GC-ables, I'm quite sure it is easily measurable. And all that for a call to floor($num) or ceiling($num).
Cheers, Moritz _______________________________________________ http://lists.parrot.org/mailman/listinfo/parrot-dev
