On Sat, Nov 27, 2004 at 10:34:17AM +0100, Leopold Toetsch wrote:

> 1) Almost half of the non-PMC compare and branch opcodes according to:
> 
>   lt a, b, L1  => ge b, a, L1

I read this and thought of a subtle problem. So I tried some code, and I
surprised myself. I don't think that your logic is correct:

$ /usr/bin/perl -le 'print "$a < $b: ", $a < $b, "\n$b >= $a: ", $b >= $a while 
($a, $b) = splice @ARGV, 0, 2' 1 2 1 1
1 < 2: 1
2 >= 1: 1
1 < 1: 
1 >= 1: 1

After experimenting, I think that it should be

  lt a, b, L1  => gt b, a, L1

Which works for the subtle problem that I thought of:

$ /usr/bin/perl -le 'print "$a < $b: ", $a < $b, "\n$b > $a: ", $b > $a while 
($a, $b) = splice @ARGV, 0, 2' 1 2 1 1 nan 1  
1 < 2: 1
2 > 1: 1
1 < 1: 
1 > 1: 
nan < 1: 
1 > nan: 

So I was wrong on that one. (NaNs may be crazy, but at least they're still
commutative.)

If I'm right, then this doesn't say good things about the completeness of
our regression tests.

Nicholas Clark

Reply via email to