x86insn: quick fix for lack of nopl support
authorDavid Schleef <ds@schleef.org>
Fri, 14 Oct 2011 06:02:00 +0000 (23:02 -0700)
committerDavid Schleef <ds@schleef.org>
Fri, 14 Oct 2011 06:02:00 +0000 (23:02 -0700)
Geode (as well as others) don't have nopl.  So don't use it
for alignment.

orc/orcx86insn.c

index 659ebc5..78ca30d 100644 (file)
@@ -520,12 +520,21 @@ orc_uint8 nop_codes[][16] = {
   { 0 /* MSVC wants something here */ },
   { 0x90 },
   { 0x66, 0x90 }, /* xchg %ax,%ax */
+#if 0
   { 0x0f, 0x1f, 0x00 }, /*  nopl (%rax) */
   { 0x0f, 0x1f, 0x40, 0x00 }, /* nopl 0x0(%rax) */
   { 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopl 0x0(%rax,%rax,1) */
   { 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
   { 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax) */
   { 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax,%rax,1) */
+#else
+  { 0x90, 0x90, 0x90 },
+  { 0x90, 0x90, 0x90, 0x90 },
+  { 0x90, 0x90, 0x90, 0x90, 0x90 },
+  { 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
+  { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
+  { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
+#endif
   { 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopw   0x0(%rax,%rax,1) */
   /* Forms of nopw %cs:0x0(%rax,%rax,1) */
   { 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 },