diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-16 21:47:07 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-16 21:47:07 +0000 |
commit | 2ee6cfdbdb2b050dfc101271023a91e33998808b (patch) | |
tree | c398b887195322f1d38d190de46657c45b212975 /libgcc/config/rl78 | |
parent | aa99c148e08af989a7ca215dac6b10e5cc0fd9ce (diff) | |
download | gcc-2ee6cfdbdb2b050dfc101271023a91e33998808b.tar.gz |
* config/rl78/divmodqi.S: Return 0x00 by default for div by 0.
* config/rl78/divmodsi.S: Update return register to r8.
* config/rl78/divmodhi.S: Update return register to r8,r9.
Branch to main_loop_done_himode to pop registers before return.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228926 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/rl78')
-rw-r--r-- | libgcc/config/rl78/divmodhi.S | 4 | ||||
-rw-r--r-- | libgcc/config/rl78/divmodqi.S | 2 | ||||
-rw-r--r-- | libgcc/config/rl78/divmodsi.S | 7 |
3 files changed, 11 insertions, 2 deletions
diff --git a/libgcc/config/rl78/divmodhi.S b/libgcc/config/rl78/divmodhi.S index adf91e2c9e6..4340f1828e5 100644 --- a/libgcc/config/rl78/divmodhi.S +++ b/libgcc/config/rl78/divmodhi.S @@ -454,7 +454,11 @@ __generic_himod: movw ax, den cmpw ax, #0 bnz $den_not_zero\which + .if \need_result + movw quot, #0 + .else movw num, #0 + .endif ret den_not_zero\which: diff --git a/libgcc/config/rl78/divmodqi.S b/libgcc/config/rl78/divmodqi.S index b505336bee0..667923809fb 100644 --- a/libgcc/config/rl78/divmodqi.S +++ b/libgcc/config/rl78/divmodqi.S @@ -63,7 +63,7 @@ num_eq_den\which: ret den_is_zero\which: - mov r8, #0xff + mov r8, #0x00 ret ;; These routines leave DE alone - the signed functions use DE diff --git a/libgcc/config/rl78/divmodsi.S b/libgcc/config/rl78/divmodsi.S index 987a9e31126..94bad1e6ca0 100644 --- a/libgcc/config/rl78/divmodsi.S +++ b/libgcc/config/rl78/divmodsi.S @@ -688,9 +688,14 @@ __generic_simod: or a, denB3 ; not x cmpw ax, #0 bnz $den_not_zero\which + .if \need_result + movw quotL, #0 + movw quotH, #0 + .else movw numL, #0 movw numH, #0 - ret + .endif + br $!main_loop_done_himode\which den_not_zero\which: .if \need_result |