From a7b6bdd6fb86dc6646f70b274a761d58cc503739 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 28 Mar 2011 13:08:52 +0000 Subject: [PATCH] Fix generated assembler which writes the result to memory to correctly use an =m constraint to indicate that the address will be written to. Partial fix to bug #266931. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11671 --- none/tests/amd64/gen_insn_test.pl | 29 +++-------------------------- none/tests/x86/gen_insn_test.pl | 29 +++-------------------------- 2 files changed, 6 insertions(+), 52 deletions(-) diff --git a/none/tests/amd64/gen_insn_test.pl b/none/tests/amd64/gen_insn_test.pl index faa1c7f9b1..91dec10e8a 100644 --- a/none/tests/amd64/gen_insn_test.pl +++ b/none/tests/amd64/gen_insn_test.pl @@ -628,10 +628,7 @@ while (<>) foreach my $result (@results) { - if ($result->{type} =~ /^(m(8|16|32|64|128)|st|eflags|fpu[cs]w)$/) - { - $result->{argnum} = $argnum++; - } + $result->{argnum} = $argnum++; } foreach my $arg (@presets, @args) @@ -641,14 +638,6 @@ while (<>) $arg->{argnum} = $argnum++; } } - - foreach my $result (@results) - { - if ($result->{type} =~ /^(r(8|16|32|64)|mm|xmm)$/) - { - $result->{argnum} = $argnum++; - } - } my $stateargnum = $argnum++; @@ -852,11 +841,8 @@ while (<>) foreach my $result (@results) { - if ($result->{type} =~ /^(m(8|16|32|64|128)|st|eflags|fpu[cs]w)$/) - { - print qq|$prefix\"=m\" \($result->{name}\)|; - $prefix = ", "; - } + print qq|$prefix\"=m\" \($result->{name}\)|; + $prefix = ", "; } print qq|\n|; @@ -871,15 +857,6 @@ while (<>) $prefix = ", "; } } - - foreach my $result (@results) - { - if ($result->{type} =~ /^(r(8|16|32|64)|mm|xmm)$/) - { - print qq|$prefix\"m\" \($result->{name}\)|; - $prefix = ", "; - } - } print qq|$prefix\"m\" \(state[0]\)\n|; diff --git a/none/tests/x86/gen_insn_test.pl b/none/tests/x86/gen_insn_test.pl index 283583dc3e..b6ecb63915 100644 --- a/none/tests/x86/gen_insn_test.pl +++ b/none/tests/x86/gen_insn_test.pl @@ -605,10 +605,7 @@ while (<>) foreach my $result (@results) { - if ($result->{type} =~ /^(m(8|16|32|64|128)|st|eflags|fpu[cs]w)$/) - { - $result->{argnum} = $argnum++; - } + $result->{argnum} = $argnum++; } foreach my $arg (@presets, @args) @@ -618,14 +615,6 @@ while (<>) $arg->{argnum} = $argnum++; } } - - foreach my $result (@results) - { - if ($result->{type} =~ /^(r(8|16|32)|mm|xmm)$/) - { - $result->{argnum} = $argnum++; - } - } my $stateargnum = $argnum++; @@ -817,11 +806,8 @@ while (<>) foreach my $result (@results) { - if ($result->{type} =~ /^(m(8|16|32|64|128)|st|eflags|fpu[cs]w)$/) - { - print qq|$prefix\"=m\" \($result->{name}\)|; - $prefix = ", "; - } + print qq|$prefix\"=m\" \($result->{name}\)|; + $prefix = ", "; } print qq|\n|; @@ -836,15 +822,6 @@ while (<>) $prefix = ", "; } } - - foreach my $result (@results) - { - if ($result->{type} =~ /^(r(8|16|32)|mm|xmm)$/) - { - print qq|$prefix\"m\" \($result->{name}\)|; - $prefix = ", "; - } - } print qq|$prefix\"m\" \(state[0]\)\n|; -- 2.47.2