- add some doxygen docu
- fixed typos
- small simplification

[r27729]

--- ir/be/arm/arm_transform.c
+++ ir/be/arm/arm_transform.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2010 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -242,7 +242,7 @@
 		ir_mode *min_mode;

 		if (src_bits == dst_bits) {
-			/* kill unneccessary conv */
+			/* kill unnecessary conv */
 			return new_op;
 		}

@@ -557,6 +557,10 @@
 	}
 }

+/**
+ * Checks if a given value can be used as an immediate for the given
+ * ARM shift mode.
+ */
 static bool can_use_shift_constant(unsigned int val,
                                    arm_shift_modifier_t modifier)
 {
@@ -567,6 +571,13 @@
 	return false;
 }

+/**
+ * generate an ARM shift instruction.
+ *
+ * @param node            the node
+ * @param flags           matching flags
+ * @param shift_modifier  initial encoding of the desired shift operation
+ */
 static ir_node *make_shift(ir_node *node, match_flags_t flags,
 		arm_shift_modifier_t shift_modifier)
 {
@@ -933,7 +944,7 @@
 		                          is_unsigned);
 	}

-	/* integer compare, TODO: use shifer_op in all its combinations */
+	/* integer compare, TODO: use shifter_op in all its combinations */
 	new_op1 = be_transform_node(op1);
 	new_op1 = gen_extension(dbgi, block, new_op1, cmp_mode);
 	new_op2 = be_transform_node(op2);
@@ -1561,6 +1572,7 @@

 	return bereturn;
 }
+

 static ir_node *gen_Call(ir_node *node)
 {
@@ -1616,6 +1628,7 @@
 		if (reg != NULL) {
 			in[in_arity] = new_value;
 			if (reg == &arm_gp_regs[REG_LR]) {
+				/* this should not happen, LR cannot be a parameter register ... */
 				in_req[in_arity] = be_create_reg_req(obst,
 						reg, arch_register_req_type_ignore);
 			} else {
@@ -1626,6 +1639,7 @@
 			ir_mode *mode;
 			ir_node *str;
 			if (incsp == NULL) {
+				/* create a parameter frame */
 				ir_node *new_frame = get_stack_pointer_for(node);
 				incsp = be_new_IncSP(sp_reg, new_block, new_frame, cconv->param_stack_size, 1);
 			}
@@ -1706,9 +1720,9 @@

 	/* create output register reqs */
 	arch_set_out_register_req(res, 0, arch_no_register_req);
-	for (o = 1; o < n_caller_saves + 1; ++o) {
-		const arch_register_t *reg = caller_saves[o-1];
-		arch_set_out_register_req(res, o, reg->single_req);
+	for (o = 0; o < n_caller_saves; ++o) {
+		const arch_register_t *reg = caller_saves[o];
+		arch_set_out_register_req(res, o+1, reg->single_req);
 	}

 	/* copy pinned attribute */


ia32: rename bemit_XXX to enc_XXX

ia32: rename bemit_XXX to enc_XXX

--- ir/be/ia32/ia32_emitter.c
+++ ir/be/ia32/ia32_emitter.c
@@ -1698,7 +1698,7 @@
  * Emit address of an entity. If @p is_relative is true then a relative
  * offset from behind the address to the entity is created.
  */
-static void bemit_relocation(x86_imm32_t const *const imm)
+static void enc_relocation(x86_imm32_t const *const imm)
 {
 	ir_entity *entity = imm->entity;
 	int32_t    offset = imm->offset;
@@ -1710,7 +1710,7 @@
 	be_emit_reloc_entity(4, imm->kind, entity, offset);
 }

-static void bemit_jmp_destination(ir_node const *const cfop)
+static void enc_jmp_destination(ir_node const *const cfop)
 {
 	assert(get_irn_mode(cfop) == mode_X);
 	ir_node const *const dest_block = be_emit_get_cfop_target(cfop);
@@ -1723,7 +1723,7 @@
    above. */

 /** Create a ModR/M byte for src1,src2 registers */
-static void bemit_modrr(const arch_register_t *src1,
+static void enc_modrr(const arch_register_t *src1,
                         const arch_register_t *src2)
 {
 	unsigned char modrm = MOD_REG;
@@ -1733,8 +1733,8 @@
 }

 /** Create a ModR/M8 byte for src1,src2 registers */
-static void bemit_modrr8(reg_modifier_t high_part1, const arch_register_t *src1,
-						 reg_modifier_t high_part2, const arch_register_t *src2)
+static void enc_modrr8(reg_modifier_t high_part1, const arch_register_t *src1,
+                       reg_modifier_t high_part2, const arch_register_t *src2)
 {
 	unsigned char modrm = MOD_REG;
 	modrm |= ENC_RM(src1->encoding, high_part1);
@@ -1743,7 +1743,7 @@
 }

 /** Create a ModR/M byte for one register and extension */
-static void bemit_modru(const arch_register_t *reg, unsigned ext)
+static void enc_modru(const arch_register_t *reg, unsigned ext)
 {
 	unsigned char modrm = MOD_REG;
 	assert(ext <= 7);
@@ -1753,7 +1753,7 @@
 }

 /** Create a ModR/M8 byte for one register */
-static void bemit_modrm8(reg_modifier_t high_part, const arch_register_t *reg)
+static void enc_modrm8(reg_modifier_t high_part, const arch_register_t *reg)
 {
 	unsigned char modrm = MOD_REG;
 	assert(reg->encoding < 4);
@@ -1773,7 +1773,7 @@
  * @param reg   content of the reg field: either a register index or an opcode extension
  * @param node  the node
  */
-static void bemit_mod_am(unsigned reg, const ir_node *node)
+static void enc_mod_am(unsigned reg, const ir_node *node)
 {
 	ia32_attr_t const *const attr = get_ia32_attr_const(node);
 	ir_entity const *const entity = attr->am_imm.entity;
@@ -1848,33 +1848,33 @@
 	if (emitoffs == 8) {
 		be_emit8((unsigned) offset);
 	} else if (emitoffs == 32) {
-		bemit_relocation(&attr->am_imm);
-	}
-}
-
-static void bemit_imm32(ir_node const *const node)
+		enc_relocation(&attr->am_imm);
+	}
+}
+
+static void enc_imm32(ir_node const *const node)
 {
 	const ia32_immediate_attr_t *attr = get_ia32_immediate_attr_const(node);
-	bemit_relocation(&attr->imm);
-}
-
-static void bemit_imm(ia32_immediate_attr_t const *const attr,
+	enc_relocation(&attr->imm);
+}
+
+static void enc_imm(ia32_immediate_attr_t const *const attr,
                       unsigned const size)
 {
 	switch (size) {
 	case  8: be_emit8(attr->imm.offset);  break;
 	case 16: be_emit16(attr->imm.offset); break;
-	case 32: bemit_relocation(&attr->imm);  break;
-	}
-}
-
-static void bemit_mov(arch_register_t const *const src, arch_register_t const *const dst)
+	case 32: enc_relocation(&attr->imm);  break;
+	}
+}
+
+static void enc_mov(arch_register_t const *const src, arch_register_t const *const dst)
 {
 	be_emit8(0x88 | OP_MEM_SRC | OP_16_32); // movl %src, %dst
-	bemit_modrr(src, dst);
-}
-
-static void bemit_xchg(arch_register_t const *const src, arch_register_t const *const dst)
+	enc_modrr(src, dst);
+}
+
+static void enc_xchg(arch_register_t const *const src, arch_register_t const *const dst)
 {
 	if (src->index == REG_GP_EAX) {
 		be_emit8(0x90 + dst->encoding); // xchgl %eax, %dst
@@ -1882,11 +1882,11 @@
 		be_emit8(0x90 + src->encoding); // xchgl %src, %eax
 	} else {
 		be_emit8(0x86 | OP_16_32); // xchgl %src, %dst
-		bemit_modrr(src, dst);
-	}
-}
-
-static void bemit_copy(const ir_node *copy)
+		enc_modrr(src, dst);
+	}
+}
+
+static void enc_copy(const ir_node *copy)
 {
 	const arch_register_t *in  = arch_get_irn_register_in(copy, 0);
 	const arch_register_t *out = arch_get_irn_register_out(copy, 0);
@@ -1898,10 +1898,10 @@
 		return;

 	assert(in->cls == &ia32_reg_classes[CLASS_ia32_gp]);
-	bemit_mov(in, out);
-}
-
-static void bemit_perm(const ir_node *node)
+	enc_mov(in, out);
+}
+
+static void enc_perm(const ir_node *node)
 {
 	arch_register_t       const *const reg0 = arch_get_irn_register_out(node, 0);
 	arch_register_t       const *const reg1 = arch_get_irn_register_out(node, 1);
@@ -1910,7 +1910,7 @@
 	assert(cls == reg1->cls && "Register class mismatch at Perm");

 	if (cls == &ia32_reg_classes[CLASS_ia32_gp]) {
-		bemit_xchg(reg0, reg1);
+		enc_xchg(reg0, reg1);
 	} else if (cls == &ia32_reg_classes[CLASS_ia32_xmm]) {
 		panic("unimplemented"); // TODO implement
 		//ia32_emitf(NULL, "xorpd %#R, %#R", reg1, reg0);
@@ -1923,69 +1923,69 @@
 	}
 }

-static void bemit_xor0(const ir_node *node)
+static void enc_xor0(const ir_node *node)
 {
 	be_emit8(0x31);
 	arch_register_t const *const out = arch_get_irn_register_out(node, pn_ia32_Xor0_res);
-	bemit_modrr(out, out);
-}
-
-static void bemit_mov_const(const ir_node *node)
+	enc_modrr(out, out);
+}
+
+static void enc_mov_const(const ir_node *node)
 {
 	arch_register_t const *const out = arch_get_irn_register_out(node, pn_ia32_Const_res);
 	be_emit8(0xB8 + out->encoding);
-	bemit_imm32(node);
+	enc_imm32(node);
 }

 /**
  * Emit an unop.
  */
-static void bemit_unop(ir_node const *const node, uint8_t const code,
+static void enc_unop(ir_node const *const node, uint8_t const code,
                        uint8_t const ext, int const input)
 {
 	be_emit8(code);
 	if (get_ia32_op_type(node) == ia32_Normal) {
 		const arch_register_t *in = arch_get_irn_register_in(node, input);
-		bemit_modru(in, ext);
-	} else {
-		bemit_mod_am(ext, node);
-	}
-}
-
-static void bemit_not(ir_node const *const node)
-{
-	bemit_unop(node, 0xF7, 2, n_ia32_Not_val);
-}
-
-static void bemit_neg(ir_node const *const node)
-{
-	bemit_unop(node, 0xF7, 3, n_ia32_Neg_val);
-}
-
-static void bemit_mul(ir_node const *const node)
-{
-	bemit_unop(node, 0xF7, 4, n_ia32_Mul_right);
-}
-
-static void bemit_imul1op(ir_node const *const node)
-{
-	bemit_unop(node, 0xF7, 5, n_ia32_IMul1OP_right);
-}
-
-static void bemit_div(ir_node const *const node)
-{
-	bemit_unop(node, 0xF7, 6, n_ia32_Div_divisor);
-}
-
-static void bemit_idiv(ir_node const *const node)
-{
-	bemit_unop(node, 0xF7, 7, n_ia32_IDiv_divisor);
-}
-
-static void bemit_ijmp(ir_node const *const node)
+		enc_modru(in, ext);
+	} else {
+		enc_mod_am(ext, node);
+	}
+}
+
+static void enc_not(ir_node const *const node)
+{
+	enc_unop(node, 0xF7, 2, n_ia32_Not_val);
+}
+
+static void enc_neg(ir_node const *const node)
+{
+	enc_unop(node, 0xF7, 3, n_ia32_Neg_val);
+}
+
+static void enc_mul(ir_node const *const node)
+{
+	enc_unop(node, 0xF7, 4, n_ia32_Mul_right);
+}
+
+static void enc_imul1op(ir_node const *const node)
+{
+	enc_unop(node, 0xF7, 5, n_ia32_IMul1OP_right);
+}
+
+static void enc_div(ir_node const *const node)
+{
+	enc_unop(node, 0xF7, 6, n_ia32_Div_divisor);
+}
+
+static void enc_idiv(ir_node const *const node)
+{
+	enc_unop(node, 0xF7, 7, n_ia32_IDiv_divisor);
+}
+
+static void enc_ijmp(ir_node const *const node)
 {
 	/* TODO: am support for IJmp */
-	bemit_unop(node, 0xFF, 4, n_ia32_IJmp_target);
+	enc_unop(node, 0xFF, 4, n_ia32_IJmp_target);
 }

 static bool use_eax_short_form(ir_node const *const node)
@@ -1995,22 +1995,22 @@
 		arch_get_irn_register_in(node, n_ia32_binary_left)->index == REG_GP_EAX;
 }

-static void bemit_binop_reg(ir_node const *const node, unsigned char const code, ir_node const *const right)
+static void enc_binop_reg(ir_node const *const node, unsigned char const code, ir_node const *const right)
 {
 	be_emit8(code);
 	arch_register_t const *const dst = arch_get_irn_register_in(node, n_ia32_binary_left);
 	if (get_ia32_op_type(node) == ia32_Normal) {
 		arch_register_t const *const src = arch_get_irn_register(right);
-		bemit_modrr(src, dst);
-	} else {
-		bemit_mod_am(dst->encoding, node);
+		enc_modrr(src, dst);
+	} else {
+		enc_mod_am(dst->encoding, node);
 	}
 }

 /**
  * Emit a binop.
  */
