Skip to content

Commit c0ecd1f

Browse files
committed
Corrects previously incorrect $sp change in MipsCompilationCallback.
The address for $sp, and addresses for sdc1/ldc1 must be 8-byte aligned Patch by Petar Jovanovic. llvm-svn: 142930
1 parent b75951f commit c0ecd1f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/Target/Mips/MipsJITInfo.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ void MipsCompilationCallback();
5757
".globl " ASMPREFIX "MipsCompilationCallback\n"
5858
ASMPREFIX "MipsCompilationCallback:\n"
5959
".ent " ASMPREFIX "MipsCompilationCallback\n"
60-
".frame $29, 32, $31\n"
60+
".frame $sp, 32, $ra\n"
6161
".set noreorder\n"
6262
".cpload $t9\n"
6363

64-
"addiu $sp, $sp, -60\n"
64+
"addiu $sp, $sp, -64\n"
6565
".cprestore 16\n"
6666

6767
// Save argument registers a0, a1, a2, a3, f12, f14 since they may contain
@@ -76,8 +76,8 @@ void MipsCompilationCallback();
7676
"sw $a3, 32($sp)\n"
7777
"sw $ra, 36($sp)\n"
7878
"sw $t8, 40($sp)\n"
79-
"sdc1 $f12, 44($sp)\n"
80-
"sdc1 $f14, 52($sp)\n"
79+
"sdc1 $f12, 48($sp)\n"
80+
"sdc1 $f14, 56($sp)\n"
8181

8282
// t8 points at the end of function stub. Pass the beginning of the stub
8383
// to the MipsCompilationCallbackC.
@@ -92,9 +92,9 @@ void MipsCompilationCallback();
9292
"lw $a3, 32($sp)\n"
9393
"lw $ra, 36($sp)\n"
9494
"lw $t8, 40($sp)\n"
95-
"ldc1 $f12, 44($sp)\n"
96-
"ldc1 $f14, 52($sp)\n"
97-
"addiu $sp, $sp, 60\n"
95+
"ldc1 $f12, 48($sp)\n"
96+
"ldc1 $f14, 56($sp)\n"
97+
"addiu $sp, $sp, 64\n"
9898

9999
// Jump to the (newly modified) stub to invoke the real function.
100100
"addiu $t8, $t8, -16\n"

0 commit comments

Comments
 (0)