- k_node = new_r_Const_long(irg, mode_Iu, k);
- res = new_rd_Shrs(dbg, block, curr, k_node, mode);
+ k_node = new_r_Const_long(irg, mode_Iu, bits - k);
+ curr = new_rd_Shr(dbg, block, curr, k_node, mode);
+ /* curr is now 2^(k-1) in case left < 0
+ * or 0 in case left >= 0
+ *
+ * For an example, where this fixup is necessary consider -3 / 2,
+ * which should compute to -1,
+ * but simply shifting right by one computes -2.
+ */