-static void bemit_binop(ir_node const *const node, unsigned const code)
+static void enc_binop(ir_node const *const node, unsigned const code)
 {
 	ir_mode *const ls_mode = get_ia32_ls_mode(node);
 	unsigned       size    = ls_mode ? get_mode_size_bits(ls_mode) : 32;
@@ -2031,56 +2031,56 @@
 		if (op != OP_16_32_IMM8 && use_eax_short_form(node)) {
 			be_emit8(code << 3 | OP_EAX | op);
 		} else {
-			bemit_unop(node, 0x80 | op, code, n_ia32_binary_left);
-		}
-
-		bemit_imm(attr, size);
-	} else {
-		bemit_binop_reg(node, code << 3 | OP_MEM_SRC | op, right);
-	}
-}
-
-static void bemit_add(ir_node const *const node)
-{
-	bemit_binop(node, 0);
-}
-
-static void bemit_or(ir_node const *const node)
-{
-	bemit_binop(node, 1);
-}
-
-static void bemit_adc(ir_node const *const node)
-{
-	bemit_binop(node, 2);
-}
-
-static void bemit_sbb(ir_node const *const node)
-{
-	bemit_binop(node, 3);
-}
-
-static void bemit_and(ir_node const *const node)
-{
-	bemit_binop(node, 4);
-}
-
-static void bemit_sub(ir_node const *const node)
-{
-	bemit_binop(node, 5);
-}
-
-static void bemit_xor(ir_node const *const node)
-{
-	bemit_binop(node, 6);
-}
-
-static void bemit_cmp(ir_node const *const node)
-{
-	bemit_binop(node, 7);
-}
-
-static void bemit_binop_mem(ir_node const *const node, unsigned const code)
+			enc_unop(node, 0x80 | op, code, n_ia32_binary_left);
+		}
+
+		enc_imm(attr, size);
+	} else {
+		enc_binop_reg(node, code << 3 | OP_MEM_SRC | op, right);
+	}
+}
+
+static void enc_add(ir_node const *const node)
+{
+	enc_binop(node, 0);
+}
+
+static void enc_or(ir_node const *const node)
+{
+	enc_binop(node, 1);
+}
+
+static void enc_adc(ir_node const *const node)
+{
+	enc_binop(node, 2);
+}
+
+static void enc_sbb(ir_node const *const node)
+{
+	enc_binop(node, 3);
+}
+
+static void enc_and(ir_node const *const node)
+{
+	enc_binop(node, 4);
+}
+
+static void enc_sub(ir_node const *const node)
+{
+	enc_binop(node, 5);
+}
+
+static void enc_xor(ir_node const *const node)
+{
+	enc_binop(node, 6);
+}
+
+static void enc_cmp(ir_node const *const node)
+{
+	enc_binop(node, 7);
+}
+
+static void enc_binop_mem(ir_node const *const node, unsigned const code)
 {
 	unsigned size = get_mode_size_bits(get_ia32_ls_mode(node));
 	if (size == 16)
@@ -2098,41 +2098,41 @@

 		/* Emit the main opcode. */
 		be_emit8(0x80 | op);
-		bemit_mod_am(code, node);
-
-		bemit_imm(attr, size);
+		enc_mod_am(code, node);
+
+		enc_imm(attr, size);
 	} else {
 		be_emit8(code << 3 | op);
-		bemit_mod_am(arch_get_irn_register(val)->encoding, node);
-	}
-}
-
-static void bemit_addmem(ir_node const *const node)
-{
-	bemit_binop_mem(node, 0);
-}
-
-static void bemit_ormem(ir_node const *const node)
-{
-	bemit_binop_mem(node, 1);
-}
-
-static void bemit_andmem(ir_node const *const node)
-{
-	bemit_binop_mem(node, 4);
-}
-
-static void bemit_submem(ir_node const *const node)
-{
-	bemit_binop_mem(node, 5);
-}
-
-static void bemit_xormem(ir_node const *const node)
-{
-	bemit_binop_mem(node, 6);
-}
-
-static void bemit_shiftop(ir_node const *const node, uint8_t const ext)
+		enc_mod_am(arch_get_irn_register(val)->encoding, node);
+	}
+}
+
+static void enc_addmem(ir_node const *const node)
+{
+	enc_binop_mem(node, 0);
+}
+
+static void enc_ormem(ir_node const *const node)
+{
+	enc_binop_mem(node, 1);
+}
+
+static void enc_andmem(ir_node const *const node)
+{
+	enc_binop_mem(node, 4);
+}
+
+static void enc_submem(ir_node const *const node)
+{
+	enc_binop_mem(node, 5);
+}
+
+static void enc_xormem(ir_node const *const node)
+{
+	enc_binop_mem(node, 6);
+}
+
+static void enc_shiftop(ir_node const *const node, uint8_t const ext)
 {
 	arch_register_t const *const out
 		= arch_get_irn_register_out(node, pn_ia32_res);
@@ -2141,19 +2141,19 @@
 		int32_t const offset = get_ia32_immediate_attr_const(count)->imm.offset;
 		if (offset == 1) {
 			be_emit8(0xD1);
-			bemit_modru(out, ext);
+			enc_modru(out, ext);
 		} else {
 			be_emit8(0xC1);
-			bemit_modru(out, ext);
+			enc_modru(out, ext);
 			be_emit8(offset);
 		}
 	} else {
 		be_emit8(0xD3);
-		bemit_modru(out, ext);
-	}
-}
-
-static void bemit_shiftop_mem(ir_node const *const node, uint8_t const ext)
+		enc_modru(out, ext);
+	}
+}
+
+static void enc_shiftop_mem(ir_node const *const node, uint8_t const ext)
 {
 	unsigned const size = get_mode_size_bits(get_ia32_ls_mode(node));
 	if (size == 16)
@@ -2163,64 +2163,64 @@
 		int32_t const offset = get_ia32_immediate_attr_const(count)->imm.offset;
 		if (offset == 1) {
 			be_emit8(size == 8 ? 0xD0 : 0xD1);
-			bemit_mod_am(ext, node);
+			enc_mod_am(ext, node);
 		} else {
 			be_emit8(size == 8 ? 0xC0 : 0xC1);
-			bemit_mod_am(ext, node);
+			enc_mod_am(ext, node);
 			be_emit8(offset);
 		}
 	} else {
 		be_emit8(size == 8 ? 0xD2 : 0xD3);
-		bemit_mod_am(ext, node);
-	}
-}
-
-static void bemit_rol(ir_node const *const node)
-{
-	bemit_shiftop(node, 0);
-}
-static void bemit_rolmem(ir_node const *const node)
-{
-	bemit_shiftop_mem(node, 0);
-}
-
-static void bemit_ror(ir_node const *const node)
-{
-	bemit_shiftop(node, 1);
-}
-static void bemit_rormem(ir_node const *const node)
-{
-	bemit_shiftop_mem(node, 1);
-}
-
-static void bemit_shl(ir_node const *const node)
-{
-	bemit_shiftop(node, 4);
-}
-static void bemit_shlmem(ir_node const *const node)
-{
-	bemit_shiftop_mem(node, 4);
-}
-
-static void bemit_shr(ir_node const *const node)
-{
-	bemit_shiftop(node, 5);
-}
-static void bemit_shrmem(ir_node const *const node)
-{
-	bemit_shiftop_mem(node, 5);
-}
-
-static void bemit_sar(ir_node const *const node)
-{
-	bemit_shiftop(node, 7);
-}
-static void bemit_sarmem(ir_node const *const node)
-{
-	bemit_shiftop_mem(node, 7);
-}
-
-static void bemit_shld(const ir_node *node)
+		enc_mod_am(ext, node);
+	}
+}
+
+static void enc_rol(ir_node const *const node)
+{
+	enc_shiftop(node, 0);
+}
+static void enc_rolmem(ir_node const *const node)
+{
+	enc_shiftop_mem(node, 0);
+}
+
+static void enc_ror(ir_node const *const node)
+{
+	enc_shiftop(node, 1);
+}
+static void enc_rormem(ir_node const *const node)
+{
+	enc_shiftop_mem(node, 1);
+}
+
+static void enc_shl(ir_node const *const node)
+{
+	enc_shiftop(node, 4);
+}
+static void enc_shlmem(ir_node const *const node)
+{
+	enc_shiftop_mem(node, 4);
+}
+
+static void enc_shr(ir_node const *const node)
+{
+	enc_shiftop(node, 5);
+}
+static void enc_shrmem(ir_node const *const node)
+{
+	enc_shiftop_mem(node, 5);
+}
+
+static void enc_sar(ir_node const *const node)
+{
+	enc_shiftop(node, 7);
+}
+static void enc_sarmem(ir_node const *const node)
+{
+	enc_shiftop_mem(node, 7);
+}
+
+static void enc_shld(const ir_node *node)
 {
 	const arch_register_t *in  = arch_get_irn_register_in(node, n_ia32_ShlD_val_low);
 	const arch_register_t *out = arch_get_irn_register_out(node, pn_ia32_ShlD_res);
@@ -2228,15 +2228,15 @@
 	be_emit8(0x0F);
 	if (is_ia32_Immediate(count)) {
 		be_emit8(0xA4);
-		bemit_modrr(out, in);
+		enc_modrr(out, in);
 		be_emit8(get_ia32_immediate_attr_const(count)->imm.offset);
 	} else {
 		be_emit8(0xA5);
-		bemit_modrr(out, in);
-	}
-}
-
-static void bemit_shrd(const ir_node *node)
+		enc_modrr(out, in);
+	}
+}
+
+static void enc_shrd(const ir_node *node)
 {
 	const arch_register_t *in  = arch_get_irn_register_in(node, n_ia32_ShrD_val_low);
 	const arch_register_t *out = arch_get_irn_register_out(node, pn_ia32_ShrD_res);
@@ -2244,25 +2244,25 @@
 	be_emit8(0x0F);
 	if (is_ia32_Immediate(count)) {
 		be_emit8(0xAC);
-		bemit_modrr(out, in);
+		enc_modrr(out, in);
 		be_emit8(get_ia32_immediate_attr_const(count)->imm.offset);
 	} else {
 		be_emit8(0xAD);
-		bemit_modrr(out, in);
-	}
-}
-
-static void bemit_sbb0(ir_node const *const node)
+		enc_modrr(out, in);
+	}
+}
+
+static void enc_sbb0(ir_node const *const node)
 {
 	be_emit8(0x1B);
 	arch_register_t const *const out = arch_get_irn_register_out(node, pn_ia32_Sbb0_res);
-	bemit_modrr(out, out);
+	enc_modrr(out, out);
 }

 /**
  * binary emitter for setcc.
  */
-static void bemit_setcc(const ir_node *node)
+static void enc_setcc(const ir_node *node)
 {
 	const arch_register_t *dreg = arch_get_irn_register_out(node, pn_ia32_Setcc_res);

@@ -2272,71 +2272,71 @@
 			/* set%PNC <dreg */
 			be_emit8(0x0F);
 			be_emit8(0x90 | pnc2cc(cc));
-			bemit_modrm8(REG_LOW, dreg);
+			enc_modrm8(REG_LOW, dreg);

 			/* setp >dreg */
 			be_emit8(0x0F);
 			be_emit8(0x9A);
-			bemit_modrm8(REG_HIGH, dreg);
+			enc_modrm8(REG_HIGH, dreg);

 			/* orb %>dreg, %<dreg */
 			be_emit8(0x08);
-			bemit_modrr8(REG_LOW, dreg, REG_HIGH, dreg);
+			enc_modrr8(REG_LOW, dreg, REG_HIGH, dreg);
 		} else {
 			 /* set%PNC <dreg */
 			be_emit8(0x0F);
 			be_emit8(0x90 | pnc2cc(cc));
-			bemit_modrm8(REG_LOW, dreg);
+			enc_modrm8(REG_LOW, dreg);

 			/* setnp >dreg */
 			be_emit8(0x0F);
 			be_emit8(0x9B);
-			bemit_modrm8(REG_HIGH, dreg);
+			enc_modrm8(REG_HIGH, dreg);

 			/* andb %>dreg, %<dreg */
 			be_emit8(0x20);
-			bemit_modrr8(REG_LOW, dreg, REG_HIGH, dreg);
+			enc_modrr8(REG_LOW, dreg, REG_HIGH, dreg);
 		}
 	} else {
 		/* set%PNC <dreg */
 		be_emit8(0x0F);
 		be_emit8(0x90 | pnc2cc(cc));
-		bemit_modrm8(REG_LOW, dreg);
-	}
-}
-
-static void bemit_unop_reg(ir_node const *const node, uint8_t const code,
-                           int const input)
+		enc_modrm8(REG_LOW, dreg);
+	}
+}
+
+static void enc_unop_reg(ir_node const *const node, uint8_t const code,
+                         int const input)
 {
 	arch_register_t const *const out
 		= arch_get_irn_register_out(node, pn_ia32_res);
-	bemit_unop(node, code, out->encoding, input);
-}
-
-static void bemit_0f_unop_reg(ir_node const *const node, uint8_t const code,
+	enc_unop(node, code, out->encoding, input);
+}
+
+static void enc_0f_unop_reg(ir_node const *const node, uint8_t const code,
                               int const input)
 {
 	be_emit8(0x0F);
-	bemit_unop_reg(node, code, input);
-}
-
-static void bemit_bsf(ir_node const *const node)
-{
-	bemit_0f_unop_reg(node, 0xBC, n_ia32_Bsf_operand);
-}
-
-static void bemit_bsr(ir_node const *const node)
-{
-	bemit_0f_unop_reg(node, 0xBD, n_ia32_Bsr_operand);
-}
-
-static void bemit_bswap(ir_node const *const node)
+	enc_unop_reg(node, code, input);
+}
+
+static void enc_bsf(ir_node const *const node)
+{
+	enc_0f_unop_reg(node, 0xBC, n_ia32_Bsf_operand);
+}
+
+static void enc_bsr(ir_node const *const node)
+{
+	enc_0f_unop_reg(node, 0xBD, n_ia32_Bsr_operand);
+}
+
+static void enc_bswap(ir_node const *const node)
 {
 	be_emit8(0x0F);
-	bemit_modru(arch_get_irn_register_out(node, pn_ia32_Bswap_res), 1);
-}
-
-static void bemit_bt(ir_node const *const node)
+	enc_modru(arch_get_irn_register_out(node, pn_ia32_Bswap_res), 1);
+}
+
+static void enc_bt(ir_node const *const node)
 {
 	be_emit8(0x0F);
 	arch_register_t const *const lreg  = arch_get_irn_register_in(node, n_ia32_Bt_left);
@@ -2345,25 +2345,25 @@
 		ia32_immediate_attr_t const *const attr = get_ia32_immediate_attr_const(right);
 		assert(ia32_is_8bit_imm(attr));
 		be_emit8(0xBA);
-		bemit_modru(lreg, 4);
+		enc_modru(lreg, 4);
 		be_emit8(attr->imm.offset);
 	} else {
 		be_emit8(0xA3);
-		bemit_modrr(lreg, arch_get_irn_register(right));
-	}
-}
-
-static void bemit_cmovcc(const ir_node *node)
+		enc_modrr(lreg, arch_get_irn_register(right));
+	}
+}
+
+static void enc_cmovcc(const ir_node *node)
 {
 	be_emit8(0x0F);
 	ir_node       const *const val_true = get_irn_n(node, n_ia32_CMovcc_val_true);
 	x86_condition_code_t const cc       = determine_final_cc(node, n_ia32_CMovcc_eflags);
 	if (cc & x86_cc_float_parity_cases)
 		panic("cmov can't handle parity float cases");
-	bemit_binop_reg(node, 0x40 | pnc2cc(cc), val_true);
-}
-
-static void bemit_test(ir_node const *const node)
+	enc_binop_reg(node, 0x40 | pnc2cc(cc), val_true);
+}
+
+static void enc_test(ir_node const *const node)
 {
 	unsigned const size = get_mode_size_bits(get_ia32_ls_mode(node));
 	if (size == 16)
@@ -2376,72 +2376,72 @@
 		if (use_eax_short_form(node)) {
 			be_emit8(0xA8 | op);
 		} else {
-			bemit_unop(node, 0xF6, 0, n_ia32_Test_left);
-		}
-
-		bemit_imm(get_ia32_immediate_attr_const(right), size);
-	} else {
-		bemit_binop_reg(node, 0x84 | op, right);
-	}
-}
-
-static void bemit_imul(const ir_node *node)
-{
-	bemit_0f_unop_reg(node, 0xAF, n_ia32_IMul_right);
-}
-
-static void bemit_imulimm(const ir_node *node)
+			enc_unop(node, 0xF6, 0, n_ia32_Test_left);
+		}
+
+		enc_imm(get_ia32_immediate_attr_const(right), size);
+	} else {
+		enc_binop_reg(node, 0x84 | op, right);
+	}
+}
+
+static void enc_imul(const ir_node *node)
+{
+	enc_0f_unop_reg(node, 0xAF, n_ia32_IMul_right);
+}
+
+static void enc_imulimm(const ir_node *node)
 {
 	ir_node               const *const right = get_irn_n(node, n_ia32_IMul_right);
 	ia32_immediate_attr_t const *const attr  = get_ia32_immediate_attr_const(right);
 	bool                         const imm8  = ia32_is_8bit_imm(attr);
-	bemit_unop_reg(node, 0x69 | (imm8 ? OP_IMM8 : 0), n_ia32_IMul_left);
-	bemit_imm(attr, imm8 ? 8 : 32);
-}
-
-static void bemit_dec(const ir_node *node)
+	enc_unop_reg(node, 0x69 | (imm8 ? OP_IMM8 : 0), n_ia32_IMul_left);
+	enc_imm(attr, imm8 ? 8 : 32);
+}
+
+static void enc_dec(const ir_node *node)
 {
 	const arch_register_t *out = arch_get_irn_register_out(node, pn_ia32_Dec_res);
 	be_emit8(0x48 + out->encoding);
 }

