diff options
author | Elijah Taylor <elijahtaylor@google.com> | 2011-08-05 17:02:45 +0200 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2011-08-05 17:04:24 +0200 |
commit | c6d53e16991eb2dcc3e4d99a008fdd899d2b78f2 (patch) | |
tree | b030dd3f8f149e77bf71d26f36e19efb325ab5e8 | |
parent | 8034d4b8f49485babcbffd12d3e09fd372c00ccb (diff) | |
download | ffts-c6d53e16991eb2dcc3e4d99a008fdd899d2b78f2.zip ffts-c6d53e16991eb2dcc3e4d99a008fdd899d2b78f2.tar.gz |
Fix up bugs in x86-codegen for NaCl.
-rw-r--r-- | x86/x86-codegen.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/x86/x86-codegen.h b/x86/x86-codegen.h index ff79b52..fd2c528 100644 --- a/x86/x86-codegen.h +++ b/x86/x86-codegen.h @@ -524,6 +524,7 @@ typedef union { #define x86_rdtsc(inst) \ do { \ + x86_codegen_pre(&(inst), 2); \ *(inst)++ = 0x0f; \ *(inst)++ = 0x31; \ } while (0) @@ -584,7 +585,7 @@ typedef union { #define x86_xadd_reg_reg(inst,dreg,reg,size) \ do { \ - x86_codegen_pre(&(inst), 4); \ + x86_codegen_pre(&(inst), 3); \ *(inst)++ = (unsigned char)0x0F; \ if ((size) == 1) \ *(inst)++ = (unsigned char)0xC0; \ @@ -670,14 +671,14 @@ typedef union { #define x86_neg_mem(inst,mem) \ do { \ - x86_codegen_pre(&(inst), 2); \ + x86_codegen_pre(&(inst), 6); \ *(inst)++ = (unsigned char)0xf7; \ x86_mem_emit ((inst), 3, (mem)); \ } while (0) #define x86_neg_membase(inst,basereg,disp) \ do { \ - x86_codegen_pre(&(inst), 6); \ + x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \ *(inst)++ = (unsigned char)0xf7; \ x86_membase_emit ((inst), 3, (basereg), (disp)); \ } while (0) @@ -881,11 +882,11 @@ typedef union { #define x86_shift_membase_imm(inst,opc,basereg,disp,imm) \ do { \ if ((imm) == 1) { \ - x86_codegen_pre(&(inst), 6); \ + x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \ *(inst)++ = (unsigned char)0xd1; \ x86_membase_emit ((inst), (opc), (basereg), (disp)); \ } else { \ - x86_codegen_pre(&(inst), 7); \ + x86_codegen_pre(&(inst), 2 + kMaxMembaseEmitPadding); \ *(inst)++ = (unsigned char)0xc1; \ x86_membase_emit ((inst), (opc), (basereg), (disp)); \ x86_imm_emit8 ((inst), (imm)); \ |