""
{
if (rs6000_speculate_indirect_jumps)
- {
- if (TARGET_32BIT)
- emit_jump_insn (gen_tablejumpsi (operands[0], operands[1]));
- else
- emit_jump_insn (gen_tablejumpdi (operands[0], operands[1]));
- }
+ emit_jump_insn (gen_tablejump_normal (Pmode, operands[0], operands[1]));
else
{
rtx ccreg = gen_reg_rtx (CCmode);
DONE;
})
-(define_expand "tablejumpsi"
- [(set (match_dup 3)
- (plus:SI (match_operand:SI 0)
- (match_dup 2)))
- (parallel [(set (pc)
- (match_dup 3))
- (use (label_ref (match_operand 1)))])]
- "TARGET_32BIT && rs6000_speculate_indirect_jumps"
+(define_expand "@tablejump<mode>_normal"
+ [(use (match_operand:SI 0))
+ (use (match_operand:P 1))]
+ "rs6000_speculate_indirect_jumps"
{
operands[0] = force_reg (SImode, operands[0]);
- operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (SImode, operands[1]));
- operands[3] = gen_reg_rtx (SImode);
+ if (<MODE>mode == SImode)
+ operands[4] = operands[0];
+ else
+ {
+ operands[4] = gen_reg_rtx (Pmode);
+ rtx src = gen_rtx_fmt_e (SIGN_EXTEND, Pmode, operands[0]);
+ emit_move_insn (operands[4], src);
+ }
+
+ operands[2] = force_reg (Pmode, gen_rtx_LABEL_REF (Pmode, operands[1]));
+ operands[3] = gen_reg_rtx (Pmode);
+
+ emit_insn (gen_add<mode>3 (operands[3], operands[4], operands[2]));
+ emit_jump_insn (gen_tablejump_insn_normal (Pmode, operands[3], operands[1]));
+ DONE;
})
-(define_expand "tablejumpsi_nospec"
- [(set (match_dup 4)
- (plus:SI (match_operand:SI 0)
- (match_dup 3)))
- (parallel [(set (pc)
- (match_dup 4))
- (use (label_ref (match_operand 1)))
- (clobber (match_operand 2))])]
- "TARGET_32BIT && !rs6000_speculate_indirect_jumps"
+(define_expand "@tablejump<mode>_nospec"
+ [(use (match_operand:SI 0))
+ (use (match_operand:P 1))
+ (use (match_operand:CC 2))]
+ "!rs6000_speculate_indirect_jumps"
{
operands[0] = force_reg (SImode, operands[0]);
- operands[3] = force_reg (SImode, gen_rtx_LABEL_REF (SImode, operands[1]));
- operands[4] = gen_reg_rtx (SImode);
-})
+ if (<MODE>mode == SImode)
+ operands[4] = operands[0];
+ else
+ {
+ operands[4] = gen_reg_rtx (Pmode);
+ rtx src = gen_rtx_fmt_e (SIGN_EXTEND, Pmode, operands[0]);
+ emit_move_insn (operands[4], src);
+ }
-(define_expand "tablejumpdi"
- [(set (match_dup 4)
- (sign_extend:DI (match_operand:SI 0 "lwa_operand")))
- (set (match_dup 3)
- (plus:DI (match_dup 4)
- (match_dup 2)))
- (parallel [(set (pc)
- (match_dup 3))
- (use (label_ref (match_operand 1)))])]
- "TARGET_64BIT && rs6000_speculate_indirect_jumps"
-{
- operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (DImode, operands[1]));
- operands[3] = gen_reg_rtx (DImode);
- operands[4] = gen_reg_rtx (DImode);
-})
+ operands[5] = force_reg (Pmode, gen_rtx_LABEL_REF (Pmode, operands[1]));
+ operands[3] = gen_reg_rtx (Pmode);
-(define_expand "tablejumpdi_nospec"
- [(set (match_dup 5)
- (sign_extend:DI (match_operand:SI 0 "lwa_operand")))
- (set (match_dup 4)
- (plus:DI (match_dup 5)
- (match_dup 3)))
- (parallel [(set (pc)
- (match_dup 4))
- (use (label_ref (match_operand 1)))
- (clobber (match_operand 2))])]
- "TARGET_64BIT && !rs6000_speculate_indirect_jumps"
-{
- operands[3] = force_reg (DImode, gen_rtx_LABEL_REF (DImode, operands[1]));
- operands[4] = gen_reg_rtx (DImode);
- operands[5] = gen_reg_rtx (DImode);
+ emit_insn (gen_add<mode>3 (operands[3], operands[4], operands[5]));
+ emit_jump_insn (gen_tablejump_insn_nospec (Pmode, operands[3], operands[1],
+ operands[2]));
+ DONE;
})
-(define_insn "*tablejump<mode>_internal1"
+(define_insn "@tablejump<mode>_insn_normal"
[(set (pc)
(match_operand:P 0 "register_operand" "c,*l"))
(use (label_ref (match_operand 1)))]
"b%T0"
[(set_attr "type" "jmpreg")])
-(define_insn "*tablejump<mode>_internal1_nospec"
+(define_insn "@tablejump<mode>_insn_nospec"
[(set (pc)
(match_operand:P 0 "register_operand" "c,*l"))
(use (label_ref (match_operand 1)))