-static void bemit_inc(const ir_node *node)
+static void enc_inc(const ir_node *node)
 {
 	const arch_register_t *out = arch_get_irn_register_out(node, pn_ia32_Inc_res);
 	be_emit8(0x40 + out->encoding);
 }

-static void bemit_unop_mem(ir_node const *const node, uint8_t const code,
+static void enc_unop_mem(ir_node const *const node, uint8_t const code,
                            uint8_t const ext)
 {
 	unsigned size = get_mode_size_bits(get_ia32_ls_mode(node));
 	if (size == 16)
 		be_emit8(0x66);
 	be_emit8(size == 8 ? code : code | OP_16_32);
-	bemit_mod_am(ext, node);
-}
-
-static void bemit_notmem(ir_node const *const node)
-{
-	bemit_unop_mem(node, 0xF6, 2);
-}
-
-static void bemit_negmem(ir_node const *const node)
-{
-	bemit_unop_mem(node, 0xF6, 3);
-}
-
-static void bemit_incmem(ir_node const *const node)
-{
-	bemit_unop_mem(node, 0xFE, 0);
-}
-
-static void bemit_decmem(ir_node const *const node)
-{
-	bemit_unop_mem(node, 0xFE, 1);
-}
-
-static void bemit_ldtls(const ir_node *node)
+	enc_mod_am(ext, node);
+}
+
+static void enc_notmem(ir_node const *const node)
+{
+	enc_unop_mem(node, 0xF6, 2);
+}
+
+static void enc_negmem(ir_node const *const node)
+{
+	enc_unop_mem(node, 0xF6, 3);
+}
+
+static void enc_incmem(ir_node const *const node)
+{
+	enc_unop_mem(node, 0xFE, 0);
+}
+
+static void enc_decmem(ir_node const *const node)
+{
+	enc_unop_mem(node, 0xFE, 1);
+}
+
+static void enc_ldtls(const ir_node *node)
 {
 	be_emit8(0x65); // gs:
 	arch_register_t const *const out = arch_get_irn_register_out(node, pn_ia32_LdTls_res);
@@ -2457,43 +2457,43 @@
 /**
  * Emit a Lea.
  */
-static void bemit_lea(const ir_node *node)
+static void enc_lea(const ir_node *node)
 {
 	be_emit8(0x8D);
 	arch_register_t const *const out = arch_get_irn_register_out(node, pn_ia32_Lea_res);
-	bemit_mod_am(out->encoding, node);
-}
-
-/* helper function for bemit_minus64bit */
-static void bemit_helper_neg(const arch_register_t *reg)
+	enc_mod_am(out->encoding, node);
+}
+
+/* helper function for enc_minus64bit */
+static void enc_helper_neg(const arch_register_t *reg)
 {
 	be_emit8(0xF7); // negl %reg
-	bemit_modru(reg, 3);
-}
-
-/* helper function for bemit_minus64bit */
-static void bemit_helper_sbb0(const arch_register_t *reg)
+	enc_modru(reg, 3);
+}
+
+/* helper function for enc_minus64bit */
+static void enc_helper_sbb0(const arch_register_t *reg)
 {
 	be_emit8(0x80 | OP_16_32_IMM8); // sbbl $0, %reg
-	bemit_modru(reg, 3);
+	enc_modru(reg, 3);
 	be_emit8(0);
 }

-/* helper function for bemit_minus64bit */
-static void bemit_helper_sbb(const arch_register_t *src, const arch_register_t *dst)
+/* helper function for enc_minus64bit */
+static void enc_helper_sbb(const arch_register_t *src, const arch_register_t *dst)
 {
 	be_emit8(0x1B); // sbbl %src, %dst
-	bemit_modrr(src, dst);
-}
-
-/* helper function for bemit_minus64bit */
-static void bemit_helper_zero(const arch_register_t *reg)
+	enc_modrr(src, dst);
+}
+
+/* helper function for enc_minus64bit */
+static void enc_helper_zero(const arch_register_t *reg)
 {
 	be_emit8(0x33); // xorl %reg, %reg
-	bemit_modrr(reg, reg);
-}
-
-static void bemit_minus64(const ir_node *node)
+	enc_modrr(reg, reg);
+}
+
+static void enc_minus64(const ir_node *node)
 {
 	arch_register_t const *const in_lo  = arch_get_irn_register_in(node, n_ia32_Minus64_low);
 	arch_register_t const *const in_hi  = arch_get_irn_register_in(node, n_ia32_Minus64_high);
@@ -2511,79 +2511,79 @@
 	} else if (out_lo == in_hi) {
 		if (out_hi == in_lo) {
 			/* a -> b, b -> a */
-			bemit_xchg(in_lo, in_hi);
+			enc_xchg(in_lo, in_hi);
 			goto normal_neg;
 		} else {
 			/* a -> b, b -> d */
-			bemit_mov(in_hi, out_hi);
-			bemit_mov(in_lo, out_lo);
+			enc_mov(in_hi, out_hi);
+			enc_mov(in_lo, out_lo);
 			goto normal_neg;
 		}
 	} else {
 		if (out_hi == in_lo) {
 			/* a -> c, b -> a */
-			bemit_mov(in_lo, out_lo);
+			enc_mov(in_lo, out_lo);
 			goto zero_neg;
 		} else if (out_hi == in_hi) {
 			/* a -> c, b -> b */
-			bemit_mov(in_lo, out_lo);
+			enc_mov(in_lo, out_lo);
 			goto normal_neg;
 		} else {
 			/* a -> c, b -> d */
-			bemit_mov(in_lo, out_lo);
+			enc_mov(in_lo, out_lo);
 			goto zero_neg;
 		}
 	}

 normal_neg:
-	bemit_helper_neg( out_hi);
-	bemit_helper_neg( out_lo);
-	bemit_helper_sbb0(out_hi);
+	enc_helper_neg( out_hi);
+	enc_helper_neg( out_lo);
+	enc_helper_sbb0(out_hi);
 	return;

 zero_neg:
-	bemit_helper_zero(out_hi);
-	bemit_helper_neg( out_lo);
-	bemit_helper_sbb( in_hi, out_hi);
-}
-
-static void bemit_cwtl(ir_node const *const node)
+	enc_helper_zero(out_hi);
+	enc_helper_neg( out_lo);
+	enc_helper_sbb( in_hi, out_hi);
+}
+
+static void enc_cwtl(ir_node const *const node)
 {
 	(void)node;
 	be_emit8(0x98);
 }

-static void bemit_cltd(ir_node const *const node)
+static void enc_cltd(ir_node const *const node)
 {
 	(void)node;
 	be_emit8(0x99);
 }

-static void bemit_sahf(ir_node const *const node)
+static void enc_sahf(ir_node const *const node)
 {
 	(void)node;
 	be_emit8(0x9E);
 }

-static void bemit_leave(ir_node const *const node)
+static void enc_leave(ir_node const *const node)
 {
 	(void)node;
 	be_emit8(0xC9);
 }

-static void bemit_int3(ir_node const *const node)
+static void enc_int3(ir_node const *const node)
 {
 	(void)node;
 	be_emit8(0xCC);
 }

-static void bemit_cmc(ir_node const *const node)
+static void enc_cmc(ir_node const *const node)
 {
 	(void)node;
 	be_emit8(0xF5);
 }

-static void bemit_stc(ir_node const *const node)
+static void enc_stc(ir_node const *const node)
 {
 	(void)node;
 	be_emit8(0xF9);
@@ -2592,7 +2592,7 @@
 /**
  * Emits a MOV out, [MEM].
  */
-static void bemit_load(const ir_node *node)
+static void enc_load(const ir_node *node)
 {
 	arch_register_t const *const out = arch_get_irn_register_out(node, pn_ia32_Load_res);

@@ -2604,18 +2604,18 @@
 			   as 0xA1 [offset] */
 			be_emit8(0xA1);
 			ia32_attr_t const *const attr = get_ia32_attr_const(node);
-			bemit_relocation(&attr->am_imm);
+			enc_relocation(&attr->am_imm);
 			return;
 		}
 	}
 	be_emit8(0x88 | OP_MEM_SRC | OP_16_32);
-	bemit_mod_am(out->encoding, node);
+	enc_mod_am(out->encoding, node);
 }

 /**
  * Emits a MOV [mem], in.
  */
-static void bemit_store(const ir_node *node)
+static void enc_store(const ir_node *node)
 {
 	const ir_node *value = get_irn_n(node, n_ia32_Store_val);
 	unsigned       size  = get_mode_size_bits(get_ia32_ls_mode(node));
@@ -2624,8 +2624,8 @@
 		if (size == 16)
 			be_emit8(0x66);
 		be_emit8(0xC6 | (size != 8 ? OP_16_32 : 0));
-		bemit_mod_am(0, node);
-		bemit_imm(get_ia32_immediate_attr_const(value), size);
+		enc_mod_am(0, node);
+		enc_imm(get_ia32_immediate_attr_const(value), size);
 	} else {
 		arch_register_t const *const in = arch_get_irn_register(value);

@@ -2643,7 +2643,7 @@
 					be_emit8(0xA3);
 				}
 				ia32_attr_t const *const attr = get_ia32_attr_const(node);
-				bemit_relocation(&attr->am_imm);
+				enc_relocation(&attr->am_imm);
 				return;
 			}
 		}
@@ -2651,11 +2651,11 @@
 		if (size == 16)
 			be_emit8(0x66);
 		be_emit8(0x88 | (size != 8 ? OP_16_32 : 0));
-		bemit_mod_am(in->encoding, node);
-	}
-}
-
-static void bemit_conv_i2i(const ir_node *node)
+		enc_mod_am(in->encoding, node);
+	}
+}
+
+static void enc_conv_i2i(const ir_node *node)
 {
 	/*        8 16 bit source
 	 * movzx B6 B7
@@ -2664,36 +2664,36 @@
 	unsigned       opcode       = 0xB6;
 	if (mode_is_signed(smaller_mode))           opcode |= 0x08;
 	if (get_mode_size_bits(smaller_mode) == 16) opcode |= 0x01;
-	bemit_0f_unop_reg(node, opcode, n_ia32_Conv_I2I_val);
-}
-
-static void bemit_popcnt(ir_node const *const node)
+	enc_0f_unop_reg(node, opcode, n_ia32_Conv_I2I_val);
+}
+
+static void enc_popcnt(ir_node const *const node)
 {
 	be_emit8(0xF3);
-	bemit_0f_unop_reg(node, 0xB8, n_ia32_Popcnt_operand);
+	enc_0f_unop_reg(node, 0xB8, n_ia32_Popcnt_operand);
 }

 /**
  * Emit a Push.
  */
-static void bemit_push(const ir_node *node)
+static void enc_push(const ir_node *node)
 {
 	ir_node const *const value = get_irn_n_reg(node, n_ia32_Push_val);
 	if (!value) {
 		be_emit8(0xFF);
-		bemit_mod_am(6, node);
+		enc_mod_am(6, node);
 	} else if (is_ia32_Immediate(value)) {
 		ia32_immediate_attr_t const *const attr = get_ia32_immediate_attr_const(value);
 		bool                         const imm8 = ia32_is_8bit_imm(attr);
 		be_emit8(0x68 | (imm8 ? OP_IMM8 : 0));
-		bemit_imm(attr, imm8 ? 8 : 32);
+		enc_imm(attr, imm8 ? 8 : 32);
 	} else {
 		arch_register_t const *const reg = arch_get_irn_register(value);
 		be_emit8(0x50 + reg->encoding);
 	}
 }

-static void bemit_pusheax(ir_node const *const node)
+static void enc_pusheax(ir_node const *const node)
 {
 	(void)node;
 	arch_register_t const *const reg = &ia32_registers[REG_EAX];
@@ -2703,19 +2703,19 @@
 /**
  * Emit a Pop.
  */
-static void bemit_pop(const ir_node *node)
+static void enc_pop(const ir_node *node)
 {
 	arch_register_t const *const reg = arch_get_irn_register_out(node, pn_ia32_Pop_res);
 	be_emit8(0x58 + reg->encoding);
 }

-static void bemit_popmem(const ir_node *node)
+static void enc_popmem(const ir_node *node)
 {
 	be_emit8(0x8F);
-	bemit_mod_am(0, node);
-}
-
-static void bemit_call(ir_node const *const node)
+	enc_mod_am(0, node);
+}
+
+static void enc_call(ir_node const *const node)
 {
 	ir_node *const callee = get_irn_n(node, n_ia32_Call_callee);
 	if (is_ia32_Immediate(callee)) {
@@ -2735,45 +2735,45 @@
 				.entity = imm->entity,
 				.offset = imm->offset - 4,
 			};
-			bemit_relocation(&call_imm);
-		}
-	} else {
-		bemit_unop(node, 0xFF, 2, n_ia32_Call_callee);
-	}
-}
-
-static void bemit_jmp(ir_node const *const cfop)
+			enc_relocation(&call_imm);
+		}
+	} else {
+		enc_unop(node, 0xFF, 2, n_ia32_Call_callee);
+	}
+}
+
+static void enc_jmp(ir_node const *const cfop)
 {
 	be_emit8(0xE9);
-	bemit_jmp_destination(cfop);
-}
-
-static void bemit_jump(const ir_node *node)
+	enc_jmp_destination(cfop);
+}
+
+static void enc_jump(const ir_node *node)
 {
 	ir_node *block  = get_nodes_block(node);
 	ir_node *target = be_emit_get_cfop_target(node);
 	if (fallthrough_possible(block, target))
 		return;

-	bemit_jmp(node);
-}
-
-static void bemit_jcc(x86_condition_code_t pnc, ir_node const *const cfop)
+	enc_jmp(node);
+}
+
+static void enc_jcc(x86_condition_code_t pnc, ir_node const *const cfop)
 {
 	unsigned char cc = pnc2cc(pnc);
 	be_emit8(0x0F);
 	be_emit8(0x80 + cc);
-	bemit_jmp_destination(cfop);
-}
-
-static void bemit_jp(bool odd, ir_node const *const cfop)
+	enc_jmp_destination(cfop);
+}
+
+static void enc_jp(bool odd, ir_node const *const cfop)
 {
 	be_emit8(0x0F);
 	be_emit8(0x8A + odd);
-	bemit_jmp_destination(cfop);
-}
-
-static void bemit_ia32_jcc(const ir_node *node)
+	enc_jmp_destination(cfop);
+}
+
+static void enc_ia32_jcc(const ir_node *node)
 {
 	x86_condition_code_t cc = determine_final_cc(node, n_ia32_Jcc_eflags);

@@ -2811,7 +2811,7 @@
 		/* Some floating point comparisons require a test of the parity flag,
 		 * which indicates that the result is unordered */
 		if (cc & x86_cc_negated) {
-			bemit_jp(false, proj_true);
+			enc_jp(false, proj_true);
 		} else {
 			/* we need a local label if the false proj is a fallthrough
 			 * as the falseblock might have no label emitted then */
@@ -2819,31 +2819,31 @@
 				be_emit8(0x7A);
 				be_emit8(0x06);  // jp + 6
 			} else {
-				bemit_jp(false, proj_false);
+				enc_jp(false, proj_false);
 			}
 		}
 	}
