# |_| #
#--------------------------------------------------#
-$default_cmp_attr = "return ia32_compare_attr(attr_a, attr_b);";
$default_attr_type = "ia32_attr_t";
+%init_attr = (
+ ia32_attr_t => "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);",
+ ia32_x87_attr_t =>
+ "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
+ "\tinit_ia32_x87_attributes(res);",
+ ia32_asm_attr_t =>
+ "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);\n".
+ "\tinit_ia32_x87_attributes(res);".
+ "\tinit_ia32_asm_attributes(res);"
+);
+
+%compare_attr = (
+ ia32_attr_t => "ia32_compare_nodes_attr",
+ ia32_x87_attr_t => "ia32_compare_x87_attr",
+ ia32_asm_attr_t => "ia32_compare_asm_attr",
+);
+
%operands = (
);
mode => "mode_T",
arity => "variable",
out_arity => "variable",
+ attr_type => "ia32_asm_attr_t",
},
#-----------------------------------------------------------------#
Shl => {
irn_flags => "R",
+ # "in_r3" would be enough as out requirement, but the register allocator
+ # does strange things then and doesn't respect the constraint for in4
+ # if the same value is attached to in3 and in4 (if you have "i << i" in C)
reg_req => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
ins => [ "base", "index", "left", "right", "mem" ],
emit => '. shl%M %binop',
# Out requirements is: different from all in
# This is because, out must be different from LowPart and ShiftCount.
# We could say "!ecx !in_r4" but it can occur, that all values live through
- # this Shift and the only value dying is the ShiftCount. Then there would be a
- # register missing, as result must not be ecx and all other registers are
- # occupied. What we should write is "!in_r4 !in_r5", but this is not supported
- # (and probably never will). So we create artificial interferences of the result
- # with all inputs, so the spiller can always assure a free register.
+ # this Shift and the only value dying is the ShiftCount. Then there would be
+ # a register missing, as result must not be ecx and all other registers are
+ # occupied. What we should write is "!in_r4 !in_r5", but this is not
+ # supported (and probably never will). So we create artificial interferences
+ # of the result with all inputs, so the spiller can always assure a free
+ # register.
reg_req => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
emit =>
'
reg_req => { out => [ "vfp_UKNWN" ] },
units => [],
emit => "",
- mode => "mode_E"
+ mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
Unknown_XMM => {
reg_req => { out => [ "vfp_NOREG" ] },
units => [],
emit => "",
- mode => "mode_E"
+ mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
NoReg_XMM => {
latency => 10,
units => [ "VFP" ],
mode => $mode_gp,
+ attr_type => "ia32_x87_attr_t",
},
CmpSet => {
latency => 10,
units => [ "VFP" ],
mode => $mode_gp,
+ attr_type => "ia32_x87_attr_t",
},
vfCMov => {
latency => 10,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
#----------------------------------------------------------#
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfmul => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
l_vfmul => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
l_vfsub => {
outs => [ "res", "M" ],
latency => 20,
units => [ "VFP" ],
+ attr_type => "ia32_x87_attr_t",
},
l_vfdiv => {
latency => 20,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
l_vfprem => {
latency => 2,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfchs => {
latency => 2,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfsin => {
latency => 150,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfcos => {
latency => 150,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfsqrt => {
latency => 30,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
# virtual Load and Store
outs => [ "res", "M" ],
latency => 2,
units => [ "VFP" ],
+ attr_type => "ia32_x87_attr_t",
},
vfst => {
latency => 2,
units => [ "VFP" ],
mode => "mode_M",
+ attr_type => "ia32_x87_attr_t",
},
# Conversions
outs => [ "res", "M" ],
latency => 4,
units => [ "VFP" ],
+ attr_type => "ia32_x87_attr_t",
},
l_vfild => {
latency => 4,
units => [ "VFP" ],
mode => "mode_M",
+ attr_type => "ia32_x87_attr_t",
},
l_vfist => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfld1 => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfldpi => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfldln2 => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfldlg2 => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfldl2t => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfldl2e => {
latency => 4,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
vfConst => {
op_flags => "c",
irn_flags => "R",
-# init_attr => " set_ia32_ls_mode(res, mode);",
reg_req => { out => [ "vfp" ] },
latency => 3,
units => [ "VFP" ],
mode => "mode_E",
+ attr_type => "ia32_x87_attr_t",
},
# other
outs => [ "false", "true", "temp_reg_eax" ],
latency => 10,
units => [ "VFP" ],
+ attr_type => "ia32_x87_attr_t",
},
#------------------------------------------------------------------------#
rd_constructor => "NONE",
reg_req => { },
emit => '. fadd%XM %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
faddp => {
rd_constructor => "NONE",
reg_req => { },
emit => '. faddp %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fmul => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fmul%XM %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fmulp => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fmulp %x87_binop',,
+ attr_type => "ia32_x87_attr_t",
},
fsub => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fsub%XM %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fsubp => {
reg_req => { },
# see note about gas bugs
emit => '. fsubrp %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fsubr => {
irn_flags => "R",
reg_req => { },
emit => '. fsubr%XM %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fsubrp => {
reg_req => { },
# see note about gas bugs
emit => '. fsubp %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fprem => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fprem1',
+ attr_type => "ia32_x87_attr_t",
},
# this node is just here, to keep the simulator running
rd_constructor => "NONE",
reg_req => { },
emit => '. fprem1',
+ attr_type => "ia32_x87_attr_t",
},
fdiv => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fdiv%XM %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fdivp => {
reg_req => { },
# see note about gas bugs
emit => '. fdivrp %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fdivr => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fdivr%XM %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fdivrp => {
reg_req => { },
# see note about gas bugs
emit => '. fdivp %x87_binop',
+ attr_type => "ia32_x87_attr_t",
},
fabs => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fabs',
+ attr_type => "ia32_x87_attr_t",
},
fchs => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fchs',
+ attr_type => "ia32_x87_attr_t",
},
fsin => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fsin',
+ attr_type => "ia32_x87_attr_t",
},
fcos => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fcos',
+ attr_type => "ia32_x87_attr_t",
},
fsqrt => {
rd_constructor => "NONE",
reg_req => { },
emit => '. fsqrt $',
+ attr_type => "ia32_x87_attr_t",
},
# x87 Load and Store
state => "exc_pinned",
reg_req => { },
emit => '. fld%XM %AM',
+ attr_type => "ia32_x87_attr_t",
},
fst => {
reg_req => { },
emit => '. fst%XM %AM',
mode => "mode_M",
+ attr_type => "ia32_x87_attr_t",
},
fstp => {
reg_req => { },
emit => '. fstp%XM %AM',
mode => "mode_M",
+ attr_type => "ia32_x87_attr_t",
},
# Conversions
rd_constructor => "NONE",
reg_req => { },
emit => '. fild%XM %AM',
+ attr_type => "ia32_x87_attr_t",
},
fist => {
reg_req => { },
emit => '. fist%XM %AM',
mode => "mode_M",
+ attr_type => "ia32_x87_attr_t",
},
fistp => {
reg_req => { },
emit => '. fistp%XM %AM',
mode => "mode_M",
+ attr_type => "ia32_x87_attr_t",
},
# constants
irn_flags => "R",
reg_req => { },
emit => '. fldz',
+ attr_type => "ia32_x87_attr_t",
},
fld1 => {
irn_flags => "R",
reg_req => { },
emit => '. fld1',
+ attr_type => "ia32_x87_attr_t",
},
fldpi => {
irn_flags => "R",
reg_req => { },
emit => '. fldpi',
+ attr_type => "ia32_x87_attr_t",
},
fldln2 => {
irn_flags => "R",
reg_req => { },
emit => '. fldln2',
+ attr_type => "ia32_x87_attr_t",
},
fldlg2 => {
irn_flags => "R",
reg_req => { },
emit => '. fldlg2',
+ attr_type => "ia32_x87_attr_t",
},
fldl2t => {
irn_flags => "R",
reg_req => { },
emit => '. fldll2t',
+ attr_type => "ia32_x87_attr_t",
},
fldl2e => {
irn_flags => "R",
reg_req => { },
emit => '. fldl2e',
+ attr_type => "ia32_x87_attr_t",
},
# fxch, fpush, fpop
reg_req => { },
cmp_attr => "return 1;",
emit => '. fxch %X0',
+ attr_type => "ia32_x87_attr_t",
},
fpush => {
reg_req => {},
cmp_attr => "return 1;",
emit => '. fld %X0',
+ attr_type => "ia32_x87_attr_t",
},
fpushCopy => {
reg_req => { in => [ "vfp"], out => [ "vfp" ] },
cmp_attr => "return 1;",
emit => '. fld %X0',
+ attr_type => "ia32_x87_attr_t",
},
fpop => {
reg_req => { },
cmp_attr => "return 1;",
emit => '. fstp %X0',
+ attr_type => "ia32_x87_attr_t",
},
# compare
fcomJmp => {
op_flags => "L|X|Y",
reg_req => { },
+ attr_type => "ia32_x87_attr_t",
},
fcompJmp => {
op_flags => "L|X|Y",
reg_req => { },
+ attr_type => "ia32_x87_attr_t",
},
fcomppJmp => {
op_flags => "L|X|Y",
reg_req => { },
+ attr_type => "ia32_x87_attr_t",
},
fcomrJmp => {
op_flags => "L|X|Y",
reg_req => { },
+ attr_type => "ia32_x87_attr_t",
},
fcomrpJmp => {
op_flags => "L|X|Y",
reg_req => { },
+ attr_type => "ia32_x87_attr_t",
},
fcomrppJmp => {
op_flags => "L|X|Y",
reg_req => { },
+ attr_type => "ia32_x87_attr_t",
},