diff options
author | Mike Pall <mike> | 2011-01-25 18:50:24 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2011-01-25 18:50:24 +0100 |
commit | ed6c895ae56288b6982d1651c4ea638452c9e99b (patch) | |
tree | d6cfd052707979ce8d071c05c457872e130473db /src/buildvm_asm.c | |
parent | 705f593ffc91ecfc42f0de81b86fe4a6c3097958 (diff) | |
download | luajit-ed6c895ae56288b6982d1651c4ea638452c9e99b.tar.gz luajit-ed6c895ae56288b6982d1651c4ea638452c9e99b.tar.bz2 luajit-ed6c895ae56288b6982d1651c4ea638452c9e99b.zip |
ARM: Add ARM target architecture selection (disabled).
Diffstat (limited to 'src/buildvm_asm.c')
-rw-r--r-- | src/buildvm_asm.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/buildvm_asm.c b/src/buildvm_asm.c index 049d76ff..1f5d59a3 100644 --- a/src/buildvm_asm.c +++ b/src/buildvm_asm.c | |||
@@ -95,7 +95,9 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n, | |||
95 | uint32_t ins; | 95 | uint32_t ins; |
96 | emit_asm_words(ctx, p, n-4); | 96 | emit_asm_words(ctx, p, n-4); |
97 | ins = *(uint32_t *)(p+n-4); | 97 | ins = *(uint32_t *)(p+n-4); |
98 | #if LJ_TARGET_PPC | 98 | #if LJ_TARGET_ARM |
99 | UNUSED(sym); /* NYI */ | ||
100 | #elif LJ_TARGET_PPC | ||
99 | if ((ins >> 26) == 16) { | 101 | if ((ins >> 26) == 16) { |
100 | fprintf(ctx->fp, "\t%s %d, %d, %s\n", | 102 | fprintf(ctx->fp, "\t%s %d, %d, %s\n", |
101 | (ins & 1) ? "bcl" : "bc", (ins >> 21) & 31, (ins >> 16) & 31, sym); | 103 | (ins & 1) ? "bcl" : "bc", (ins >> 21) & 31, (ins >> 16) & 31, sym); |
@@ -113,6 +115,12 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n, | |||
113 | } | 115 | } |
114 | #endif | 116 | #endif |
115 | 117 | ||
118 | #if LJ_TARGET_ARM | ||
119 | #define ELFASM_PX "%%" | ||
120 | #else | ||
121 | #define ELFASM_PX "@" | ||
122 | #endif | ||
123 | |||
116 | /* Emit an assembler label. */ | 124 | /* Emit an assembler label. */ |
117 | static void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc) | 125 | static void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc) |
118 | { | 126 | { |
@@ -121,7 +129,7 @@ static void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc | |||
121 | fprintf(ctx->fp, | 129 | fprintf(ctx->fp, |
122 | "\n\t.globl %s\n" | 130 | "\n\t.globl %s\n" |
123 | "\t.hidden %s\n" | 131 | "\t.hidden %s\n" |
124 | "\t.type %s, @%s\n" | 132 | "\t.type %s, " ELFASM_PX "%s\n" |
125 | "\t.size %s, %d\n" | 133 | "\t.size %s, %d\n" |
126 | "%s:\n", | 134 | "%s:\n", |
127 | name, name, name, isfunc ? "function" : "object", name, size, name); | 135 | name, name, name, isfunc ? "function" : "object", name, size, name); |
@@ -204,7 +212,7 @@ void emit_asm(BuildCtx *ctx) | |||
204 | fprintf(ctx->fp, "\n"); | 212 | fprintf(ctx->fp, "\n"); |
205 | switch (ctx->mode) { | 213 | switch (ctx->mode) { |
206 | case BUILD_elfasm: | 214 | case BUILD_elfasm: |
207 | fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\",@progbits\n"); | 215 | fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\"," ELFASM_PX "progbits\n"); |
208 | #if LJ_TARGET_PPCSPE | 216 | #if LJ_TARGET_PPCSPE |
209 | /* Soft-float ABI + SPE. */ | 217 | /* Soft-float ABI + SPE. */ |
210 | fprintf(ctx->fp, "\t.gnu_attribute 4, 2\n\t.gnu_attribute 8, 3\n"); | 218 | fprintf(ctx->fp, "\t.gnu_attribute 4, 2\n\t.gnu_attribute 8, 3\n"); |