-	bemit_jcc(cc, proj_true);
+	enc_jcc(cc, proj_true);

 	/* the second Proj might be a fallthrough */
 	if (fallthrough) {
 		/* it's a fallthrough */
 	} else {
-		bemit_jmp(proj_false);
-	}
-}
-
-static void bemit_switchjmp(const ir_node *node)
+		enc_jmp(proj_false);
+	}
+}
+
+static void enc_switchjmp(const ir_node *node)
 {
 	be_emit8(0xFF); // jmp *tbl.label(,%in,4)
-	bemit_mod_am(0x05, node);
+	enc_mod_am(0x05, node);

 	ia32_switch_attr_t const *const attr = get_ia32_switch_attr_const(node);
 	be_emit_jump_table(node, attr->table, attr->table_entity, mode_P,
 	                   emit_jumptable_target);
 }

-static void bemit_return(const ir_node *node)
+static void enc_return(const ir_node *node)
 {
 	const ia32_return_attr_t *attr = get_ia32_return_attr_const(node);
 	unsigned pop = attr->pop;
@@ -2855,16 +2855,16 @@
 	}
 }

-static void bemit_subsp(const ir_node *node)
+static void enc_subsp(const ir_node *node)
 {
 	/* sub %in, %esp */
-	bemit_sub(node);
+	enc_sub(node);
 	/* mov %esp, %out */
 	arch_register_t const *const out = arch_get_irn_register_out(node, pn_ia32_SubSP_addr);
-	bemit_mov(&ia32_registers[REG_ESP], out);
-}
-
-static void bemit_incsp(const ir_node *node)
+	enc_mov(&ia32_registers[REG_ESP], out);
+}
+
+static void enc_incsp(const ir_node *node)
 {
 	int offs = be_get_IncSP_offset(node);
 	if (offs == 0)
@@ -2882,7 +2882,7 @@
 	be_emit8(0x80 | OP_16_32 | (imm8b ? OP_IMM8 : 0));

 	const arch_register_t *reg  = arch_get_irn_register_out(node, 0);
-	bemit_modru(reg, ext);
+	enc_modru(reg, ext);

 	if (imm8b) {
 		be_emit8(offs);
@@ -2891,7 +2891,7 @@
 	}
 }

-static void bemit_copybi(const ir_node *node)
+static void enc_copybi(const ir_node *node)
 {
 	unsigned size = get_ia32_copyb_size(node);
 	if (size & 1)
@@ -2906,7 +2906,7 @@
 	}
 }

-static void bemit_fbinop(ir_node const *const node, unsigned const op_fwd, unsigned const op_rev)
+static void enc_fbinop(ir_node const *const node, unsigned const op_fwd, unsigned const op_rev)
 {
 	ia32_x87_attr_t const *const attr = get_ia32_x87_attr_const(node);
 	x87_attr_t      const *const x87  = &attr->x87;
@@ -2919,68 +2919,68 @@
 		if (x87->pop)        op0 |= 0x02;
 		be_emit8(op0);

-		bemit_modru(attr->x87.reg, op);
+		enc_modru(attr->x87.reg, op);
 	} else {
 		assert(!x87->reg);
 		assert(!x87->pop);

 		unsigned const size = get_mode_size_bits(get_ia32_ls_mode(node));
 		be_emit8(size == 32 ? 0xD8 : 0xDC);
-		bemit_mod_am(op, node);
-	}
-}
-
-static void bemit_fop_reg(ir_node const *const node, unsigned char const op0, unsigned char const op1)
+		enc_mod_am(op, node);
+	}
+}
+
+static void enc_fop_reg(ir_node const *const node, unsigned char const op0, unsigned char const op1)
 {
 	be_emit8(op0);
 	be_emit8(op1 + get_ia32_x87_attr_const(node)->x87.reg->encoding);
 }

-static void bemit_fabs(const ir_node *node)
+static void enc_fabs(const ir_node *node)
 {
 	(void)node;
 	be_emit8(0xD9);
 	be_emit8(0xE1);
 }

-static void bemit_fadd(const ir_node *node)
-{
-	bemit_fbinop(node, 0, 0);
-}
-
-static void bemit_fchs(const ir_node *node)
+static void enc_fadd(const ir_node *node)
+{
+	enc_fbinop(node, 0, 0);
+}
+
+static void enc_fchs(const ir_node *node)
 {
 	(void)node;
 	be_emit8(0xD9);
 	be_emit8(0xE0);
 }

-static void bemit_fdiv(const ir_node *node)
-{
-	bemit_fbinop(node, 6, 7);
-}
-
-static void bemit_ffreep(ir_node const *const node)
-{
-	bemit_fop_reg(node, 0xDF, 0xC0);
-}
-
-static void bemit_fild(const ir_node *node)
+static void enc_fdiv(const ir_node *node)
+{
+	enc_fbinop(node, 6, 7);
+}
+
+static void enc_ffreep(ir_node const *const node)
+{
+	enc_fop_reg(node, 0xDF, 0xC0);
+}
+
+static void enc_fild(const ir_node *node)
 {
 	switch (get_mode_size_bits(get_ia32_ls_mode(node))) {
 	case 16:
 		be_emit8(0xDF); // filds
-		bemit_mod_am(0, node);
+		enc_mod_am(0, node);
 		return;

 	case 32:
 		be_emit8(0xDB); // fildl
-		bemit_mod_am(0, node);
+		enc_mod_am(0, node);
 		return;

 	case 64:
 		be_emit8(0xDF); // fildll
-		bemit_mod_am(5, node);
+		enc_mod_am(5, node);
 		return;

 	default:
@@ -2988,7 +2988,7 @@
 	}
 }

-static void bemit_fist(const ir_node *node)
+static void enc_fist(const ir_node *node)
 {
 	unsigned       op;
 	unsigned const size = get_mode_size_bits(get_ia32_ls_mode(node));
@@ -3002,10 +3002,10 @@
 		++op;
 	// There is only a pop variant for 64 bit integer store.
 	assert(size < 64 || get_ia32_x87_attr_const(node)->x87.pop);
-	bemit_mod_am(op, node);
-}
-
-static void bemit_fisttp(ir_node const *const node)
+	enc_mod_am(op, node);
+}
+
+static void enc_fisttp(ir_node const *const node)
 {
 	switch (get_mode_size_bits(get_ia32_ls_mode(node))) {
 	case 16: be_emit8(0xDF); break; // fisttps
@@ -3013,26 +3013,26 @@
 	case 64: be_emit8(0xDD); break; // fisttpll
 	default: panic("invalid mode size");
 	}
-	bemit_mod_am(1, node);
-}
-
-static void bemit_fld(const ir_node *node)
+	enc_mod_am(1, node);
+}
+
+static void enc_fld(const ir_node *node)
 {
 	switch (get_mode_size_bits(get_ia32_ls_mode(node))) {
 	case 32:
 		be_emit8(0xD9); // flds
-		bemit_mod_am(0, node);
+		enc_mod_am(0, node);
 		return;

 	case 64:
 		be_emit8(0xDD); // fldl
-		bemit_mod_am(0, node);
+		enc_mod_am(0, node);
 		return;

 	case 80:
 	case 96:
 		be_emit8(0xDB); // fldt
-		bemit_mod_am(5, node);
+		enc_mod_am(5, node);
 		return;

 	default:
@@ -3040,42 +3040,42 @@
 	}
 }

-static void bemit_fld1(const ir_node *node)
+static void enc_fld1(const ir_node *node)
 {
 	(void)node;
 	be_emit8(0xD9);
 	be_emit8(0xE8); // fld1
 }

-static void bemit_fldcw(const ir_node *node)
+static void enc_fldcw(const ir_node *node)
 {
 	be_emit8(0xD9); // fldcw
-	bemit_mod_am(5, node);
-}
-
-static void bemit_fldz(const ir_node *node)
+	enc_mod_am(5, node);
+}
+
+static void enc_fldz(const ir_node *node)
 {
 	(void)node;
 	be_emit8(0xD9);
 	be_emit8(0xEE); // fldz
 }

-static void bemit_fmul(const ir_node *node)
-{
-	bemit_fbinop(node, 1, 1);
-}
-
-static void bemit_fpop(const ir_node *node)
-{
-	bemit_fop_reg(node, 0xDD, 0xD8);
-}
-
-static void bemit_fdup(const ir_node *node)
-{
-	bemit_fop_reg(node, 0xD9, 0xC0);
-}
-
-static void bemit_fst(const ir_node *node)
+static void enc_fmul(const ir_node *node)
+{
+	enc_fbinop(node, 1, 1);
+}
+
+static void enc_fpop(const ir_node *node)
+{
+	enc_fop_reg(node, 0xDD, 0xD8);
+}
+
+static void enc_fdup(const ir_node *node)
+{
+	enc_fop_reg(node, 0xD9, 0xC0);
+}
+
+static void enc_fst(const ir_node *node)
 {
 	unsigned       op;
 	unsigned const size = get_mode_size_bits(get_ia32_ls_mode(node));
@@ -3090,60 +3090,60 @@
 		++op;
 	// There is only a pop variant for long double store.
 	assert(size < 80 || get_ia32_x87_attr_const(node)->x87.pop);
-	bemit_mod_am(op, node);
-}
-
-static void bemit_fsub(const ir_node *node)
-{
-	bemit_fbinop(node, 4, 5);
-}
-
-static void bemit_fnstcw(const ir_node *node)
+	enc_mod_am(op, node);
+}
+
+static void enc_fsub(const ir_node *node)
+{
+	enc_fbinop(node, 4, 5);
+}
+
+static void enc_fnstcw(const ir_node *node)
 {
 	be_emit8(0xD9); // fnstcw
-	bemit_mod_am(7, node);
-}
-
-static void bemit_fnstsw(void)
+	enc_mod_am(7, node);
+}
+
+static void enc_fnstsw(void)
 {
 	be_emit8(0xDF); // fnstsw %ax
 	be_emit8(0xE0);
 }

-static void bemit_ftstfnstsw(const ir_node *node)
+static void enc_ftstfnstsw(const ir_node *node)
 {
 	(void)node;
 	be_emit8(0xD9); // ftst
 	be_emit8(0xE4);
-	bemit_fnstsw();
-}
-
-static void bemit_fucomi(const ir_node *node)
+	enc_fnstsw();
+}
+
+static void enc_fucomi(const ir_node *node)
 {
 	const ia32_x87_attr_t *attr = get_ia32_x87_attr_const(node);
 	be_emit8(attr->x87.pop ? 0xDF : 0xDB); // fucom[p]i
 	be_emit8(0xE8 + attr->x87.reg->encoding);
 }

-static void bemit_fucomfnstsw(const ir_node *node)
+static void enc_fucomfnstsw(const ir_node *node)
 {
 	const ia32_x87_attr_t *attr = get_ia32_x87_attr_const(node);
 	be_emit8(0xDD); // fucom[p]
 	be_emit8((attr->x87.pop ? 0xE8 : 0xE0) + attr->x87.reg->encoding);
-	bemit_fnstsw();
-}
-
-static void bemit_fucomppfnstsw(const ir_node *node)
+	enc_fnstsw();
+}
+
+static void enc_fucomppfnstsw(const ir_node *node)
 {
 	(void)node;
 	be_emit8(0xDA); // fucompp
 	be_emit8(0xE9);
-	bemit_fnstsw();
-}
-
-static void bemit_fxch(const ir_node *node)
-{
-	bemit_fop_reg(node, 0xD9, 0xC8);
+	enc_fnstsw();
+}
+
+static void enc_fxch(const ir_node *node)
+{
+	enc_fop_reg(node, 0xD9, 0xC8);
 }

 static void ia32_register_binary_emitters(void)
@@ -3152,108 +3152,108 @@

 	/* benode emitter */
 	be_set_emitter(op_be_Asm,             emit_ia32_Asm); // TODO implement binary emitter
-	be_set_emitter(op_be_Copy,            bemit_copy);
-	be_set_emitter(op_be_CopyKeep,        bemit_copy);
-	be_set_emitter(op_be_IncSP,           bemit_incsp);
-	be_set_emitter(op_be_Perm,            bemit_perm);
-	be_set_emitter(op_ia32_Return,        bemit_return);
-	be_set_emitter(op_ia32_Adc,           bemit_adc);
-	be_set_emitter(op_ia32_Add,           bemit_add);
-	be_set_emitter(op_ia32_AddMem,        bemit_addmem);
-	be_set_emitter(op_ia32_And,           bemit_and);
-	be_set_emitter(op_ia32_AndMem,        bemit_andmem);
-	be_set_emitter(op_ia32_Breakpoint,    bemit_int3);
-	be_set_emitter(op_ia32_Bsf,           bemit_bsf);
-	be_set_emitter(op_ia32_Bsr,           bemit_bsr);
-	be_set_emitter(op_ia32_Bswap,         bemit_bswap);
-	be_set_emitter(op_ia32_Bt,            bemit_bt);
-	be_set_emitter(op_ia32_CMovcc,        bemit_cmovcc);
-	be_set_emitter(op_ia32_Call,          bemit_call);
-	be_set_emitter(op_ia32_Cltd,          bemit_cltd);
-	be_set_emitter(op_ia32_Cmc,           bemit_cmc);
-	be_set_emitter(op_ia32_Cmp,           bemit_cmp);
-	be_set_emitter(op_ia32_Const,         bemit_mov_const);
-	be_set_emitter(op_ia32_Conv_I2I,      bemit_conv_i2i);
-	be_set_emitter(op_ia32_CopyB_i,       bemit_copybi);
-	be_set_emitter(op_ia32_Cwtl,          bemit_cwtl);
-	be_set_emitter(op_ia32_Dec,           bemit_dec);
-	be_set_emitter(op_ia32_DecMem,        bemit_decmem);
-	be_set_emitter(op_ia32_Div,           bemit_div);
-	be_set_emitter(op_ia32_FldCW,         bemit_fldcw);
-	be_set_emitter(op_ia32_FnstCW,        bemit_fnstcw);
-	be_set_emitter(op_ia32_FtstFnstsw,    bemit_ftstfnstsw);
-	be_set_emitter(op_ia32_FucomFnstsw,   bemit_fucomfnstsw);
-	be_set_emitter(op_ia32_Fucomi,        bemit_fucomi);
-	be_set_emitter(op_ia32_FucomppFnstsw, bemit_fucomppfnstsw);
-	be_set_emitter(op_ia32_IDiv,          bemit_idiv);
-	be_set_emitter(op_ia32_IJmp,          bemit_ijmp);
-	be_set_emitter(op_ia32_IMul,          bemit_imul);
-	be_set_emitter(op_ia32_IMul1OP,       bemit_imul1op);
-	be_set_emitter(op_ia32_IMulImm,       bemit_imulimm);
-	be_set_emitter(op_ia32_Inc,           bemit_inc);
-	be_set_emitter(op_ia32_IncMem,        bemit_incmem);
-	be_set_emitter(op_ia32_Jcc,           bemit_ia32_jcc);
-	be_set_emitter(op_ia32_Jmp,           bemit_jump);
-	be_set_emitter(op_ia32_LdTls,         bemit_ldtls);
-	be_set_emitter(op_ia32_Lea,           bemit_lea);
-	be_set_emitter(op_ia32_Leave,         bemit_leave);
-	be_set_emitter(op_ia32_Load,          bemit_load);
-	be_set_emitter(op_ia32_Minus64,       bemit_minus64);
-	be_set_emitter(op_ia32_Mul,           bemit_mul);
-	be_set_emitter(op_ia32_Neg,           bemit_neg);
-	be_set_emitter(op_ia32_NegMem,        bemit_negmem);
-	be_set_emitter(op_ia32_Not,           bemit_not);
-	be_set_emitter(op_ia32_NotMem,        bemit_notmem);
-	be_set_emitter(op_ia32_Or,            bemit_or);
-	be_set_emitter(op_ia32_OrMem,         bemit_ormem);
-	be_set_emitter(op_ia32_Pop,           bemit_pop);
-	be_set_emitter(op_ia32_PopMem,        bemit_popmem);
-	be_set_emitter(op_ia32_Popcnt,        bemit_popcnt);
-	be_set_emitter(op_ia32_Push,          bemit_push);
-	be_set_emitter(op_ia32_PushEax,       bemit_pusheax);
-	be_set_emitter(op_ia32_Rol,           bemit_rol);
-	be_set_emitter(op_ia32_RolMem,        bemit_rolmem);
-	be_set_emitter(op_ia32_Ror,           bemit_ror);
-	be_set_emitter(op_ia32_RorMem,        bemit_rormem);
-	be_set_emitter(op_ia32_Sahf,          bemit_sahf);
-	be_set_emitter(op_ia32_Sar,           bemit_sar);
-	be_set_emitter(op_ia32_SarMem,        bemit_sarmem);
-	be_set_emitter(op_ia32_Sbb,           bemit_sbb);
-	be_set_emitter(op_ia32_Sbb0,          bemit_sbb0);
-	be_set_emitter(op_ia32_Setcc,         bemit_setcc);
-	be_set_emitter(op_ia32_Shl,           bemit_shl);
-	be_set_emitter(op_ia32_ShlD,          bemit_shld);
-	be_set_emitter(op_ia32_ShlMem,        bemit_shlmem);
-	be_set_emitter(op_ia32_Shr,           bemit_shr);
-	be_set_emitter(op_ia32_ShrD,          bemit_shrd);
-	be_set_emitter(op_ia32_ShrMem,        bemit_shrmem);
-	be_set_emitter(op_ia32_Stc,           bemit_stc);
-	be_set_emitter(op_ia32_Store,         bemit_store);
-	be_set_emitter(op_ia32_Sub,           bemit_sub);
-	be_set_emitter(op_ia32_SubMem,        bemit_submem);
-	be_set_emitter(op_ia32_SubSP,         bemit_subsp);
-	be_set_emitter(op_ia32_SwitchJmp,     bemit_switchjmp);
-	be_set_emitter(op_ia32_Test,          bemit_test);
-	be_set_emitter(op_ia32_Xor,           bemit_xor);
-	be_set_emitter(op_ia32_Xor0,          bemit_xor0);
-	be_set_emitter(op_ia32_XorMem,        bemit_xormem);
-	be_set_emitter(op_ia32_fabs,          bemit_fabs);
-	be_set_emitter(op_ia32_fadd,          bemit_fadd);
-	be_set_emitter(op_ia32_fchs,          bemit_fchs);
-	be_set_emitter(op_ia32_fdiv,          bemit_fdiv);
-	be_set_emitter(op_ia32_ffreep,        bemit_ffreep);
-	be_set_emitter(op_ia32_fild,          bemit_fild);
-	be_set_emitter(op_ia32_fist,          bemit_fist);
-	be_set_emitter(op_ia32_fisttp,        bemit_fisttp);
-	be_set_emitter(op_ia32_fld,           bemit_fld);
-	be_set_emitter(op_ia32_fld1,          bemit_fld1);
-	be_set_emitter(op_ia32_fldz,          bemit_fldz);
-	be_set_emitter(op_ia32_fmul,          bemit_fmul);
-	be_set_emitter(op_ia32_fpop,          bemit_fpop);
-	be_set_emitter(op_ia32_fdup,          bemit_fdup);
-	be_set_emitter(op_ia32_fst,           bemit_fst);
-	be_set_emitter(op_ia32_fsub,          bemit_fsub);
-	be_set_emitter(op_ia32_fxch,          bemit_fxch);
+	be_set_emitter(op_be_Copy,            enc_copy);
+	be_set_emitter(op_be_CopyKeep,        enc_copy);
+	be_set_emitter(op_be_IncSP,           enc_incsp);
+	be_set_emitter(op_be_Perm,            enc_perm);
+	be_set_emitter(op_ia32_Return,        enc_return);
+	be_set_emitter(op_ia32_Adc,           enc_adc);
+	be_set_emitter(op_ia32_Add,           enc_add);
+	be_set_emitter(op_ia32_AddMem,        enc_addmem);
+	be_set_emitter(op_ia32_And,           enc_and);
+	be_set_emitter(op_ia32_AndMem,        enc_andmem);
+	be_set_emitter(op_ia32_Breakpoint,    enc_int3);
+	be_set_emitter(op_ia32_Bsf,           enc_bsf);
+	be_set_emitter(op_ia32_Bsr,           enc_bsr);
+	be_set_emitter(op_ia32_Bswap,         enc_bswap);
+	be_set_emitter(op_ia32_Bt,            enc_bt);
+	be_set_emitter(op_ia32_CMovcc,        enc_cmovcc);
+	be_set_emitter(op_ia32_Call,          enc_call);
+	be_set_emitter(op_ia32_Cltd,          enc_cltd);
+	be_set_emitter(op_ia32_Cmc,           enc_cmc);
+	be_set_emitter(op_ia32_Cmp,           enc_cmp);
+	be_set_emitter(op_ia32_Const,         enc_mov_const);
+	be_set_emitter(op_ia32_Conv_I2I,      enc_conv_i2i);
+	be_set_emitter(op_ia32_CopyB_i,       enc_copybi);
+	be_set_emitter(op_ia32_Cwtl,          enc_cwtl);
+	be_set_emitter(op_ia32_Dec,           enc_dec);
+	be_set_emitter(op_ia32_DecMem,        enc_decmem);
+	be_set_emitter(op_ia32_Div,           enc_div);
+	be_set_emitter(op_ia32_FldCW,         enc_fldcw);
+	be_set_emitter(op_ia32_FnstCW,        enc_fnstcw);
+	be_set_emitter(op_ia32_FtstFnstsw,    enc_ftstfnstsw);
+	be_set_emitter(op_ia32_FucomFnstsw,   enc_fucomfnstsw);
+	be_set_emitter(op_ia32_Fucomi,        enc_fucomi);
+	be_set_emitter(op_ia32_FucomppFnstsw, enc_fucomppfnstsw);
+	be_set_emitter(op_ia32_IDiv,          enc_idiv);
+	be_set_emitter(op_ia32_IJmp,          enc_ijmp);
+	be_set_emitter(op_ia32_IMul,          enc_imul);
+	be_set_emitter(op_ia32_IMul1OP,       enc_imul1op);
+	be_set_emitter(op_ia32_IMulImm,       enc_imulimm);
+	be_set_emitter(op_ia32_Inc,           enc_inc);
+	be_set_emitter(op_ia32_IncMem,        enc_incmem);
+	be_set_emitter(op_ia32_Jcc,           enc_ia32_jcc);
+	be_set_emitter(op_ia32_Jmp,           enc_jump);
+	be_set_emitter(op_ia32_LdTls,         enc_ldtls);
+	be_set_emitter(op_ia32_Lea,           enc_lea);
+	be_set_emitter(op_ia32_Leave,         enc_leave);
+	be_set_emitter(op_ia32_Load,          enc_load);
+	be_set_emitter(op_ia32_Minus64,       enc_minus64);
+	be_set_emitter(op_ia32_Mul,           enc_mul);
+	be_set_emitter(op_ia32_Neg,           enc_neg);
+	be_set_emitter(op_ia32_NegMem,        enc_negmem);
+	be_set_emitter(op_ia32_Not,           enc_not);
+	be_set_emitter(op_ia32_NotMem,        enc_notmem);
+	be_set_emitter(op_ia32_Or,            enc_or);
+	be_set_emitter(op_ia32_OrMem,         enc_ormem);
+	be_set_emitter(op_ia32_Pop,           enc_pop);
+	be_set_emitter(op_ia32_PopMem,        enc_popmem);
+	be_set_emitter(op_ia32_Popcnt,        enc_popcnt);
+	be_set_emitter(op_ia32_Push,          enc_push);
+	be_set_emitter(op_ia32_PushEax,       enc_pusheax);
+	be_set_emitter(op_ia32_Rol,           enc_rol);
+	be_set_emitter(op_ia32_RolMem,        enc_rolmem);
+	be_set_emitter(op_ia32_Ror,           enc_ror);
+	be_set_emitter(op_ia32_RorMem,        enc_rormem);
+	be_set_emitter(op_ia32_Sahf,          enc_sahf);
+	be_set_emitter(op_ia32_Sar,           enc_sar);
+	be_set_emitter(op_ia32_SarMem,        enc_sarmem);
+	be_set_emitter(op_ia32_Sbb,           enc_sbb);
+	be_set_emitter(op_ia32_Sbb0,          enc_sbb0);
+	be_set_emitter(op_ia32_Setcc,         enc_setcc);
+	be_set_emitter(op_ia32_Shl,           enc_shl);
+	be_set_emitter(op_ia32_ShlD,          enc_shld);
+	be_set_emitter(op_ia32_ShlMem,        enc_shlmem);
+	be_set_emitter(op_ia32_Shr,           enc_shr);
+	be_set_emitter(op_ia32_ShrD,          enc_shrd);
+	be_set_emitter(op_ia32_ShrMem,        enc_shrmem);
+	be_set_emitter(op_ia32_Stc,           enc_stc);
+	be_set_emitter(op_ia32_Store,         enc_store);
+	be_set_emitter(op_ia32_Sub,           enc_sub);
+	be_set_emitter(op_ia32_SubMem,        enc_submem);
+	be_set_emitter(op_ia32_SubSP,         enc_subsp);
+	be_set_emitter(op_ia32_SwitchJmp,     enc_switchjmp);
+	be_set_emitter(op_ia32_Test,          enc_test);
+	be_set_emitter(op_ia32_Xor,           enc_xor);
+	be_set_emitter(op_ia32_Xor0,          enc_xor0);
+	be_set_emitter(op_ia32_XorMem,        enc_xormem);
+	be_set_emitter(op_ia32_fabs,          enc_fabs);
+	be_set_emitter(op_ia32_fadd,          enc_fadd);
+	be_set_emitter(op_ia32_fchs,          enc_fchs);
+	be_set_emitter(op_ia32_fdiv,          enc_fdiv);
+	be_set_emitter(op_ia32_ffreep,        enc_ffreep);
+	be_set_emitter(op_ia32_fild,          enc_fild);
+	be_set_emitter(op_ia32_fist,          enc_fist);
+	be_set_emitter(op_ia32_fisttp,        enc_fisttp);
+	be_set_emitter(op_ia32_fld,           enc_fld);
+	be_set_emitter(op_ia32_fld1,          enc_fld1);
+	be_set_emitter(op_ia32_fldz,          enc_fldz);
+	be_set_emitter(op_ia32_fmul,          enc_fmul);
+	be_set_emitter(op_ia32_fpop,          enc_fpop);
+	be_set_emitter(op_ia32_fdup,          enc_fdup);
+	be_set_emitter(op_ia32_fst,           enc_fst);
+	be_set_emitter(op_ia32_fsub,          enc_fsub);
+	be_set_emitter(op_ia32_fxch,          enc_fxch);
 }

 static void assign_block_fragment_num(ir_node *const block, unsigned const num)
@@ -3349,7 +3349,7 @@
 	return res;
 }

-static void bemit_nop_callback(char *buffer, unsigned size)
+static void enc_nop_callback(char *buffer, unsigned size)
 {
 	memset(buffer, 0, size);
 	while (size > 0) {
@@ -3386,10 +3386,10 @@
 	}
 }

