aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--c/lex.c2
-rw-r--r--common.h2
-rw-r--r--main.c2
-rw-r--r--obj/elf.c6
-rw-r--r--targ.c4
-rw-r--r--x86_64/all.h (renamed from amd64/all.h)4
-rw-r--r--x86_64/emit.c (renamed from amd64/emit.c)4
-rw-r--r--x86_64/isel.c (renamed from amd64/isel.c)2
-rw-r--r--x86_64/sysv.c (renamed from amd64/sysv.c)12
10 files changed, 20 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index eb69747..021903f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
SRC=main.c io.c mem.c c/c.c c/lex.c c/eval.c c/builtin.c type.c targ.c \
ir/ir.c ir/builder.c ir/fold.c ir/dump.c ir/ssa.c ir/cfg.c ir/intrin.c ir/abi0.c ir/optmem.c ir/regalloc.c \
- amd64/sysv.c amd64/isel.c amd64/emit.c obj/obj.c obj/elf.c \
+ x86_64/sysv.c x86_64/isel.c x86_64/emit.c obj/obj.c obj/elf.c \
embedfilesdir.c
CFLAGS=-Wall -std=c11 -pedantic
OBJ=$(patsubst %.c,build/%.o,$(SRC))
diff --git a/c/lex.c b/c/lex.c
index 418a89c..6da3776 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -1956,7 +1956,7 @@ addpredefmacros(struct arena **tmparena)
}
switch (targ_mcisa) {
- case ISamd64:
+ case ISx86_64:
putdef1("__x86_64__");
putdef1("__x86_64");
break;
diff --git a/common.h b/common.h
index ae0beab..81c24ad 100644
--- a/common.h
+++ b/common.h
@@ -156,7 +156,7 @@ extern struct inclpaths {
/* Target */
/**********/
-enum mcisa { ISamd64 };
+enum mcisa { ISx86_64 };
extern const struct mctarg *mctarg;
extern enum mcisa targ_mcisa;
void targ_init(const char *);
diff --git a/main.c b/main.c
index d38a0cd..9cf55af 100644
--- a/main.c
+++ b/main.c
@@ -535,7 +535,7 @@ main(int argc, char **argv)
optparse(argv);
/* global init */
- task.targ = task.targ ? task.targ : "amd64-sysv";
+ task.targ = task.targ ? task.targ : "x86_64-sysv";
targ_init(task.targ);
return driver();
diff --git a/obj/elf.c b/obj/elf.c
index 8defab8..ae841d6 100644
--- a/obj/elf.c
+++ b/obj/elf.c
@@ -43,7 +43,7 @@ elfinit(void)
hdr.i_abiversion = 0;
hdr.h32.type = ET_REL;
switch (targ_mcisa) {
- case ISamd64: hdr.h32.machine = EM_X86_64; break;
+ case ISx86_64: hdr.h32.machine = EM_X86_64; break;
}
hdr.h32.version = ELFVERSION;
if (targ_64bit) {
@@ -127,7 +127,7 @@ elfaddsym(const char *nam, int info, enum section sect, uvlong value, uvlong siz
}
static const ushort relktab[][NRELOCKIND] = {
- [ISamd64] = {
+ [ISx86_64] = {
[REL_ABS64] = 1, /* R_X86_64_64 */
[REL_ABS32] = 10, /* R_X86_64_32 */
[REL_ABS32S] = 11, /* R_X86_64_32S */
@@ -356,7 +356,7 @@ wordalign(struct wbuf *out, int align)
while (off++ & (align - 1)) ioputc(out, 0);
}
-static const bool userelatab[] = { [ISamd64] = 1 };
+static const bool userelatab[] = { [ISx86_64] = 1 };
void
elffini(struct wbuf *out)
diff --git a/targ.c b/targ.c
index 6a4a5bd..9821e39 100644
--- a/targ.c
+++ b/targ.c
@@ -1,7 +1,7 @@
#include "common.h"
#include "type.h"
-extern const struct mctarg t_amd64_sysv;
+extern const struct mctarg t_x86_64_sysv;
static const struct targ {
const char *name;
struct { uchar longsize, vlongsize, ptrsize, valistsize; };
@@ -11,7 +11,7 @@ static const struct targ {
const struct mctarg *mctarg;
enum mcisa isa;
} targs[] = {
- { "amd64-sysv", {8, 8, 8, 24}, {8, 8, 8, 8}, 1, TYULONG, TYLONG, TYINT, &t_amd64_sysv, ISamd64 },
+ { "x86_64-sysv", {8, 8, 8, 24}, {8, 8, 8, 8}, 1, TYULONG, TYLONG, TYINT, &t_x86_64_sysv, ISx86_64 },
{ "i686-sysv", {4, 8, 4, 8}, {4, 4, 4, 4}, 1, TYUINT, TYINT, TYINT }
};
diff --git a/amd64/all.h b/x86_64/all.h
index 992d47e..c0c38ff 100644
--- a/amd64/all.h
+++ b/x86_64/all.h
@@ -12,7 +12,7 @@ enum reg {
#undef R
};
-void amd64_isel(struct function *);
-void amd64_emit(struct function *);
+void x86_64_isel(struct function *);
+void x86_64_emit(struct function *);
/* vim:set ts=3 sw=3 expandtab: */
diff --git a/amd64/emit.c b/x86_64/emit.c
index 6121f5e..4a7d287 100644
--- a/amd64/emit.c
+++ b/x86_64/emit.c
@@ -972,7 +972,7 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
switch (ins->op) {
default:
- fatal(NULL, "amd64: in %y; unimplemented instr '%s'", fn->name, opnames[ins->op]);
+ fatal(NULL, "x86_64: in %y; unimplemented instr '%s'", fn->name, opnames[ins->op]);
case Onop: break;
case Ostore8: cls = KI32, X = Xmovb; goto Store;
case Ostore16: cls = KI32, X = Xmovw; goto Store;
@@ -1378,7 +1378,7 @@ emitbin(struct function *fn)
}
void
-amd64_emit(struct function *fn)
+x86_64_emit(struct function *fn)
{
fn->stksiz = alignup(fn->stksiz, 8);
if (fn->stksiz > 1<<24) error(NULL, "'%s' stack frame too big", fn->name);
diff --git a/amd64/isel.c b/x86_64/isel.c
index a0c913c..5d373f3 100644
--- a/amd64/isel.c
+++ b/x86_64/isel.c
@@ -619,7 +619,7 @@ seljmp(struct function *fn, struct block *blk)
}
void
-amd64_isel(struct function *fn)
+x86_64_isel(struct function *fn)
{
extern int ninstr;
struct block *blk = fn->entry;
diff --git a/amd64/sysv.c b/x86_64/sysv.c
index 486c0c0..32cc9e5 100644
--- a/amd64/sysv.c
+++ b/x86_64/sysv.c
@@ -161,7 +161,7 @@ abiret(short r[2], uchar cls[2], uchar *r2off, int *ni, union irtype typ)
* xmm0 48
* xmm1 64
* ...
- * in amd64/emit xvaprologue generates the code to save the registers to a stack slot
+ * in x86_64/emit xvaprologue generates the code to save the registers to a stack slot
* there only needs to be one xvaprologue if there's any vastart instrs, and it has to be
* at the beginning of the function (before IR generated by regalloc can touch any registers)
* then vastart can initialize va_list.reg_save_area with a pointer to that
@@ -287,27 +287,27 @@ vaarg(struct function *fn, struct block *blk, int *curi)
}
}
-static const char amd64_rnames[][6] = {
+static const char x86_64_rnames[][6] = {
#define R(r) #r,
LIST_REGS(R)
#undef R
};
-const struct mctarg t_amd64_sysv = {
+const struct mctarg t_x86_64_sysv = {
.gpr0 = RAX, .ngpr = R15 - RAX + 1,
.bpr = RBP,
.gprscratch = R11, .fprscratch = XMM15,
.fpr0 = XMM0, .nfpr = XMM15 - XMM0 + 1,
.rcallee = 1<<RBX | 1<<R12 | 1<<R13 | 1<<R14 | 1<<R15,
.rglob = 1<<RSP | 1<<RBP,
- .rnames = amd64_rnames,
+ .rnames = x86_64_rnames,
.objkind = OBJELF,
.abiret = abiret,
.abiarg = abiarg,
.vastart = vastart,
.vaarg = vaarg,
- .isel = amd64_isel,
- .emit = amd64_emit
+ .isel = x86_64_isel,
+ .emit = x86_64_emit
};
/* vim:set ts=3 sw=3 expandtab: */