| version 1.2, 2000/01/11 06:43:35 |
version 1.3, 2000/02/07 05:21:32 |
|
|
| /* $OpenXM: OpenXM_contrib2/asir2000/builtin/int.c,v 1.1.1.1 1999/12/03 07:39:07 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/builtin/int.c,v 1.2 2000/01/11 06:43:35 noro Exp $ */ |
| #include "ca.h" |
#include "ca.h" |
| #include "parse.h" |
#include "parse.h" |
| #include "base.h" |
#include "base.h" |
|
|
| USINT *rp; |
USINT *rp; |
| { |
{ |
| Q q; |
Q q; |
| |
unsigned int t; |
| |
|
| asir_assert(ARG0(arg),O_N,"ntoint32"); |
asir_assert(ARG0(arg),O_N,"ntoint32"); |
| q = (Q)ARG0(arg); |
q = (Q)ARG0(arg); |
|
|
| MKUSINT(*rp,0); |
MKUSINT(*rp,0); |
| return; |
return; |
| } |
} |
| if ( NID(q)!=N_Q || SGN(q)<0 || !INT(q) || PL(NM(q))>1 ) |
if ( NID(q)!=N_Q || !INT(q) || PL(NM(q))>1 ) |
| error("ntoint32 : invalid argument"); |
error("ntoint32 : invalid argument"); |
| MKUSINT(*rp,BD(NM(q))[0]); |
t = BD(NM(q))[0]; |
| |
if ( SGN(q) < 0 ) |
| |
t = -t; |
| |
MKUSINT(*rp,t); |
| } |
} |
| |
|
| void Pint32ton(arg,rp) |
void Pint32ton(arg,rp) |
| NODE arg; |
NODE arg; |
| Q *rp; |
Q *rp; |
| { |
{ |
| unsigned int t; |
int t; |
| |
|
| asir_assert(ARG0(arg),O_USINT,"int32ton"); |
asir_assert(ARG0(arg),O_USINT,"int32ton"); |
| t = BDY((USINT)ARG0(arg)); |
t = (int)BDY((USINT)ARG0(arg)); |
| UTOQ(t,*rp); |
STOQ(t,*rp); |
| } |
} |
| |
|
| void Pdp_set_mpi(arg,rp) |
void Pdp_set_mpi(arg,rp) |