Commit 3e08d068 authored by yb9976's avatar yb9976
Browse files

Use double quotes to correctly process newlines.

With single quotes all except the first line of the emit string are
not indented, which makes the assembler illegible.
parent 10790875
......@@ -87,7 +87,7 @@ Push => {
state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none", "gp", "rsp" ], out => [ "rsp:I|S", "none" ] },
ins => [ "base", "index", "mem", "val", "stack" ],
emit => 'push %S0',
emit => "push %S0",
outs => [ "stack", "M" ],
am => "source,unary",
},
......@@ -98,7 +98,7 @@ Add => {
reg_req => { in => [ "gp", "gp" ], out => [ "in_r1 !in_r2" ] },
ins => [ "left", "right" ],
outs => [ "res" ],
emit => 'add %S1, %D0',
emit => "add %S1, %D0",
mode => $mode_gp,
modified_flags => 1,
},
......@@ -109,7 +109,7 @@ And => {
reg_req => { in => [ "gp", "gp" ], out => [ "in_r1 !in_r2" ] },
ins => [ "left", "right" ],
outs => [ "res" ],
emit => 'and %S1, %D0',
emit => "and %S1, %D0",
mode => $mode_gp,
modified_flags => 1,
},
......@@ -120,7 +120,7 @@ IMul => {
reg_req => { in => [ "gp", "gp" ], out => [ "in_r1 !in_r2" ] },
ins => [ "left", "right" ],
outs => [ "res" ],
emit => 'imul %S1, %D0',
emit => "imul %S1, %D0",
mode => $mode_gp,
am => "source,binary",
modified_flags => $status_flags
......@@ -132,7 +132,7 @@ Or => {
reg_req => { in => [ "gp", "gp" ], out => [ "in_r1 !in_r2" ] },
ins => [ "left", "right" ],
outs => [ "res" ],
emit => 'or %S1, %D0',
emit => "or %S1, %D0",
mode => $mode_gp,
modified_flags => 1,
},
......@@ -142,7 +142,7 @@ Shl => {
reg_req => { in => [ "gp", "rcx" ], out => [ "in_r1 !in_r2" ] },
ins => [ "val", "count" ],
out => [ "res" ],
emit => 'shl %%cl, %D0',
emit => "shl %%cl, %D0",
mode => $mode_gp,
modified_flags => $status_flags
},
......@@ -152,7 +152,7 @@ Shr => {
reg_req => { in => [ "gp", "rcx" ], out => [ "in_r1 !in_r2" ] },
ins => [ "val", "count" ],
out => [ "res" ],
emit => 'shr %%cl, %D0',
emit => "shr %%cl, %D0",
mode => $mode_gp,
modified_flags => $status_flags
},
......@@ -162,7 +162,7 @@ Sar => {
reg_req => { in => [ "gp", "rcx" ], out => [ "in_r1 !in_r2" ] },
ins => [ "val", "count" ],
out => [ "res" ],
emit => 'sar %%cl, %D0',
emit => "sar %%cl, %D0",
mode => $mode_gp,
modified_flags => $status_flags
},
......@@ -173,7 +173,7 @@ Sub => {
reg_req => { in => [ "gp", "gp" ], out => [ "in_r1 !in_r2" ] },
ins => [ "left", "right" ],
outs => [ "res" ],
emit => 'sub %S1, %D0',
emit => "sub %S1, %D0",
mode => $mode_gp,
modified_flags => 1,
},
......@@ -182,7 +182,7 @@ Neg => {
irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp" ],
out => [ "in_r1" ] },
emit => 'neg %S0',
emit => "neg %S0",
ins => [ "val" ],
outs => [ "res" ],
mode => $mode_gp,
......@@ -192,7 +192,7 @@ Neg => {
Not => {
irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp" ], out => [ "in_r1" ] },
emit => 'not %S0',
emit => "not %S0",
ins => [ "val" ],
outs => [ "res" ],
mode => $mode_gp,
......@@ -205,7 +205,7 @@ Xor => {
reg_req => { in => [ "gp", "gp" ], out => [ "in_r1 !in_r2" ] },
ins => [ "left", "right" ],
outs => [ "res" ],
emit => 'xor %S1, %D0',
emit => "xor %S1, %D0",
mode => $mode_gp,
modified_flags => 1,
},
......@@ -215,7 +215,7 @@ Const => {
attr => "unsigned imm_value",
init_attr => "attr->ext.imm_value = imm_value;",
reg_req => { out => [ "gp" ] },
emit => 'mov %C, %D0',
emit => "mov %C, %D0",
mode => $mode_gp,
},
......@@ -254,7 +254,7 @@ Cmp => {
out => [ "flags" ] },
ins => [ "left", "right" ],
outs => [ "eflags" ],
emit => 'cmp %S1, %S0',
emit => "cmp %S1, %S0",
attr => "int ins_permuted, int cmp_unsigned",
init_attr => "attr->data.ins_permuted = ins_permuted;\n".
"\tattr->data.cmp_unsigned = cmp_unsigned;\n",
......
This diff is collapsed.
......@@ -252,20 +252,20 @@ ASM => {
Add => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'add %S0, %SI1, %D0',
emit => "add %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
AddCC => {
irn_flags => [ "rematerializable" ],
emit => 'addcc %S0, %SI1, %D0',
emit => "addcc %S0, %SI1, %D0",
outs => [ "res", "flags" ],
constructors => \%binopcc_operand_constructors,
},
AddCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'addcc %S0, %SI1, %%g0',
emit => "addcc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -274,7 +274,7 @@ AddX => {
# At the moment not rematerializable because of assert in beflags.c/
# (it claims that spiller can't rematerialize flag stuff correctly)
#irn_flags => [ "rematerializable" ],
emit => 'addx %S0, %SI1, %D0',
emit => "addx %S0, %SI1, %D0",
constructors => \%binopx_operand_constructors,
mode => $mode_gp,
},
......@@ -295,27 +295,27 @@ AddX_t => {
Sub => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'sub %S0, %SI1, %D0',
emit => "sub %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
SubCC => {
irn_flags => [ "rematerializable" ],
emit => 'subcc %S0, %SI1, %D0',
emit => "subcc %S0, %SI1, %D0",
outs => [ "res", "flags" ],
constructors => \%binopcc_operand_constructors,
},
SubCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'subcc %S0, %SI1, %%g0',
emit => "subcc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
SubX => {
# Not rematerializable (see AddX)
emit => 'subx %S0, %SI1, %D0',
emit => "subx %S0, %SI1, %D0",
constructors => \%binopx_operand_constructors,
mode => $mode_gp,
},
......@@ -354,7 +354,7 @@ Ld => {
ins => [ "ptr", "mem" ],
outs => [ "res", "M" ],
attr_type => "sparc_load_store_attr_t",
emit => 'ld%ML [%S0%O1], %D0'
emit => "ld%ML [%S0%O1], %D0"
},
SetHi => {
......@@ -364,7 +364,7 @@ SetHi => {
reg_req => { in => [], out => [ "gp" ] },
attr => "ir_entity *entity, int32_t immediate_value",
custominit => "sparc_set_attr_imm(res, entity, immediate_value);",
emit => 'sethi %H, %D0'
emit => "sethi %H, %D0"
},
St => {
......@@ -388,11 +388,11 @@ St => {
ins => [ "val", "ptr", "mem" ],
outs => [ "M" ],
attr_type => "sparc_load_store_attr_t",
emit => 'st%MS %S0, [%S1%O2]'
emit => "st%MS %S0, [%S1%O2]"
},
Save => {
emit => 'save %S0, %SI1, %D0',
emit => "save %S0, %SI1, %D0",
outs => [ "stack" ],
ins => [ "stack" ],
constructors => {
......@@ -430,7 +430,7 @@ RestoreZero => {
reg_req => { in => [ "sp", "frame_pointer" ], out => [ "sp:I|S" ] },
ins => [ "stack", "frame_pointer" ],
outs => [ "stack" ],
emit => 'restore',
emit => "restore",
mode => $mode_gp,
},
......@@ -559,7 +559,7 @@ Call => {
Cmp => { # aka SubccZero
irn_flags => [ "rematerializable" ],
emit => 'cmp %S0, %SI1',
emit => "cmp %S0, %SI1",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -578,34 +578,34 @@ SwitchJmp => {
Sll => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'sll %S0, %SI1, %D0',
emit => "sll %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
Srl => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'srl %S0, %SI1, %D0',
emit => "srl %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
Sra => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'sra %S0, %SI1, %D0',
emit => "sra %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
And => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'and %S0, %SI1, %D0',
emit => "and %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
AndCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'andcc %S0, %SI1, %%g0',
emit => "andcc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -613,13 +613,13 @@ AndCCZero => {
AndN => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'andn %S0, %SI1, %D0',
emit => "andn %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
AndNCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'andncc %S0, %SI1, %%g0',
emit => "andncc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -627,13 +627,13 @@ AndNCCZero => {
Or => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'or %S0, %SI1, %D0',
emit => "or %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
OrCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'orcc %S0, %SI1, %%g0',
emit => "orcc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -641,13 +641,13 @@ OrCCZero => {
OrN => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'orn %S0, %SI1, %D0',
emit => "orn %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
OrNCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'orncc %S0, %SI1, %%g0',
emit => "orncc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -655,13 +655,13 @@ OrNCCZero => {
Xor => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'xor %S0, %SI1, %D0',
emit => "xor %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
XorCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'xorcc %S0, %SI1, %%g0',
emit => "xorcc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -669,13 +669,13 @@ XorCCZero => {
XNor => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'xnor %S0, %SI1, %D0',
emit => "xnor %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
XNorCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'xnorcc %S0, %SI1, %%g0',
emit => "xnorcc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -683,13 +683,13 @@ XNorCCZero => {
Mul => {
irn_flags => [ "rematerializable" ],
mode => $mode_gp,
emit => 'smul %S0, %SI1, %D0',
emit => "smul %S0, %SI1, %D0",
constructors => \%binop_operand_constructors,
},
MulCCZero => {
irn_flags => [ "rematerializable" ],
emit => 'smulcc %S0, %SI1, %%g0',
emit => "smulcc %S0, %SI1, %%g0",
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
......@@ -697,16 +697,16 @@ MulCCZero => {
SMulh => {
irn_flags => [ "rematerializable" ],
outs => [ "low", "high" ],
emit => 'smul %S0, %SI1, %D0\n'.
'mov %%y, %D0',
emit => "smul %S0, %SI1, %D0\n".
"mov %%y, %D0",
constructors => \%binop_operand_constructors,
},
UMulh => {
irn_flags => [ "rematerializable" ],
outs => [ "low", "high" ],
emit => 'umul %S0, %SI1, %D0\n'.
'mov %%y, %D0',
emit => "umul %S0, %SI1, %D0\n".
"mov %%y, %D0",
constructors => \%binop_operand_constructors,
},
......@@ -728,7 +728,7 @@ UDiv => {
fcmp => {
irn_flags => [ "rematerializable" ],
emit => 'fcmp%FM %S0, %S1',
emit => "fcmp%FM %S0, %S1",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
mode => $mode_fpflags,
......@@ -747,7 +747,7 @@ fcmp => {
fadd => {
irn_flags => [ "rematerializable" ],
emit => 'fadd%FM %S0, %S1, %D0',
emit => "fadd%FM %S0, %S1, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
ins => [ "left", "right" ],
......@@ -756,7 +756,7 @@ fadd => {
fsub => {
irn_flags => [ "rematerializable" ],
emit => 'fsub%FM %S0, %S1, %D0',
emit => "fsub%FM %S0, %S1, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
ins => [ "left", "right" ],
......@@ -765,7 +765,7 @@ fsub => {
fmul => {
irn_flags => [ "rematerializable" ],
emit =>'fmul%FM %S0, %S1, %D0',
emit => "fmul%FM %S0, %S1, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
ins => [ "left", "right" ],
......@@ -774,7 +774,7 @@ fmul => {
fdiv => {
irn_flags => [ "rematerializable" ],
emit => 'fdiv%FM %S0, %S1, %D0',
emit => "fdiv%FM %S0, %S1, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
ins => [ "left", "right" ],
......@@ -796,7 +796,7 @@ fneg => {
irn_flags => [ "rematerializable" ],
reg_req => { in => [ "fp" ], out => [ "fp" ] },
# note that we only need the first register even for wide-values
emit => 'fnegs %S0, %D0',
emit => "fnegs %S0, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
ins => [ "val" ],
......@@ -806,7 +806,7 @@ fneg => {
"fabs" => {
irn_flags => [ "rematerializable" ],
# note that we only need the first register even for wide-values
emit => 'fabs %S0, %D0',
emit => "fabs %S0, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
ins => [ "val" ],
......@@ -815,7 +815,7 @@ fneg => {
fftof => {
irn_flags => [ "rematerializable" ],
emit => 'f%FSto%FD %S0, %D0',
emit => "f%FSto%FD %S0, %D0",
attr_type => "sparc_fp_conv_attr_t",
attr => "ir_mode *src_mode, ir_mode *dest_mode",
constructors => {
......@@ -848,7 +848,7 @@ fftof => {
fitof => {
irn_flags => [ "rematerializable" ],
emit => 'fito%FM %S0, %D0',
emit => "fito%FM %S0, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
constructors => {
......@@ -869,7 +869,7 @@ fitof => {
fftoi => {
irn_flags => [ "rematerializable" ],
emit => 'f%FMtoi %S0, %D0',
emit => "f%FMtoi %S0, %D0",
attr_type => "sparc_fp_attr_t",
attr => "ir_mode *fp_mode",
mode => $mode_gp,
......@@ -905,7 +905,7 @@ Ldf => {
attr_type => "sparc_load_store_attr_t",
attr => "ir_mode *ls_mode, ir_entity *entity, int32_t offset, bool is_frame_entity",
custominit => "init_sparc_load_store_attributes(res, ls_mode, entity, offset, is_frame_entity, false);",
emit => 'ld%ML [%S0%O1], %D0'
emit => "ld%ML [%S0%O1], %D0"
},
Stf => {
......@@ -927,8 +927,8 @@ Stf => {
attr_type => "sparc_load_store_attr_t",
attr => "ir_mode *ls_mode, ir_entity *entity, int32_t offset, bool is_frame_entity",
custominit => "init_sparc_load_store_attributes(res, ls_mode, entity, offset, is_frame_entity, false);",
emit => 'st%MS %S0, [%S1%O2]',
mode => 'mode_M',
emit => "st%MS %S0, [%S1%O2]",
mode => "mode_M",
},
); # end of %nodes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment