On Sat, Jul 9, 2011 at 6:43 PM, Richard Henderson <r...@redhat.com> wrote: > On 07/09/2011 06:42 PM, H.J. Lu wrote: >> On Sat, Jul 9, 2011 at 6:34 PM, Richard Henderson <r...@redhat.com> wrote: >>> I developed this patch while working on the dwarf2 pass series. >>> This was before I bypassed the entire problem by removing the >>> !deep branch prediction paths. >>> >>> Ideally, we'd do this generically from gimple. Less ideally, >>> but still better, is to always emit rtl, and support that in >>> the middle end without so many hacks in the back end. >>> >>> I think this cleans things up a bit over emitting text. >>> Particularly if we then include HJ's x32 stuff. >>> >>> Thoughts? >> >> For TARGET_64BIT, please use ptr_mode instead of DImode >> to load thunk into a register. > > That's not quite good enough. For Correctness you need a > zero-extension into Pmode. >
Sure and i386.md has (define_expand "zero_extendsidi2" [(set (match_operand:DI 0 "nonimmediate_operand" "") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] "" { if (!TARGET_64BIT) { emit_insn (gen_zero_extendsidi2_1 (operands[0], operands[1])); DONE; } }) (define_insn "*zero_extendsidi2_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*Y2") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] "TARGET_64BIT" "@ mov\t{%k1, %k0|%k0, %k1} # movd\t{%1, %0|%0, %1} movd\t{%1, %0|%0, %1} %vmovd\t{%1, %0|%0, %1} %vmovd\t{%1, %0|%0, %1}" [(set_attr "type" "imovx,imov,mmxmov,mmxmov,ssemov,ssemov") (set_attr "prefix" "orig,*,orig,orig,maybe_vex,maybe_vex") (set_attr "prefix_0f" "0,*,*,*,*,*") (set_attr "mode" "SI,DI,DI,DI,TI,TI")]) -- H.J.