diff options
author | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
commit | be8b04496302184c6e8f04d6179f9c3afc50aeb6 (patch) | |
tree | 726e2468c0c07add773c0dbd86ab6386844259ae /gcc/config/mn10200/divmod.c |
initial commit
Diffstat (limited to 'gcc/config/mn10200/divmod.c')
-rwxr-xr-x | gcc/config/mn10200/divmod.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc/config/mn10200/divmod.c b/gcc/config/mn10200/divmod.c new file mode 100755 index 0000000..6faa091 --- /dev/null +++ b/gcc/config/mn10200/divmod.c @@ -0,0 +1,50 @@ +long udivmodsi4 (); + +long +__divsi3 (long a, long b) +{ + int neg = 0; + long res; + + if (a < 0) + { + a = -a; + neg = !neg; + } + + if (b < 0) + { + b = -b; + neg = !neg; + } + + res = udivmodsi4 (a, b, 0); + + if (neg) + res = -res; + + return res; +} + +long +__modsi3 (long a, long b) +{ + int neg = 0; + long res; + + if (a < 0) + { + a = -a; + neg = 1; + } + + if (b < 0) + b = -b; + + res = udivmodsi4 (a, b, 1); + + if (neg) + res = -res; + + return res; +} |