summaryrefslogtreecommitdiffstats
path: root/libcpu/i386_data.h
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2008-01-11 06:17:06 +0000
committerUlrich Drepper <[email protected]>2008-01-11 06:17:06 +0000
commit96a739922f7bc651ecfacaf9c70168b015ec5e96 (patch)
treef1338dd1f2485c0f378dfc30383d6690b2f76221 /libcpu/i386_data.h
parent193d587f0155a8dc87ef0bd35ded6eb60c28fe1a (diff)
Fix a few instructions with immediate arguments.
Diffstat (limited to 'libcpu/i386_data.h')
-rw-r--r--libcpu/i386_data.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/libcpu/i386_data.h b/libcpu/i386_data.h
index 94bb84bf..7815dbc2 100644
--- a/libcpu/i386_data.h
+++ b/libcpu/i386_data.h
@@ -813,8 +813,15 @@ FCT_imms8 (struct output_data *d)
if (*d->param_start >= d->end)
return -1;
int_fast8_t byte = *(*d->param_start)++;
- int needed = snprintf (&d->bufp[*bufcntp], avail, "$0x%" PRIx32,
- (int32_t) byte);
+ int needed;
+#ifdef X86_64
+ if (*d->prefixes & has_rex_w)
+ needed = snprintf (&d->bufp[*bufcntp], avail, "$0x%" PRIx64,
+ (int64_t) byte);
+ else
+#endif
+ needed = snprintf (&d->bufp[*bufcntp], avail, "$0x%" PRIx32,
+ (int32_t) byte);
if ((size_t) needed > avail)
return (size_t) needed - avail;
*bufcntp += needed;