[Top][All Lists]

[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> 

> 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 
    ((and (>= v (- #x800)) (<= v #x7ff) (= (logand v 15) 8))
      `(,(string-append "addi___%" r0 ",%" r1 ",$i8_8") (#:immediate1 ,(ash v 

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

> Applied to master with minor nitpicks.


> 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.


reply via email to

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