Message ID | CAMe9rOqeBxn0YOhBi4BnrGri5xNQrEXVGovSRj745s=cmDd+uQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 07/20/2011 02:00 PM, H.J. Lu wrote: > operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0, > OPTAB_DIRECT); > } > + else if (TARGET_X32) > + operands[0] = convert_memory_address (Pmode, operands[0]); > }) > > (define_insn "*tablejump_1" > --- > > Richard, is this OK for trunk with the last patch if they work? Yeah. I had put the convert_memory_address first, because I thought it would help match modes inside the PIC section as well. Anyway, I see that expand_simple_binop will handle mode conversions itself, so this placement is also ok. I'm only mildly curious as to why that placement failed. r~
On Wed, Jul 20, 2011 at 2:24 PM, Richard Henderson <rth@redhat.com> wrote: > On 07/20/2011 02:00 PM, H.J. Lu wrote: >> operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0, >> OPTAB_DIRECT); >> } >> + else if (TARGET_X32) >> + operands[0] = convert_memory_address (Pmode, operands[0]); >> }) >> >> (define_insn "*tablejump_1" >> --- >> >> Richard, is this OK for trunk with the last patch if they work? > > Yeah. > > I had put the convert_memory_address first, because I thought it > would help match modes inside the PIC section as well. Anyway, I > see that expand_simple_binop will handle mode conversions itself, > so this placement is also ok. I'm only mildly curious as to why > that placement failed. > The difference is: Working: 72d0: 4e 63 3c b8 movslq (%rax,%r15,4),%r15 72d4: 4c 01 f8 add %r15,%rax 72d7: ff e0 jmpq *%rax not working: 72d0: 46 8b 3c b8 mov (%rax,%r15,4),%r15d 72d4: 4c 01 f8 add %r15,%rax 72d7: ff e0 jmpq *%rax
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 6e1dbb8..09ea1d4 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -10996,9 +10996,6 @@ (use (label_ref (match_operand 1 "" "")))])] "" { - if (TARGET_X32) - operands[0] = convert_memory_address (Pmode, operands[0]); - /* In PIC mode, the table entries are stored GOT (32-bit) or PC (64-bit) relative. Convert the relative address to an absolute address. */ if (flag_pic) @@ -11030,6 +11027,8 @@ operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0, OPTAB_DIRECT); } + else if (TARGET_X32) + operands[0] = convert_memory_address (Pmode, operands[0]); }) (define_insn "*tablejump_1"