[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] Do not overflow M1 immediates.
From: |
Janneke Nieuwenhuizen |
Subject: |
Re: [PATCH 1/2] Do not overflow M1 immediates. |
Date: |
Mon, 17 Jul 2023 09:12:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Andrius tikonas via Bug reports for GNU Mes writes:
Hi!
As discussed on IRC, this patch works nicely, also on x86_64, I've made
some minor changes, see below.
> M1 immediates are limited to 31-bit before they become negative.
>
> * module/mescc/x86_64/as.scm: limit M1 immediates to #x80000000.
> * lib/tests/scaffold/67-m1-overflow-check.c: add a new test.
I've slightly modified the changelog to this
--8<---------------cut here---------------start------------->8---
mescc: Do not overflow M1 64bit immediates.
M1 immediates are limited to 31-bit before they become negative.
* module/mescc/x86_64/as.scm (x86_64:value->r, x86_64:r-cmp-value,
x86_64:r-long-mem-add, x86_64:r-and): Limit M1 immediate to #x80000000.
* lib/tests/scaffold/67-m1-overflow-check.c: New test.
* build-aux/check-mescc.sh (mes_tests): Add it.
--8<---------------cut here---------------end--------------->8---
[..]
> diff --git a/lib/tests/scaffold/67-m1-overflow-check.c
> b/lib/tests/scaffold/67-m1-overflow-check.c
> +++ b/lib/tests/scaffold/67-m1-overflow-check.c
[..]
> +int main() {
> + return (0xe5894855 >> 31) - 1;
> +}
Changed to adhere to GNU coding style
--8<---------------cut here---------------start------------->8---
int
main ()
{
return (0xe5894855 >> 31) - 1;
}
--8<---------------cut here---------------end--------------->8---
> diff --git a/module/mescc/x86_64/as.scm b/module/mescc/x86_64/as.scm
> index 661a5184..6e9cf6d0 100644
> --- a/module/mescc/x86_64/as.scm
> +++ b/module/mescc/x86_64/as.scm
Added a copyright line. I've put this on wip-x86_64, and rebased
wip-riscv.
Thanks, great work!
Greetings,
Janneke
--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com