+#include "../beirg_t.h"
+
+static ir_entity *fpcw_round = NULL;
+static ir_entity *fpcw_truncate = NULL;
+
+static ir_entity *create_ent(int value, const char *name)
+{
+ ir_mode *mode = mode_Hu;
+ ir_type *type = new_type_primitive(new_id_from_str("_fpcw_type"), mode);
+ ir_type *glob = get_glob_type();
+ ir_graph *cnst_irg;
+ ir_entity *ent;
+ ir_node *cnst;
+ tarval *tv;
+
+ set_type_alignment_bytes(type, 4);
+
+ tv = new_tarval_from_long(value, mode);
+ ent = new_entity(glob, new_id_from_str(name), type);
+ set_entity_ld_ident(ent, get_entity_ident(ent));
+ set_entity_visibility(ent, visibility_local);
+ set_entity_variability(ent, variability_constant);
+ set_entity_allocation(ent, allocation_static);
+
+ cnst_irg = get_const_code_irg();
+ cnst = new_r_Const(cnst_irg, get_irg_start_block(cnst_irg), mode, tv);
+ set_atomic_ent_value(ent, cnst);
+
+ return ent;
+}
+
+static void create_fpcw_entities(void)
+{
+ fpcw_round = create_ent(0xc7f, "_fpcw_round");
+ fpcw_truncate = create_ent(0x37f, "_fpcw_truncate");
+}