spielwiese
Last change
on this file since c41230 was
c41230,
checked in by Wilfred Pohl <pohl@…>, 26 years ago
|
only for Metrowerks
git-svn-id: file:///usr/local/Singular/svn/trunk@1369 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
714 bytes
|
Line | |
---|
1 | #ifdef __MWERKS__ |
---|
2 | |
---|
3 | #include "imm.h" |
---|
4 | #include <stuff_64.h> |
---|
5 | |
---|
6 | InternalCF * imm_mul (InternalCF * lhs, InternalCF * rhs ) |
---|
7 | { |
---|
8 | int li = imm2int( lhs ), ri = imm2int( rhs ); |
---|
9 | Int_64 pr; |
---|
10 | |
---|
11 | if (li<0) |
---|
12 | { |
---|
13 | if (ri<0) |
---|
14 | mul_64(&pr, -li, -ri); |
---|
15 | else |
---|
16 | mul_64(&pr, -li, ri); |
---|
17 | } |
---|
18 | else |
---|
19 | { |
---|
20 | if (ri<0) |
---|
21 | mul_64(&pr, li, -ri); |
---|
22 | else |
---|
23 | mul_64(&pr, li, ri); |
---|
24 | } |
---|
25 | if (pr.hi || (pr.lo>MAXIMMEDIATE)) |
---|
26 | { |
---|
27 | InternalCF * res = CFFactory::basic( IntegerDomain, li, true ); |
---|
28 | return res->mulcoeff( rhs ); |
---|
29 | } |
---|
30 | else |
---|
31 | { |
---|
32 | int res = pr.lo; |
---|
33 | if ((li>0) == (ri>0)) |
---|
34 | return int2imm(res); |
---|
35 | else |
---|
36 | return int2imm(-res); |
---|
37 | } |
---|
38 | } |
---|
39 | |
---|
40 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.