X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Famd64%2Famd64_spec.pl;h=8d81010ed5e5dc088ca17a424b1c4a3b68f32803;hb=ec6929684fd32404d7ba0f0df5498d2230f3abc0;hp=d184a76be71ea3a093dd9b990eeed54e15e16142;hpb=73adc744c093e432fbc4dc5113cee63cbfce8347;p=libfirm diff --git a/ir/be/amd64/amd64_spec.pl b/ir/be/amd64/amd64_spec.pl index d184a76be..8d81010ed 100644 --- a/ir/be/amd64/amd64_spec.pl +++ b/ir/be/amd64/amd64_spec.pl @@ -115,7 +115,7 @@ $arch = "amd64"; { name => "r14", type => 2 }, { name => "r15", type => 2 }, # { name => "gp_NOREG", type => 4 }, # we need a dummy register for NoReg nodes - { mode => "mode_Iu" } + { mode => "mode_Lu" } ], # fp => [ # { name => "xmm0", type => 1 }, @@ -142,7 +142,7 @@ $arch = "amd64"; ], ); -$mode_gp = "mode_Iu"; +$mode_gp = "mode_Lu"; $mode_flags = "mode_Iu"; sub amd64_custom_init_attr { @@ -203,22 +203,45 @@ Push => { # units => [ "GP" ], }, Add => { + op_flags => "C", irn_flags => "R", state => "exc_pinned", reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, in => [ "left", "right" ], - emit => ". mov %S2, %D1\n" - . ". add %S1, %D1\n", outs => [ "res" ], mode => $mode_gp, + modified_flags => 1, +}, +Mul => { + # we should not rematrialize this node. It produces 2 results and has + # very strict constraints + state => "exc_pinned", + reg_req => { in => [ "rax", "gp" ], + out => [ "rax rdx" ] }, + ins => [ "left", "right" ], + emit => '. mul %S2', + outs => [ "res" ], + mode => $mode_gp, + am => "source,binary", + modified_flags => $status_flags +}, +Sub => { + irn_flags => "R", + state => "exc_pinned", + reg_req => { in => [ "gp", "gp" ], + out => [ "gp" ] }, + in => [ "left", "right" ], + outs => [ "res" ], + mode => $mode_gp, + modified_flags => 1, }, Immediate => { op_flags => "c", attr => "unsigned imm_value", init_attr => "attr->ext.imm_value = imm_value;", reg_req => { out => [ "gp" ] }, - emit => '. movq %C, %D1', + emit => '. mov %C, %D1', mode => $mode_gp, }, SymConst => { @@ -268,6 +291,33 @@ Jcc => { init_attr => "attr->ext.pnc = pnc;", mode => "mode_T", }, +Load => { + op_flags => "L|F", + state => "exc_pinned", + reg_req => { in => [ "gp", "none" ], + out => [ "gp", "none" ] }, + ins => [ "ptr", "mem" ], + outs => [ "res", "M" ], + emit => ". mov (%S1), %D1" +}, +FrameAddr => { + op_flags => "c", + irn_flags => "R", + reg_req => { in => [ "gp" ], out => [ "gp" ] }, + ins => [ "base" ], + attr => "ir_entity *entity", + attr_type => "amd64_SymConst_attr_t", + mode => $mode_gp, +}, +Store => { + op_flags => "L|F", + state => "exc_pinned", + reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] }, + ins => [ "ptr", "val", "mem" ], + outs => [ "M" ], + mode => "mode_M", + emit => ". mov %S2, (%S1)" +}, #NoReg_GP => { # state => "pinned",