From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 3/3] add memory asm constraint for S390
Date: Sat, 4 Jul 2020 15:57:47 +0200 [thread overview]
Message-ID: <20200704135747.87752-4-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20200704135747.87752-1-luc.vanoostenryck@gmail.com>
The 'Q', 'R', 'S' & 'T'' asm constraint are used for for memory
operands on S390 but only 'Q' belong to the 'common constraints'.
Fix this by handling the 3 others with an arch-specific method.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
target-s390.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/target-s390.c b/target-s390.c
index 8fe7d93677b2..9dbc810e507c 100644
--- a/target-s390.c
+++ b/target-s390.c
@@ -1,6 +1,7 @@
#include "symbol.h"
#include "target.h"
#include "machine.h"
+#include "expression.h"
static void predefine_s390(const struct target *self)
@@ -8,6 +9,16 @@ static void predefine_s390(const struct target *self)
predefine("__s390__", 1, "1");
}
+static const char *asm_constraint_s390(struct asm_operand *op, int c, const char *str)
+{
+ switch (c) {
+ case 'R': case 'S': case 'T':
+ op->is_memory = true;
+ break;
+ }
+ return str;
+}
+
const struct target target_s390 = {
.mach = MACH_S390,
.bitness = ARCH_LP32,
@@ -21,6 +32,7 @@ const struct target target_s390 = {
.target_64bit = &target_s390x,
.predefine = predefine_s390,
+ .asm_constraint = asm_constraint_s390,
};
@@ -45,4 +57,5 @@ const struct target target_s390x = {
.target_32bit = &target_s390,
.predefine = predefine_s390x,
+ .asm_constraint = asm_constraint_s390,
};
--
2.27.0
prev parent reply other threads:[~2020-07-04 13:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 13:57 [PATCH 0/3] teach sparse about arch specific asm constraints Luc Van Oostenryck
2020-07-04 13:57 ` [PATCH 1/3] add support for " Luc Van Oostenryck
2020-07-04 13:57 ` Luc Van Oostenryck
2020-07-04 13:57 ` [PATCH 2/3] add memory asm constraint for PPC Luc Van Oostenryck
2020-07-04 17:44 ` Ramsay Jones
2020-07-04 19:32 ` Luc Van Oostenryck
2020-07-04 21:07 ` Ramsay Jones
2020-07-04 22:44 ` Luc Van Oostenryck
2020-07-04 13:57 ` Luc Van Oostenryck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200704135747.87752-4-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox