From: Jan-Benedict G. <jb...@us...> - 2005-09-26 19:15:33
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28752 Modified Files: udiv.S urem.S Log Message: - Correct me if I'm wrong, but for saving R2, the register save mask should be 0x0004, not 0x0002. We need to set bit #2, not the 2nd bit. - This code was taken from NetBSD, so we'd probably tell them? - Why did it work, though? I think that GCC (or the whole VAX ABI) implies that R0 and R1 are for returning values (and thus may not be pushed onto the stack) and R2..R5 are ment for temporary values that are not preserved during CALLSing a function, so the compiler will reload these registers. Though, that's theory and I haven't tested it :-) Index: urem.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/lib/urem.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- urem.S 25 May 2005 23:05:52 -0000 1.1 +++ urem.S 26 Sep 2005 19:15:18 -0000 1.2 @@ -49,7 +49,7 @@ #define DIVISOR 8(%ap) ENTRY(__urem) - .word 0x02 # save R2 + .word 0x04 # save R2 movl 8(%ap),%r2 jlss Leasy # big divisor: settle by comparison movl 4(%ap),%r0 Index: udiv.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/lib/udiv.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- udiv.S 25 May 2005 23:05:52 -0000 1.1 +++ udiv.S 26 Sep 2005 19:15:17 -0000 1.2 @@ -50,7 +50,7 @@ #define DIVISOR 8(%ap) ENTRY(__udiv) - .word 0x02 # save R2 + .word 0x04 # save R2 movl DIVISOR,%r2 jlss Leasy # big divisor: settle by comparison movl DIVIDEND,%r0 |