-static unsigned bemit_relocation_callback(char *const buffer,
-                                          uint8_t const be_kind,
-                                          ir_entity *const entity,
-                                          int32_t const offset)
+static unsigned enc_relocation_callback(char *const buffer,
+                                        uint8_t const be_kind,
+                                        ir_entity *const entity,
+                                        int32_t const offset)
 {
 	if (be_kind == BEMIT_RELOCATION_RELJUMP) {
 		int32_t *dest = (int32_t*)buffer;
@@ -3413,8 +3413,8 @@
 void ia32_emit_jit_function(char *buffer, ir_jit_function_t *const function)
 {
 	static const be_jit_emit_interface_t jit_emit_interface = {
-		.nops       = bemit_nop_callback,
-		.relocation = bemit_relocation_callback,
+		.nops       = enc_nop_callback,
+		.relocation = enc_relocation_callback,
 	};
 	be_jit_emit_memory(buffer, function, &jit_emit_interface);
 }


ia32: Remove unused single byte instruction emitters.

--- ir/be/ia32/ia32_emitter.c
+++ ir/be/ia32/ia32_emitter.c
@@ -2617,27 +2617,13 @@
 	bemit8(code);                               \
 }

-//EMIT_SINGLEOP(daa,  0x27)
-//EMIT_SINGLEOP(das,  0x2F)
-//EMIT_SINGLEOP(aaa,  0x37)
-//EMIT_SINGLEOP(aas,  0x3F)
-//EMIT_SINGLEOP(nop,  0x90)
 EMIT_SINGLEOP(cwtl,  0x98)
 EMIT_SINGLEOP(cltd,  0x99)
-//EMIT_SINGLEOP(fwait, 0x9B)
 EMIT_SINGLEOP(sahf,  0x9E)
-//EMIT_SINGLEOP(popf, 0x9D)
 EMIT_SINGLEOP(leave, 0xC9)
 EMIT_SINGLEOP(int3,  0xCC)
-//EMIT_SINGLEOP(iret, 0xCF)
-//EMIT_SINGLEOP(xlat, 0xD7)
-//EMIT_SINGLEOP(lock, 0xF0)
-//EMIT_SINGLEOP(halt, 0xF4)
 EMIT_SINGLEOP(cmc,   0xF5)
 EMIT_SINGLEOP(stc,   0xF9)
-//EMIT_SINGLEOP(cli,  0xFA)
-//EMIT_SINGLEOP(sti,  0xFB)
-//EMIT_SINGLEOP(std,  0xFD)

 /**
  * Emits a MOV out, [MEM].


Minor aesthetic change to random/detail/mod.h

--- thrust/random/detail/mod.h
+++ thrust/random/detail/mod.h
@@ -25,7 +25,7 @@
 namespace detail
 {

-template<typename T, T a, T c, T m, bool>
+template<typename T, T a, T c, T m, bool = (m == 0)>
   struct static_mod
 {
   static const T q = m / a;
@@ -85,7 +85,7 @@
 __host__ __device__
   T mod(T x)
 {
-  static_mod<T,a,c,m, m == 0> f;
+  static_mod<T,a,c,m> f;
   return f(x);
 }; // end static_mod


qemu: Properly report error on uuid mismatch in the migration cookie

Add the missing jump to the error label when the uuid in the
migration cookie XML does not match the uuid of the migrated
domain.

Signed-off-by: Luyao Huang <23d9981432efa88691fd2a71f5525bc2174f7664@redhat.com>
Signed-off-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

--- src/qemu/qemu_migration.c
+++ src/qemu/qemu_migration.c
@@ -1147,6 +1147,7 @@
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Incoming cookie data had unexpected UUID %s vs %s"),
                        tmp, uuidstr);
+        goto error;
     }
     VIR_FREE(tmp);


Do it like GCC: write #APP #NO_APP around inline assembler.

[r21304]

--- ir/be/ia32/ia32_emitter.c
+++ ir/be/ia32/ia32_emitter.c
@@ -1329,7 +1329,7 @@
 	ident                 *asm_text = attr->asm_text;
 	const char            *s        = get_id_str(asm_text);

-	be_emit_cstring("# Begin ASM \t");
+	be_emit_cstring("#APP\t");
 	be_emit_finish_line_gas(node);

 	if (s[0] != '\t')
@@ -1348,7 +1348,7 @@
 	be_emit_char('\n');
 	be_emit_write_line();

-	be_emit_cstring("# End ASM\n");
+	be_emit_cstring("#NO_APP\n");
 	be_emit_write_line();
 }


Fix performance issue with non-matching rules when no callback is provided.

As pointed out by Arnim Rupp (@2d4d) in #172, the fix in #175 was not complete as there's was no performance gain when the callback was not provided, which is the most common case.

--- yara-python.c
+++ yara-python.c
@@ -789,12 +789,6 @@

   int which = ((CALLBACK_DATA*) user_data)->which;

-  // If the rule doesn't match and the user has not specified that they want to
-  // see non-matches then nothing to do here.
-  if (message == CALLBACK_MSG_RULE_NOT_MATCHING && callback != NULL &&
-      (which & CALLBACK_NON_MATCHES) != CALLBACK_NON_MATCHES)
-    return CALLBACK_CONTINUE;
-
   switch(message)
   {
   case CALLBACK_MSG_IMPORT_MODULE:
@@ -808,6 +802,14 @@

   case CALLBACK_MSG_SCAN_FINISHED:
     return CALLBACK_CONTINUE;
+
+  case CALLBACK_MSG_RULE_NOT_MATCHING:
+    // If the rule doesn't match and the user has not specified that they want
+    // to see non-matches then there's nothing more to do and we return
+    // CALLBACK_CONTINUE, keep executing the function if otherwise.
+
+    if ((which & CALLBACK_NON_MATCHES) != CALLBACK_NON_MATCHES)
+      return CALLBACK_CONTINUE;
   }

   // At this point we have handled all the other cases of when this callback


qemu: Don't report false errors in migration protocol v2

Finish is the final state in v2 of our migration protocol. If something
fails, we have no option to abort the migration and resume the original
domain. Non fatal errors (such as failure to start guest CPUs or make
the domain persistent) has to be treated as success. Keeping the domain
running while reporting the failure was just asking for trouble.

Signed-off-by: Jiri Denemark <62bdf77dc47919a4d59a91822129d14633cfca81@redhat.com>

--- src/qemu/qemu_migration.c
+++ src/qemu/qemu_migration.c
@@ -5624,7 +5624,6 @@
     qemuDomainObjPrivatePtr priv = vm->privateData;
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
     unsigned short port;
-    bool keep = false;

     VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
               "cookieout=%p, cookieoutlen=%p, flags=%lx, retcode=%d",
@@ -5700,17 +5699,14 @@
                  * other hand, if we report failure, then the management tools
                  * might try to restart the domain on the source side, even
                  * though the domain is actually running on the destination.
-                 * Return a NULL dom pointer, and hope that this is a rare
-                 * situation and management tools are smart.
-                 */
-
-                /*
+                 * Pretend success and hope that this is a rare situation and
+                 * management tools are smart.
+                 *
                  * However, in v3 protocol, the source VM is still available
                  * to restart during confirm() step, so we kill it off now.
                  */
-                if (!v3proto)
-                    keep = true;
-                goto endjob;
+                if (v3proto)
+                    goto endjob;
             }
         }

@@ -5738,9 +5734,8 @@
                  * target in paused state, in case admin can fix
                  * things up
                  */
-                if (!v3proto)
-                    keep = true;
-                goto endjob;
+                if (v3proto)
+                    goto endjob;
             }
             if (priv->job.completed) {
                 qemuDomainJobInfoUpdateTime(priv->job.completed);
@@ -5781,7 +5776,7 @@
     }

  endjob:
