bug-mes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] mes: Make logand work correctly


From: W. J. van der Laan
Subject: Re: [PATCH] mes: Make logand work correctly
Date: Wed, 21 Apr 2021 07:23:53 +0000

On Wednesday, April 21st, 2021 at 8:36 AM, Jan Nieuwenhuizen <janneke@gnu.org> 
wrote:

> W. J. van der Laan writes:
>
> Thanks, good catch! Interesting how this procedure seems necessary to have, 
> but
> its result was a don't care?

Incidentally I found it out because I introduced a new use of the procedure 
locally to pick the right immediate instruction format:

    ((and (>= v (- #x800)) (<= v #x7ff) (= (logand v 15) 0))
      `(,(string-append "addi___%" r0 ",%" r1 ",$i8_0") (#:immediate1 ,(ash v 
-4))))
    ((and (>= v (- #x800)) (<= v #x7ff) (= (logand v 15) 8))
      `(,(string-append "addi___%" r0 ",%" r1 ",$i8_8") (#:immediate1 ,(ash v 
-4))))

"logand" always 0 resulted in an obvious miscompile :)

> Applied to master with minor nitpicks.

Thanks!

> I also added a simple test

I wanted to do this as well but had no idea where to add it. But I was looking 
for .scm files, not .test so didn't notice there was a file dedicated to 
testing math functionality. Thanks for doing so.

-W




reply via email to

[Prev in Thread] Current Thread [Next in Thread]