From: Ben Rudiak-G. <ben...@gm...> - 2013-02-23 18:15:27
Attachments:
remove-plus-s.diff.txt.gz
|
It doesn't seem worth >200 lines of C and Perl to save ~50 lines in insns.dat. In order to make this work I had to rename sbyte16/sbyte32 so that they can take an ordinary size suffix (their size suffix was formerly treated specially). This fixes one disassembly bug: 48C7C000000080 disassembles to mov rax,0x80000000, which reassembles to B800000080, which loads a different value. The assembler warns in a few cases it didn't before, such as push byte 0xFFFF. Signed-off-by: Ben Rudiak-Gould <benrudiak_at_gmail.com> |
From: Cyrill G. <gor...@op...> - 2013-02-23 19:02:05
|
On Sat, Feb 23, 2013 at 10:14:37AM -0800, Ben Rudiak-Gould wrote: > It doesn't seem worth >200 lines of C and Perl to save ~50 lines in insns.dat. > > In order to make this work I had to rename sbyte16/sbyte32 so that > they can take an ordinary size suffix (their size suffix was formerly > treated specially). > > This fixes one disassembly bug: 48C7C000000080 disassembles to mov > rax,0x80000000, which reassembles to B800000080, which loads a > different value. The assembler warns in a few cases it didn't before, > such as push byte 0xFFFF. > > Signed-off-by: Ben Rudiak-Gould <benrudiak_at_gmail.com> Thanks Ben, i'll take a look once time permits. |
From: H. P. A. <hp...@zy...> - 2013-02-26 05:04:02
|
> --- a/test/immwarn.asm > +++ b/test/immwarn.asm > @@ -14,15 +14,17 @@ > %endif > push -1 > push 0ffffh > +%if WARN > push byte 0FFFFh > +%endif > > add ax,0FFFFh > %if WARN > add ax,0FFFFFFFFh > %endif > add ax,-1 > - add ax,byte 0FFFFh > %if WARN > + add ax,byte 0FFFFh > add ax,byte 0FFFFFFFFh > %endif > add ax,-1 > @@ -32,8 +34,8 @@ > add cx,0FFFFFFFFh > %endif > add cx,-1 > - add cx,byte 0FFFFh > %if WARN > + add cx,byte 0FFFFh > add cx,byte 0FFFFFFFFh > %endif > add cx,-1 These changes are wrong. push byte 0FFFFh ... in 16-bit mode is okay, since only 16 bits are pushed on the stack using the sbyte form there is correct. It is not okay in 32- or 64-bit mode, neither is "push byte 0FFFFFFFFh" okay in 64-bit mode, but it is in 32-bit mode. Similarly, "add <rm16>,byte 0FFFFh" is perfectly fine, since the sbyte form will correctly expand to 0FFFFh. -hpa |
From: Ben Rudiak-G. <ben...@gm...> - 2013-02-27 04:41:45
Attachments:
remove-plus-s-revised.diff.txt.gz
|
Here's a revised patch that fixes the warnings. It now warns in all the same places as before the patch, but some messages are changed, I think for the better (e.g. add ax,0FFFFFFFFh now complains about an out-of-range word instead of an out-of-range signed byte). In the description delete the last sentence ("The assembler warns in a few cases it didn't before...") Signed-off-by: Ben Rudiak-Gould <benrudiak_at_gmail.com> |
From: Cyrill G. <gor...@op...> - 2013-03-01 06:33:51
|
On Tue, Feb 26, 2013 at 08:40:29PM -0800, Ben Rudiak-Gould wrote: > Here's a revised patch that fixes the warnings. It now warns in all > the same places as before the patch, but some messages are changed, I > think for the better (e.g. add ax,0FFFFFFFFh now complains about an > out-of-range word instead of an out-of-range signed byte). > > In the description delete the last sentence ("The assembler warns in a > few cases it didn't before...") > > Signed-off-by: Ben Rudiak-Gould <benrudiak_at_gmail.com> Thanks Ben, applied! Could you please next time attach a complete patch generated by "git format-patch"? Not just diff gzipp'ed. |
From: H. P. A. <hp...@zy...> - 2013-02-27 22:27:56
|
On 02/26/2013 08:40 PM, Ben Rudiak-Gould wrote: > Here's a revised patch that fixes the warnings. It now warns in all > the same places as before the patch, but some messages are changed, I > think for the better (e.g. add ax,0FFFFFFFFh now complains about an > out-of-range word instead of an out-of-range signed byte). > > In the description delete the last sentence ("The assembler warns in a > few cases it didn't before...") > > Signed-off-by: Ben Rudiak-Gould <benrudiak_at_gmail.com> > Looks much better! -hpa |
From: Cyrill G. <gor...@op...> - 2013-02-27 22:32:19
|
On Wed, Feb 27, 2013 at 02:26:22PM -0800, H. Peter Anvin wrote: > On 02/26/2013 08:40 PM, Ben Rudiak-Gould wrote: > > Here's a revised patch that fixes the warnings. It now warns in all > > the same places as before the patch, but some messages are changed, I > > think for the better (e.g. add ax,0FFFFFFFFh now complains about an > > out-of-range word instead of an out-of-range signed byte). > > > > In the description delete the last sentence ("The assembler warns in a > > few cases it didn't before...") > > > > Signed-off-by: Ben Rudiak-Gould <benrudiak_at_gmail.com> > > > > Looks much better! Thanks for review, Peter! I'll grab it tomorrow (if you've not yet picked it up) /me still out of time |