~mpu/qbe

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH] replace asm keyword

Details
Message ID
<20240512085505.18782-1-zerica@callcc.eu>
DKIM signature
pass
Download raw message
Patch: +6 -6
when applying a custom set of CFLAGS under clang that does not include
-std=c99, asm is treated as a keyword and as such can not be used as an
identifier. this prevents the issue by renaming the offending variables.
---
 amd64/emit.c | 4 ++--
 arm64/emit.c | 4 ++--
 rv64/emit.c  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/amd64/emit.c b/amd64/emit.c
index 9636209..a86f092 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -60,7 +60,7 @@ enum {
static struct {
	short op;
	short cls;
	char *asm;
	char *assembly;
} omap[] = {
	{ Oadd,    Ka, "+add%k %1, %=" },
	{ Osub,    Ka, "-sub%k %1, %=" },
@@ -393,7 +393,7 @@ emitins(Ins i, Fn *fn, FILE *f)
			|| (omap[o].cls == Ka))
				break;
		}
		emitf(omap[o].asm, &i, fn, f);
		emitf(omap[o].assembly, &i, fn, f);
		break;
	case Onop:
		/* just do nothing for nops, they are inserted
diff --git a/arm64/emit.c b/arm64/emit.c
index 990d839..1a2cf2d 100644
--- a/arm64/emit.c
+++ b/arm64/emit.c
@@ -37,7 +37,7 @@ enum {
static struct {
	short op;
	short cls;
	char *asm;
	char *assembly;
} omap[] = {
	{ Oadd,    Ki, "add %=, %0, %1" },
	{ Oadd,    Ka, "fadd %=, %0, %1" },
@@ -374,7 +374,7 @@ emitins(Ins *i, E *e)
			|| (omap[o].cls == Ki && KBASE(i->cls) == 0))
				break;
		}
		emitf(omap[o].asm, i, e);
		emitf(omap[o].assembly, i, e);
		break;
	case Onop:
		break;
diff --git a/rv64/emit.c b/rv64/emit.c
index a410ddf..adb4ee6 100644
--- a/rv64/emit.c
+++ b/rv64/emit.c
@@ -8,7 +8,7 @@ enum {
static struct {
	short op;
	short cls;
	char *asm;
	char *assembly;
} omap[] = {
	{ Oadd,    Ki, "add%k %=, %0, %1" },
	{ Oadd,    Ka, "fadd.%k %=, %0, %1" },
@@ -326,7 +326,7 @@ emitins(Ins *i, Fn *fn, FILE *f)
			|| (omap[o].cls == Ki && KBASE(i->cls) == 0))
				break;
		}
		emitf(omap[o].asm, i, fn, f);
		emitf(omap[o].assembly, i, fn, f);
		break;
	case Ocopy:
		if (req(i->to, i->arg[0]))
-- 
2.45.0
Details
Message ID
<ZkJk34aWoaFAYoZQ@cloudsdale.the-delta.net.eu.org>
In-Reply-To
<20240512085505.18782-1-zerica@callcc.eu> (view parent)
DKIM signature
pass
Download raw message
Nice!  Nearly sent a similar patch to fix compilation with tcc,
so not just a clang thing.
Details
Message ID
<D18R4DSLNXKN.1ZA5DHAGOGMRO@cmpwn.com>
In-Reply-To
<ZkJk34aWoaFAYoZQ@cloudsdale.the-delta.net.eu.org> (view parent)
DKIM signature
pass
Download raw message
Also affects gcc 15.
Details
Message ID
<3a51e730-d520-4998-92a2-e2296af9ea86@app.fastmail.com>
In-Reply-To
<D18R4DSLNXKN.1ZA5DHAGOGMRO@cmpwn.com> (view parent)
DKIM signature
pass
Download raw message
I merged a patch in master that removes the
trolly identifier.
Reply to thread Export thread (mbox)