diff options
author | David Mitchell <davem@iabyn.com> | 2011-06-22 10:59:18 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-06-25 09:28:17 +0100 |
commit | 33efebe6a5ab2b2152593885ee155259a5bfd3f1 (patch) | |
tree | 6d1f68c083281adbc896385bd35d8dcebb4945bd /embed.h | |
parent | 06c6da524f9e0eae167367edc8fe0150d69893fa (diff) | |
download | perl-33efebe6a5ab2b2152593885ee155259a5bfd3f1.tar.gz |
add do_ncmp fn and make pp_ncmp, pp_eq etc use it
Extract most of the body of pp_ncmp() (numeric compare) into a separate
function, do_ncmp(), then make the following ops use it:
pp_ncmp
pp_lt
pp_le
pp_eq
pp_ne
pp_ge
pp_gt
This removes a lot of similar or duplicated code, most of which is
dedicated to handling the various combinations of IV verses UV verses NV
verses NaN.
The various ops first check for, and directly process, the simple and common
case of both args being SvIOK_notUV(), and pass the processing on to
do_ncmp() otherwise. Benchmarking seems to indicate (but with a lot of
noise) that the SvIOK_notUV case is slightly faster than before, and the
do_ncmp() branch slightly slower.
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -998,6 +998,7 @@ #define do_dump_pad(a,b,c,d) Perl_do_dump_pad(aTHX_ a,b,c,d) #define do_eof(a) Perl_do_eof(aTHX_ a) #define do_execfree() Perl_do_execfree(aTHX) +#define do_ncmp(a,b) Perl_do_ncmp(aTHX_ a,b) #define do_print(a,b) Perl_do_print(aTHX_ a,b) #define do_readline() Perl_do_readline(aTHX) #define do_seek(a,b,c) Perl_do_seek(aTHX_ a,b,c) |