aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m32c/jump.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/m32c/jump.md')
-rw-r--r--gcc/config/m32c/jump.md26
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/config/m32c/jump.md b/gcc/config/m32c/jump.md
index 4a358eac40f..f0983d1532d 100644
--- a/gcc/config/m32c/jump.md
+++ b/gcc/config/m32c/jump.md
@@ -69,7 +69,18 @@
""
"*
switch (which_alternative) {
- case 0: return \"jsr.a\t%0\";
+ case 0:
+ {
+ HOST_WIDE_INT func_vect_num =
+ current_function_special_page_vector(XEXP (operands[0], 0));
+ if (func_vect_num)
+ {
+ operands[3] = gen_rtx_CONST_INT (VOIDmode, func_vect_num);
+ return \"jsrs\t%3\";
+ }
+ else
+ return \"jsr.a\t%0\";
+ }
case 1: return TARGET_A16 ? \"push.w %a0 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a0\";
case 2: return \"jsri.a\t%a0\";
}"
@@ -84,7 +95,18 @@ switch (which_alternative) {
""
"*
switch (which_alternative) {
- case 0: return \"jsr.a\t%1\";
+ case 0:
+ {
+ HOST_WIDE_INT func_vect_num =
+ current_function_special_page_vector(XEXP (operands[1], 0));
+ if (func_vect_num)
+ {
+ operands[4] = gen_rtx_CONST_INT (VOIDmode, func_vect_num);
+ return \"jsrs\t%4\";
+ }
+ else
+ return \"jsr.a\t%1\";
+ }
case 1: return TARGET_A16 ? \"push.w %a1 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a1\";
case 2: return \"jsri.a\t%a1\";
}"