-    if (!dom && !keep &&
+    if (!dom &&
         !(flags & VIR_MIGRATE_OFFLINE) &&
         virDomainObjIsActive(vm)) {
         qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,


change soReSign() to handle addition of signatures

--- checksig.h
+++ checksig.h
@@ -3,6 +3,9 @@

 int doCheckSig(int pgp, char **argv);

-int doReSign(char *passPhrase, char **argv);
+int doReSign(int add, char *passPhrase, char **argv);
+
+#define ADD_SIGNATURE 1
+#define NEW_SIGNATURE 0

 #endif


git-svn-id: http://seatest.googlecode.com/svn/trunk@30 c8fdfc7a-b1b0-2da2-59b2-95209285a470

--- src/seatest.c
+++ src/seatest.c
@@ -41,6 +41,7 @@
 static int seatest_machine_readable = 0;
 static char* seatest_current_fixture;
 static char* seatest_current_fixture_path;
+static char seatest_magic_marker[20] = "";

 static seatest_void_void seatest_suite_setup_func = 0;
 static seatest_void_void seatest_suite_teardown_func = 0;
@@ -107,7 +108,7 @@
 	{
 		if(seatest_machine_readable)
 		{
-			printf("%s,%s,%u,%s\r\n", seatest_current_fixture_path, function, line, reason );
+			printf("%s%s,%s,%u,%s\r\n", seatest_magic_marker, seatest_current_fixture_path, function, line, reason );
 		}
 		else
 		{
@@ -121,7 +122,7 @@
 		{
 			if(seatest_machine_readable)
 			{
-				printf("%s,%s,%u,Passed\r\n", seatest_current_fixture_path, function, line );
+				printf("%s%s,%s,%u,Passed\r\n", seatest_magic_marker, seatest_current_fixture_path, function, line );
 			}
 			else
 			{
@@ -263,6 +264,12 @@
 	seatest_test_filter = filter;
 }

+void set_magic_marker(char* marker)
+{
+	if(marker == NULL) return;
+	strcpy(seatest_magic_marker, marker);
+}
+
 void seatest_display_test(char* fixture_name, char* test_name)
 {
 	if(test_name == NULL) return;
@@ -322,15 +329,18 @@

 void seatest_show_help( void )
 {
-	printf("Usage: [-t <testname>] [-f <fixturename>] [-d] [help] [-v] [-m]\r\n");
+	printf("Usage: [-t <testname>] [-f <fixturename>] [-d] [help] [-v] [-m] [-k <marker>\r\n");
 	printf("Flags:\r\n");
 	printf("\thelp:\twill display this help\r\n");
 	printf("\t-t:\twill only run tests that match <testname>\r\n");
 	printf("\t-f:\twill only run fixtures that match <fixturename>\r\n");
-	printf("\t-d:\twill just display test names and fixtures without running the test\r\n");
+	printf("\t-d:\twill just display test names and fixtures without\r\n");
+	printf("\t-d:\trunning the test\r\n");
 	printf("\t-v:\twill print a more verbose version of the test run\r\n");
 	printf("\t-m:\twill print a machine readable format of the test run, ie :- \r\n");
 	printf("\t   \t<textfixture>,<testname>,<linenumber>,<testresult><EOL>\r\n");
+	printf("\t-k:\twill prepend <marker> before machine readable output \r\n");
+	printf("\t   \t<marker> cannot start with a '-'\r\n");
 }

@@ -373,6 +383,7 @@
 		if(seatest_is_string_equal_i(runner->argv[arg], "-m")) seatest_machine_readable = 1;
 		if(seatest_parse_commandline_option_with_value(runner,arg,"-t", test_filter)) arg++;
 		if(seatest_parse_commandline_option_with_value(runner,arg,"-f", fixture_filter)) arg++;
+		if(seatest_parse_commandline_option_with_value(runner,arg,"-k", set_magic_marker)) arg++;
 	}
 }


qemu: Introduce qemuMigrationDstFinishActive

Refactors qemuMigrationDstFinish by moving some parts to a dedicated
function for easier introduction of postcopy resume code without
duplicating common parts of the Finish phase. The goal is to have the
following call graph:

    - qemuMigrationDstFinish
        - qemuMigrationDstFinishOffline
        - qemuMigrationDstFinishActive
            - qemuMigrationDstFinishFresh
            - qemuMigrationDstFinishResume

Signed-off-by: Jiri Denemark <62bdf77dc47919a4d59a91822129d14633cfca81@redhat.com>
Reviewed-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>

--- src/qemu/qemu_migration.c
+++ src/qemu/qemu_migration.c
@@ -5973,71 +5973,32 @@
 }

-virDomainPtr
-qemuMigrationDstFinish(virQEMUDriver *driver,
-                       virConnectPtr dconn,
-                       virDomainObj *vm,
-                       const char *cookiein,
-                       int cookieinlen,
-                       char **cookieout,
-                       int *cookieoutlen,
-                       unsigned long flags,
-                       int retcode,
-                       bool v3proto)
-{
+static virDomainPtr
+qemuMigrationDstFinishActive(virQEMUDriver *driver,
+                             virConnectPtr dconn,
+                             virDomainObj *vm,
+                             int cookie_flags,
+                             const char *cookiein,
+                             int cookieinlen,
+                             char **cookieout,
+                             int *cookieoutlen,
+                             unsigned long flags,
+                             int retcode,
+                             bool v3proto,
+                             unsigned long long timeReceived)
+{
+    virErrorPtr orig_err = NULL;
     virDomainPtr dom = NULL;
     g_autoptr(qemuMigrationCookie) mig = NULL;
-    virErrorPtr orig_err = NULL;
-    int cookie_flags = 0;
     qemuDomainObjPrivate *priv = vm->privateData;
     qemuDomainJobPrivate *jobPriv = priv->job.privateData;
-    unsigned short port;
-    unsigned long long timeReceived = 0;
     virObjectEvent *event;
     bool inPostCopy = false;
     bool doKill = true;
     int rc;

-    VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
-              "cookieout=%p, cookieoutlen=%p, flags=0x%lx, retcode=%d",
-              driver, dconn, vm, NULLSTR(cookiein), cookieinlen,
-              cookieout, cookieoutlen, flags, retcode);
-
-    port = priv->migrationPort;
-    priv->migrationPort = 0;
-
-    if (!qemuMigrationJobIsActive(vm, VIR_ASYNC_JOB_MIGRATION_IN)) {
-        qemuMigrationDstErrorReport(driver, vm->def->name);
-        goto cleanup;
-    }
-
-    ignore_value(virTimeMillisNow(&timeReceived));
-
-    qemuMigrationJobStartPhase(vm,
-                               v3proto ? QEMU_MIGRATION_PHASE_FINISH3
-                                       : QEMU_MIGRATION_PHASE_FINISH2);
-
-    qemuDomainCleanupRemove(vm, qemuMigrationDstPrepareCleanup);
-    g_clear_pointer(&priv->job.completed, virDomainJobDataFree);
-
-    cookie_flags = QEMU_MIGRATION_COOKIE_NETWORK |
-                   QEMU_MIGRATION_COOKIE_STATS |
-                   QEMU_MIGRATION_COOKIE_NBD;
-    /* Some older versions of libvirt always send persistent XML in the cookie
-     * even though VIR_MIGRATE_PERSIST_DEST was not used. */
-    cookie_flags |= QEMU_MIGRATION_COOKIE_PERSISTENT;
-
-    if (flags & VIR_MIGRATE_OFFLINE) {
-        if (retcode == 0) {
-            dom = qemuMigrationDstFinishOffline(driver, dconn, vm,
-                                                cookie_flags,
-                                                cookiein, cookieinlen,
-                                                cookieout, cookieoutlen);
-        }
-
-        qemuMigrationJobFinish(vm);
-        goto cleanup;
-    }
+    VIR_DEBUG("vm=%p, flags=0x%lx, retcode=%d",
+              vm, flags, retcode);

     if (!(mig = qemuMigrationCookieParse(driver, vm->def, priv->origname, priv,
                                          cookiein, cookieinlen, cookie_flags)))
@@ -6075,19 +6036,6 @@

     qemuMigrationJobFinish(vm);

- cleanup:
-    virPortAllocatorRelease(port);
-    if (priv->mon)
-        qemuMonitorSetDomainLog(priv->mon, NULL, NULL, NULL);
-    VIR_FREE(priv->origname);
-    virDomainObjEndAPI(&vm);
-    virErrorRestore(&orig_err);
-
-    /* Set a special error if Finish is expected to return NULL as a result of
-     * successful call with retcode != 0
-     */
-    if (retcode != 0 && !dom && virGetLastErrorCode() == VIR_ERR_OK)
-        virReportError(VIR_ERR_MIGRATE_FINISH_OK, NULL);
     return dom;

  error:
@@ -6124,7 +6072,90 @@
     if (!virDomainObjIsActive(vm))
         qemuDomainRemoveInactive(driver, vm);

-    goto cleanup;
+    virErrorRestore(&orig_err);
+    return NULL;
+}
+
+
+virDomainPtr
+qemuMigrationDstFinish(virQEMUDriver *driver,
+                       virConnectPtr dconn,
+                       virDomainObj *vm,
+                       const char *cookiein,
+                       int cookieinlen,
+                       char **cookieout,
+                       int *cookieoutlen,
+                       unsigned long flags,
+                       int retcode,
+                       bool v3proto)
+{
+    virDomainPtr dom = NULL;
+    int cookie_flags = 0;
+    qemuDomainObjPrivate *priv = vm->privateData;
+    unsigned short port;
+    unsigned long long timeReceived = 0;
+
+    VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
+              "cookieout=%p, cookieoutlen=%p, flags=0x%lx, retcode=%d",
+              driver, dconn, vm, NULLSTR(cookiein), cookieinlen,
+              cookieout, cookieoutlen, flags, retcode);
+
+    port = priv->migrationPort;
+    priv->migrationPort = 0;
+
+    if (!qemuMigrationJobIsActive(vm, VIR_ASYNC_JOB_MIGRATION_IN)) {
+        qemuMigrationDstErrorReport(driver, vm->def->name);
+        goto cleanup;
+    }
+
+    ignore_value(virTimeMillisNow(&timeReceived));
+
+    qemuMigrationJobStartPhase(vm,
+                               v3proto ? QEMU_MIGRATION_PHASE_FINISH3
+                                       : QEMU_MIGRATION_PHASE_FINISH2);
+
+    qemuDomainCleanupRemove(vm, qemuMigrationDstPrepareCleanup);
+    g_clear_pointer(&priv->job.completed, virDomainJobDataFree);
+
+    cookie_flags = QEMU_MIGRATION_COOKIE_NETWORK |
+                   QEMU_MIGRATION_COOKIE_STATS |
+                   QEMU_MIGRATION_COOKIE_NBD;
+    /* Some older versions of libvirt always send persistent XML in the cookie
+     * even though VIR_MIGRATE_PERSIST_DEST was not used. */
+    cookie_flags |= QEMU_MIGRATION_COOKIE_PERSISTENT;
+
+    if (flags & VIR_MIGRATE_OFFLINE) {
+        if (retcode == 0) {
+            dom = qemuMigrationDstFinishOffline(driver, dconn, vm,
+                                                cookie_flags,
+                                                cookiein, cookieinlen,
+                                                cookieout, cookieoutlen);
+        }
+
+        qemuMigrationJobFinish(vm);
+        goto cleanup;
+    }
+
+    dom = qemuMigrationDstFinishActive(driver, dconn, vm, cookie_flags,
+                                       cookiein, cookieinlen,
+                                       cookieout, cookieoutlen,
+                                       flags, retcode, v3proto, timeReceived);
+    if (!dom)
+        goto cleanup;
+
+ cleanup:
+    virPortAllocatorRelease(port);
+    if (priv->mon)
+        qemuMonitorSetDomainLog(priv->mon, NULL, NULL, NULL);
+    VIR_FREE(priv->origname);
+    virDomainObjEndAPI(&vm);
+
+    /* Set a special error if Finish is expected to return NULL as a result of
+     * successful call with retcode != 0
+     */
+    if (retcode != 0 && !dom && virGetLastErrorCode() == VIR_ERR_OK)
+        virReportError(VIR_ERR_MIGRATE_FINISH_OK, NULL);
+    return dom;
 }


removed redundant code

removed redundant code

--- chesslib.c
+++ chesslib.c
@@ -127,46 +127,12 @@
 					if (chb[y][x].occ == false)
 						printf("   ");
 					else {
-						if (p == 'a') {
-							if (chb[y][x].c == BLACK)
-								SetConsoleTextAttribute(cmdhandle, FOREGROUND_RED);
-							else
-								SetConsoleTextAttribute(cmdhandle, FOREGROUND_GREEN);
-							printf(" %c ", chb[y][x].current);
-							SetConsoleTextAttribute(cmdhandle, sv_att);
-						} else {
-							if (chb[y][x].current == 'P') {
-								if (chb[y][x].c == BLACK)
-									printf(" \u265F ");
-								else
-									printf(" \u2659 ");
-							} else if (chb[y][x].current == 'Q') {
-								if (chb[y][x].c == BLACK)
-									printf(" \u265B ");
-								else
-									printf(" \u2655 ");
-							} else if (chb[y][x].current == 'B') {
-								if (chb[y][x].c == BLACK)
-									printf(" \u265D ");
-								else
-									printf(" \u2657 ");
-							} else if (chb[y][x].current == 'R') {
-								if (chb[y][x].c == BLACK)
-									printf(" \u265C ");
-								else
-									printf(" \u2656 ");
-							} else if (chb[y][x].current == 'N') {
-								if (chb[y][x].c == BLACK)
-									printf(" \u265E ");
-								else
-									printf(" \u2658 ");
-							} else if (chb[y][x].current == 'K') {
-								if (chb[y][x].c == BLACK)
-									printf(" \u265A ");
-								else
-									printf(" \u2654 ");
-							}
-						}
+						if (chb[y][x].c == BLACK)
+							SetConsoleTextAttribute(cmdhandle, FOREGROUND_RED);
+						else
+							SetConsoleTextAttribute(cmdhandle, FOREGROUND_GREEN);
+						printf(" %c ", chb[y][x].current);
+						SetConsoleTextAttribute(cmdhandle, sv_att);
 					}
 					x++;
 				}
@@ -1128,7 +1094,7 @@
 	if (round == WHITE) {
 		fprintf(logf, "Round  #%d:\tWhite moves ", c);
 	} else {
-		fprintf(logf, "             Black moves ");
+		fprintf(logf, "           \tBlack moves ");
 		c++;
 	}
 	if (plInput[0] == 'P') {


fix eager_delay test, and allow large OS pages even without eager commit enabled

--- src/segment.c
+++ src/segment.c
@@ -326,7 +326,8 @@
   size_t page_size = (page_kind == MI_PAGE_HUGE ? segment_size : (size_t)1 << page_shift);

   // Try to get it from our thread local cache first
-  bool eager  = mi_option_is_enabled(mi_option_eager_commit) && (tld->count < (size_t)mi_option_get(mi_option_eager_commit_delay));
+  bool eager_delay = (tld->count < (size_t)mi_option_get(mi_option_eager_commit_delay));
+  bool eager  = !eager_delay && mi_option_is_enabled(mi_option_eager_commit);
   bool commit = eager || (page_kind > MI_PAGE_MEDIUM);
   bool protection_still_good = false;
   mi_segment_t* segment = mi_segment_cache_pop(segment_size, tld);
@@ -353,7 +354,7 @@
   else {
     // Allocate the segment from the OS
     size_t memid;
-    bool   mem_large = (eager && !mi_option_is_enabled(mi_option_secure)); // only allow large OS pages once we are no longer lazy
+    bool   mem_large = (!eager_delay && !mi_option_is_enabled(mi_option_secure)); // only allow large OS pages once we are no longer lazy
     segment = (mi_segment_t*)_mi_mem_alloc_aligned(segment_size, MI_SEGMENT_SIZE, &commit, &mem_large, &memid, os_tld);
     if (segment == NULL) return NULL;  // failed to allocate
     if (!commit) {


Report error info when load BL30 failed

Report error info when load BL30 failed

This is a temporary fix, when load BL30 image failed it will just report
the error rather than run into panic. Will fix this issue when we move
mcu image from fip into its dedicated partition.

Signed-off-by: Leo Yan <a38ad1fbd0b3373e0c012f4d28e16dbce652d487@linaro.org>

--- bl2/bl2_main.c
+++ bl2/bl2_main.c
@@ -417,7 +417,8 @@
 	e = load_bl30();
 	if (e) {
 		ERROR("Failed to load BL3-0 (%i)\n", e);
-		panic();
+		ERROR("Pls burn mcu image:\n");
+		ERROR("  sudo fastboot flash mcuimage mcuimage.bin\n");
 	}

 	/* Perform platform setup in BL2 after loading BL3-0 */


COMP: fixing compilation error

COMP: fixing compilation error

--- Code/BasicFilters/itkNormalizedCorrelationImageFilter.h
+++ Code/BasicFilters/itkNormalizedCorrelationImageFilter.h
@@ -68,6 +68,8 @@

   /** Extract some information from the image types.  Dimensionality
    * of the two images is assumed to be the same. */
+  itkStaticConstMacro(InputImageDimension, unsigned int,
+                      TInputImage::ImageDimension);
   itkStaticConstMacro(ImageDimension, unsigned int,
                       TOutputImage::ImageDimension);
   itkStaticConstMacro(MaskImageDimension, unsigned int,


Only cast to G_OBJECT if clutter_device is non-NULL

--- clayland.c
+++ clayland.c
@@ -107,9 +107,12 @@
 	uint32_t state, button;

 	clutter_device = clutter_event_get_device (event);
-	clayland_device =
-		g_object_get_data (G_OBJECT(clutter_device), "clayland");
-	device = &clayland_device->input_device;
+	if (clutter_device) {
+		clayland_device =
+			g_object_get_data (G_OBJECT(clutter_device),
+					   "clayland");
+		device = &clayland_device->input_device;
+	}

 	if (CLAYLAND_IS_SURFACE (event->any.source))
 		cs = CLAYLAND_SURFACE (event->any.source);


size_t is unsigned

size_t is unsigned

--- bench/runner.c
+++ bench/runner.c
@@ -329,7 +329,7 @@
     while ((c = getopt (argc, argv, "b:c:r:e:s:xph")) != -1) {
         switch (c) {
             case 'b':
-                sscanf(optarg, "%zd", &bench_size);
+                sscanf(optarg, "%zu", &bench_size);
                 bench_size *= 1024 * 1024;
                 break;
             case 'c':
@@ -360,9 +360,9 @@
         }
     }
     char* buffer = calloc(bench_size, sizeof(char));
-    fprintf(stderr, "Preparing data (%zd bytes)\n",bench_size);
+    fprintf(stderr, "Preparing data (%zu bytes)\n",bench_size);
     size_t data_filled = generate_csv(buffer, bench_size, seed1, seed2, columns);
-    fprintf(stderr, "Data ready (%zd bytes)\n",data_filled);
+    fprintf(stderr, "Data ready (%zu bytes)\n",data_filled);
     if (output_stdout) {
         for (unsigned int b = 0; b < bench_copy; b++) {
             fwrite(buffer, sizeof(char), data_filled, stdout);


tpyo

tpyo

Former-commit-id: c6377c18fa8ce39b5e32f6178e312bfd4d951e85

--- src/qt/escrowtablemodel.h
+++ src/qt/escrowtablemodel.h
@@ -28,7 +28,7 @@
         Arbiter = 3,
 		Buyer = 4,
 		Offer = 5,
-		Offer = 6,
+		OfferTitle = 6,
 		OfferAccept = 7,
 		Total = 8,
 		Status = 9


update prototypes

update prototypes

--- chesslib.h
+++ chesslib.h
@@ -172,3 +172,7 @@
 inline void clear_buffer(void);
 inline void printBanner(const char*);
 inline void printInstructions(void);
+
+#ifdef AI_IS_ENABLED
+char *AImove(ch_template chb[][8]);
+#endif


fixed name of gyro scales

fixed name of gyro scales

--- src/sensors.c
+++ src/sensors.c
@@ -158,7 +158,7 @@
   uint16_t acc1G;
   float gyro_scale_to_mrad;
   mpu6050_init(true, &acc1G, &gyro_scale_to_mrad, _params.values[PARAM_BOARD_REVISION]);
-  gyro_scale = 1000000.0*gyro_scale_to_mrad;
+  gyro_scale = 1000000.0*gyro_scale_to_urad;
   accel_scale = 9.80665f/acc1G;

   // DIFF PRESSURE


new files

new files

--- include/CScreenUnits.h
+++ include/CScreenUnits.h
@@ -69,7 +69,7 @@
    value_(value), units_(units) {
   }

-  CScreenUnits(Units units, double value) :
+  explicit CScreenUnits(Units units, double value=1.0) :
    value_(value), units_(units) {
   }


imageptr

imageptr

--- tool/linker/ex1/lnkdos16.c
+++ tool/linker/ex1/lnkdos16.c
@@ -35,6 +35,7 @@
     unsigned long                       segment_relative;
     unsigned short                      initial_alignment;
     unsigned long                       load_base;
+    unsigned char*                      image_ptr;  /* size is segment_length */
 };

 static struct link_segdef               link_segments[MAX_SEGMENTS];
@@ -166,6 +167,11 @@
     cstr_free(&(sg->groupname));
     cstr_free(&(sg->classname));
     cstr_free(&(sg->name));
+
+    if (sg->image_ptr != NULL) {
+        free(sg->image_ptr);
+        sg->image_ptr = NULL;
+    }
 }

 void free_link_segments(void) {
@@ -669,6 +675,20 @@
                     sd->file_offset = ofs;
                 }
             }
+
+            /* allocate in-memory copy of the segments */
+            {
+                for (inf=0;inf < link_segments_count;inf++) {
+                    struct link_segdef *sd = &link_segments[inf];
+
+                    assert(sd->image_ptr == NULL);
+                    if (sd->segment_length == 0) continue;
+
+                    sd->image_ptr = malloc(sd->segment_length);
+                    assert(sd->image_ptr != NULL);
+                    memset(sd->image_ptr,0,sd->segment_length);
+                }
+            }
         }
     }


blk-mq: initialize q->nr_requests after calling blk_queue_make_request()

blk_queue_make_requests() overwrites our set value for q->nr_requests,
turning it into the default of 128. Set this appropriately after
initializing queue values in blk_queue_make_request().

Signed-off-by: Jens Axboe <cd8c6775e60d6f67a6984377324e5290df3d5358@fb.com>


Updated documentation, modified interface a bit

--- include/CStochSolver.h
+++ include/CStochSolver.h
@@ -38,11 +38,13 @@
  * solver->GetMethod()->InitMethod();
  * while (step < total_steps && time < total_time && time >= 0)
  * {
- *     time = solver->GetMethod()->DoStep();
+ *     time = solver->GetMethod()->DoStep(time);
  *     step++;
  * }
  *
  */
+
+class CStochMethod;

 class CStochSolver
 {
@@ -84,7 +86,7 @@
      * @param maxtime The maximum simulation time.
      * @param maxsteps The maximum number of simulation steps.
      */
-    CStochSolver(CStochSolver::Type method_type, CModel *model, C_FLOAT_32 maxtime, C_INT32 maxsteps);
+    CStochSolver(std::string method_name, CModel *model, C_FLOAT64 maxtime, C_INT32 maxsteps);
     /**
      * The destructor
      */
@@ -96,7 +98,7 @@
      * @param maxtime The maximum time the simulation may take.
      * @param maxsteps The maximum number of steps in the simulation.
      */
-    void Initialise(std::string method, CModel *model, C_FLOAT_32 maxtime, C_INT32 maxsteps);
+    void Initialise(std::string method, CModel *model, C_FLOAT64 maxtime, C_INT32 maxsteps);
     // Operations methods
     /**
      * Returns a pointer to the instance of the solver method.
@@ -108,20 +110,15 @@
 /**
  * CStochMethod is a parent to concrete solvers derived from it.
  *
- * For each reactant in the model, an initial count is determined from
- * the concentration; this count of each reactant characterises the
- * system state.  For each reaction (specified by CStep) in the model
- * (given by CModel) a propensity amu may be determined. These are
- * stored in the vector mAmu. Each propensity is a product of two
- * state-dependent factors, cmu and hmu; these are stored in the
- * vectors mCmu and mHmu. Since the hmu and cmu values change as the
- * system state changes, the values of amu (may) need to be updated
- * after each step in the simulation. The propensities are then used
- * to determine the next step and the time at which it occurs, after
- * which the particle numbers are updated and the time is
- * incremented. The particulars of how the updating is done, and the
- * determination of the next reaction and its time are left to the
- * inherited classes.
+ * These solvers do the actual work of the simulation. Each solver
+ * maintains a list of propensities, a_mu, one for each reaction. These
+ * propensities are dependent on the state of the system. i.e. the
+ * numbers of each particle, and some or all must be updated after
+ * each reaction. The propensities are then used to determine the next
+ * step and the time at which it occurs, after which the particle
+ * numbers are updated and the time is incremented. The particulars of
+ * how the updating is done, and the determination of the next
+ * reaction and its time are left to the inherited classes.
  */

 class CStochMethod
@@ -133,18 +130,13 @@
      */
     CModel *mModel;
     /**
-     * The rate-dependent part of the propensity function. (The rate
-     * function may depend on the state, for more complex dynamics.)
-     */
-    std::vector<C_FLOAT64> mCmu;
-    /**
-     * The state-dependent part of the propensity function
-     */
-    std::vector<C_FLOAT64> mHmu;
-    /**
-     * The propensity functions
+     * The propensities for the reactions
      */
     std::vector<C_FLOAT64> mAmu;
+    /**
+     * The sum of the propensities
+     */
+    C_FLOAT64 mA0;
     /**
      * Failure status.
      * 0 = Success
@@ -172,10 +164,21 @@
      * Do one iteration of the simulation
      * @return Current simulation time or -1 if error.
      */
-     virtual C_FLOAT64 DoStep() = 0;
+     virtual C_FLOAT64 DoStep(C_FLOAT64 time) = 0;
  protected:
     // Protected operations
     /**
+     * Calculate the propensities for all reactions
+     * @return mFail
+     * @see mFail
+     */
+    C_INT32 UpdatePropensities();
+    /**
+     * Calculate one of the propensities
+     */
+    C_INT32 CalculateAmu(C_INT32);
+#if 0
+    /**
      * Determine the value of one of the cmu's
      * @param index The position in the vector of this value of Cmu
      * @return mFail
@@ -189,6 +192,7 @@
      * @see mFail
      */
     C_INT32 CalculateHmu(C_INT32 index);
+#endif // 0
 };

 /**
@@ -218,20 +222,14 @@
      * @return mFail
      * @see mFail
      */
-    C_INT32 InitMethod() = 0;
+    C_INT32 InitMethod();
     /**
      * Do one iteration of the simulation
      * @return Current simulation time or -1 if error.
      */
-     C_FLOAT64 DoStep();
+     C_FLOAT64 DoStep(C_FLOAT64 time);
  private:
     // Private operations
-    /**
-     * Calculate the propensity functions for all reactions
-     * @return mFail
-     * @see mFail
-     */
-    C_INT32 CalculateAmu();
     /**
      * Get the next reaction
      * @return the index of the reaction which occurs.
@@ -247,7 +245,7 @@
      * @return mFail
      * @see mFail
      */
-    C_INT32 UpdateParticleNumbers();
+    C_INT32 UpdateSystemState(C_INT32 reaction_idx);
 };

 /**
@@ -290,7 +288,6 @@
     C_FLOAT64 Step();
  private:
     // Private operations
-    /**
-     * Update the neccessary values of amu
+};

 #endif // COPASI_CStochSolver


inherit from Bindable

inherit from Bindable

--- include/EventHandler.h
+++ include/EventHandler.h
@@ -1,5 +1,7 @@
 #ifndef _EVENTHANDLER_H_
 #define _EVENTHANDLER_H_
+
+#include <Bindable.h>

 class Event;
 class TouchEvent;
@@ -37,10 +39,9 @@
 class MultiTouchEvent;
 class LoadEvent;

-class EventHandler {
+class EventHandler : public Bindable {
  public:
   EventHandler() { }
-  virtual ~EventHandler() { }

   virtual void onEvent(Event & ev) { }
   virtual void onDrawEvent(DrawEvent & ev) { }


blk-mq: merge blk_mq_drain_queue and __blk_mq_drain_queue

Signed-off-by: Christoph Hellwig <923f7720577207a44b32e59bbfbea59d27f1ae8e@lst.de>
Signed-off-by: Jens Axboe <cd8c6775e60d6f67a6984377324e5290df3d5358@fb.com>


Added missing "Decl.h" include in "Equals.h" file.

--- include/Gauss/Equals.h
+++ include/Gauss/Equals.h
@@ -11,6 +11,7 @@

 #include "Real.h"
 #include "Epsilon.h"
+#include "Decl.h"

 #include <cmath>

@@ -24,19 +25,19 @@
 template <typename T>
 inline bool Equals(const T& lhs, const T& rhs)
 {
-    return lhs == rhs;
+    return (lhs == rhs);
 }

 template <>
 inline bool Equals<float>(const float& lhs, const float& rhs)
 {
-    return std::abs(lhs - rhs) <= Epsilon<float>();
+    return (std::abs(lhs - rhs) <= Epsilon<float>());
 }

 template <>
 inline bool Equals<double>(const double& lhs, const double& rhs)
 {
-    return std::abs(lhs - rhs) <= Epsilon<double>();
+    return (std::abs(lhs - rhs) <= Epsilon<double>());
 }

 template <typename T, std::size_t N>


Updated docu of Matrix class.

Updated docu of Matrix class.

--- include/Gauss/Matrix.h
+++ include/Gauss/Matrix.h
@@ -59,6 +59,22 @@

 // In both cases, (w1, w2, w3, w4) stores the position in an affine transformation.
 \endcode
+Matrix elements can be accessed by the bracket operator:
+\code
+Gs::Matrix4 A;
+A(0, 0) = row0column0;
+A(2, 1) = row2column1;
+\endcode
+This is independent of the matrix storage layout and independent of the usage of row- or column vectors.
+But the following function is dependent of the usage of row- or column vectors:
+\code
+// For column vectors:
+A.At(2, 1) = row2column1;
+
+// For row vectors:
+A.At(2, 1) = row1column2;
+\endcode
+This function is used for easier support between row- and column vectors.
 */
 template <typename T, std::size_t Rows, std::size_t Cols> class Matrix
 {


remove addHeader()

remove addHeader()

--- include/HTTPResponse.h
+++ include/HTTPResponse.h
@@ -22,10 +22,6 @@
   void setRedirectUrl(const std::string & url) { redirect_url = url; }
   void setContent(const std::string & _content) { content = _content; }

-  void addHeader(const std::string & key, const std::string & value) {
-    headers[key] = value;
-  }
-
   void appendContent(const std::string & s) {
     content += s;
   }
@@ -38,7 +34,7 @@
     return true;
   }
   void handleHeader(const std::string & key, const std::string & value) override {
-    addHeader(key, value);
+    headers[key] = value;
   }
   bool handleChunk(size_t len, const char * chunk) override {
     content += std::string(chunk, len);


Re-added threadable

Re-added threadable

error: pathspec 'include/I_threadable.h' did not match any file(s) known to git

--- include/I_threadable.h
+++ include/I_threadable.h
@@ -0,0 +1,67 @@
+/**
+ *  Schulich Delta OnBoard Media Control
+ *  Copyright (C) 2015 University of Calgary Solar Car Team
+ *
+ *  This file is part of the Schulich Delta OnBoard Media Control
+ *
+ *  The Schulich Delta OnBoard Media Control is free software:
+ *  you can redistribute it and/or modify it under the terms
+ *  of the GNU Affero General Public License as published by
+ *  the Free Software Foundation, either version 3 of the
+ *  License, or (at your option) any later version.
+ *
+ *  The Schulich Delta OnBoard Media Control is distributed
+ *  in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ *  without even the implied warranty of MERCHANTABILITY or
+ *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Affero General
+ *  Public License along with the Schulich Delta OnBoard Media
+ *  Control.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  For further contact, email <software@calgarysolarcar.ca>
+ */
+
+#pragma once
+#include <thread>
+
+
+class I_Threadable
+{
+public:
+    I_Threadable() { }
+    virtual ~I_Threadable() { }
+
+    bool StartThread()
+    {
+        if (pthread_create(&thread_tracker, NULL, ThreadReference, this) == 0)
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    void WaitForThreadToExit()
+    {
+        pthread_join(thread_tracker, NULL);
+    }
+
+
+
+protected:
+    /** Anything inheriting this class must define this function */
+    virtual void ThreadFunction() = 0;
+
+private:
+    static void * ThreadReference(void * thread_id)
+    {
+        ((I_Threadable *)thread_id)->ThreadFunction();
+        return NULL;
+    }
+
+    pthread_t thread_tracker;
+};


add accessors

add accessors

--- include/ImageElement.h
+++ include/ImageElement.h
@@ -26,6 +26,9 @@
     sendCommand(c);
   }

+  const std::string & getFilename() { return filename; }
+  void setFilename(const std::string & _filename) { filename = filename; }
+
  protected:
   void create() override {
     Command c(Command::CREATE_IMAGEVIEW, getParentInternalId(), getInternalId());


Make LinearLayout dispatch CommandEvents

--- include/LinearLayout.h
+++ include/LinearLayout.h
@@ -3,6 +3,8 @@

 #include <Element.h>
 #include <Command.h>
+#include <CommandEvent.h>
+#include <ValueEvent.h>

 #define FW_VERTICAL	1
 #define FW_HORIZONTAL	2
@@ -16,6 +18,12 @@
     return Element::isA(className);
   }

+  void onValueEvent(ValueEvent & ev) override {
+     notify();
+     CommandEvent ev2(getId());
+     ev2.dispatch(*this);
+   }
+
  protected:
   void create() override {
     Command c(Command::CREATE_LINEAR_LAYOUT, getParentInternalId(), getInternalId());


* added MeshObstacle::getCheckCount()

* added MeshObstacle::getCheckCount()

git-svn-id: c0942edff5350604e2827ab28bdfcfa5200fadee@21348 08b3d480-bf2c-0410-a26f-811ee3361c24

--- include/MeshObstacle.h
+++ include/MeshObstacle.h
@@ -96,6 +96,7 @@
     const fvec3 *getVertices() const;
     const fvec3 *getNormals() const;
     const fvec2 *getTexcoords() const;
+    int getCheckCount() const;
     int getVertexCount() const;
     int getNormalCount() const;
     int getTexcoordCount() const;
@@ -172,6 +173,11 @@
   return texcoords;
 }

+inline int MeshObstacle::getCheckCount() const
+{
+  return checkCount;
+}
+
 inline int MeshObstacle::getVertexCount() const
 {
   return vertexCount;


removed unused extern variable declarations

--- bin/dig/host.c
+++ bin/dig/host.c
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */

-/* $Id: host.c,v 1.48 2000/08/14 19:17:42 bwelling Exp $ */
+/* $Id: host.c,v 1.49 2000/08/22 16:44:46 gson Exp $ */

 #include <config.h>
 #include <stdlib.h>
@@ -45,25 +45,16 @@
 extern ISC_LIST(dig_server_t) server_list;
 extern ISC_LIST(dig_searchlist_t) search_list;

-extern isc_boolean_t have_ipv6, show_details, debugging;
-extern in_port_t port;
+extern isc_boolean_t show_details, debugging;
 extern unsigned int timeout;
 extern isc_mem_t *mctx;
-extern dns_messageid_t id;
-extern dns_name_t rootorg;
-extern char *rootspace[BUFSIZE];
-extern isc_buffer_t rootbuf;
-extern int sendcount;
 extern int ndots;
 extern int tries;
 extern int lookup_counter;
-extern int exitcode;
-extern isc_taskmgr_t *taskmgr;
 extern char *progname;
 extern isc_task_t *global_task;

-isc_boolean_t
-short_form = ISC_TRUE;
+isc_boolean_t short_form = ISC_TRUE;

 static const char *opcodetext[] = {
 	"QUERY",


Correct comment

Correct comment

--- include/Utility/Math.h
+++ include/Utility/Math.h
@@ -44,7 +44,7 @@
     //! \tparam Ts Types of values.
     //! \param[out] xs All the values.
     //!
-    //! The values will be divided by std::abs(x) + std::abs(y).
+    //! Each value will be divided by std::abs(x1) + std::abs(x2) + ....
     template<typename ...Ts>
     void normalize(Ts&... xs) noexcept
     {


ValueElement: Add Base Type Cast operator + Refactoring

--- include/ValueElement.h
+++ include/ValueElement.h
@@ -275,6 +275,9 @@

 		constexpr static std::size_t size() noexcept { return sizeof(VType);}
     constexpr bool hasUncertainty()     noexcept {return false;}
+		operator T() const {
+			return mValue;
+		}
 };

 template<typename T, bool U =true>
@@ -339,6 +342,17 @@

     UType uncertainty() const{ return mUncertainty; }
     void uncertainty(UType u){ mUncertainty = u; }
+
+		ValueElement operator-() const{
+      ValueElement temp(*this);
+      if(std::is_signed<T>::value)
+        temp.mValue=-temp.mValue;
+      else{
+        temp.uncertainty(std::numeric_limits<UType>::max());
+        temp.mValue=0;
+      }
+      return temp;
+    }

     ValueElement& operator+=(const ValueElement& a){
       if(satAdd(this->mValue, a.mValue))
@@ -350,16 +364,6 @@
       return *this;
     }

-    ValueElement operator-() const{
-      ValueElement temp(*this);
-      if(std::is_signed<T>::value)
-        temp.mValue=-temp.mValue;
-      else{
-        temp.uncertainty(std::numeric_limits<UType>::max());
-        temp.mValue=0;
-      }
-      return temp;
-    }

     ValueElement operator-=(const ValueElement& a){
 			if(satSub(this->mValue, a.mValue))


Implement msub instruction

Implement msub instruction

--- include/arch/aarch64.h
+++ include/arch/aarch64.h
@@ -30,6 +30,9 @@

 // x, y and z are general purpose 64-bit registers (Xn)
 #define SDIV(x,y,z)         code[i++] = 0x9ac00c00 | (x) | ((y) << 5) | ((z) << 16)
+
+#define MSUB(w,x,y,z)       code[i++] = 0x9b008000 | (w) | ((x) << 5) | ((z) << 10) | \
+                            ((y) << 16)

 // x and y are registers (Xn|SP) and imm is an unsigned immediate value (0..4095)
 //      sub {x}, {y}, #{imm}


include/asm-x86/i387.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <16a9a54ddf4259952e3c118c763138e83693d7fd@perches.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- include/asm-x86/i387.h
+++ include/asm-x86/i387.h
@@ -41,7 +41,7 @@
 {
 	asm volatile("1: fwait\n"
 		     "2:\n"
-		     _ASM_EXTABLE(1b,2b));
+		     _ASM_EXTABLE(1b, 2b));
 }

 static inline int restore_fpu_checking(struct i387_fxsave_struct *fx)
@@ -54,7 +54,7 @@
 		     "3:  movl $-1,%[err]\n"
 		     "    jmp  2b\n"
 		     ".previous\n"
-		     _ASM_EXTABLE(1b,3b)
+		     _ASM_EXTABLE(1b, 3b)
 		     : [err] "=r" (err)
 #if 0 /* See comment in __save_init_fpu() below. */
 		     : [fx] "r" (fx), "m" (*fx), "0" (0));
@@ -76,11 +76,11 @@
 static inline void clear_fpu_state(struct i387_fxsave_struct *fx)
 {
 	if (unlikely(fx->swd & X87_FSW_ES))
-		 asm volatile("fnclex");
+		asm volatile("fnclex");
 	alternative_input(ASM_NOP8 ASM_NOP2,
-		     "    emms\n"		/* clear stack tags */
-		     "    fildl %%gs:0",	/* load to clear state */
-		     X86_FEATURE_FXSAVE_LEAK);
+			  "    emms\n"		/* clear stack tags */
+			  "    fildl %%gs:0",	/* load to clear state */
+			  X86_FEATURE_FXSAVE_LEAK);
 }

 static inline int save_i387_checking(struct i387_fxsave_struct __user *fx)
@@ -93,14 +93,15 @@
 		     "3:  movl $-1,%[err]\n"
 		     "    jmp  2b\n"
 		     ".previous\n"
-		     _ASM_EXTABLE(1b,3b)
+		     _ASM_EXTABLE(1b, 3b)
 		     : [err] "=r" (err), "=m" (*fx)
 #if 0 /* See comment in __fxsave_clear() below. */
 		     : [fx] "r" (fx), "0" (0));
 #else
 		     : [fx] "cdaSDb" (fx), "0" (0));
 #endif
-	if (unlikely(err) && __clear_user(fx, sizeof(struct i387_fxsave_struct)))
+	if (unlikely(err) &&
+	    __clear_user(fx, sizeof(struct i387_fxsave_struct)))
 		err = -EFAULT;
 	/* No need to clear here because the caller clears USED_MATH */
 	return err;
@@ -156,8 +157,10 @@
 		return 0;
 	clear_used_math(); /* trigger finit */
 	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		err = save_i387_checking((struct i387_fxsave_struct __user *)buf);
-		if (err) return err;
+		err = save_i387_checking((struct i387_fxsave_struct __user *)
+					 buf);
+		if (err)
+			return err;
 		task_thread_info(tsk)->status &= ~TS_USEDFPU;
 		stts();
 	} else {