1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
|
/**********************************************
THIS FILE WAS AUTOMATICALLY GENERATED, AND MAY
BE AUTOMATICALLY RE-GENERATED WHEN THE COMPILER
OR SOURCE CHANGES. DO NOT MODIFY THIS FILE BY HAND!
RScheme Build (v0.7.2, 97.12.21)
**********************************************/
/******************************** Preamble ********************************/
#define _MODULE_LOW_SCHEME
#define _SCM_VECTOPS
#define _C_VECTOPS
#include "low_sch1.h"
#include <rscheme/vinsns.h>
extern struct module_descr module_low_scheme;
extern struct part_descr low_scheme_part_vectops;
static char sccsid[] = "@(#)low-scheme modules/lowscm/vectops.scm[380760070] (RS v0.7.2, 97.12.21)";
/************************** Function Definitions **************************/
/*********************** Raw glue `vector-bool-op' ***********************/
#define vec1 REG0
#define vec2 REG1
#define op REG2
#define newv REG3
static char rsfn_vector_bool_op_name[] = "vector-bool-op";
#define FUNCTION rsfn_vector_bool_op_name
PROLOGUE(vector_bool_op)
BEGIN_FWD(vector_bool_op)
FWD_MONOTONE(vector_bool_op_0)
END_FWD(vector_bool_op)
#define FPLACE_CODE (1000+0)
MONOTONE(vector_bool_op_0)
{
char c;
int b, opcode = fx2int(op);
UINT_32 i, len;
obj dest;
COUNT_ARGS(4);
if(!(VECTOR_P(vec1) && VECTOR_P(vec2)
&& OBJ_ISA_FIXNUM(op) && OBJ_ISA_BOOLEAN(newv)))
{
scheme_error( "vector-bool-op: bad arg", 0 );
}
len = SIZEOF_PTR(vec1);
if (SIZEOF_PTR(vec2) < len)
len = SIZEOF_PTR(vec2);
if (truish(newv))
dest = alloc( len, vector_class );
else
dest = vec1;
for (i=0; i<len; i+=SLOT(1))
{
if (EQ(gvec_read(vec1,i),FALSE_OBJ))
{
if (EQ(gvec_read(vec2,i),FALSE_OBJ))
b = opcode & 1;
else
b = opcode & 2;
}
else
{
if (EQ(gvec_read(vec2,i),FALSE_OBJ))
b = opcode & 4;
else
b = opcode & 8;
}
if (truish(newv))
gvec_write_init_non_ptr( dest, i, b ? TRUE_OBJ : FALSE_OBJ );
else
gvec_write_non_ptr( dest, i, b ? TRUE_OBJ : FALSE_OBJ );
}
REG0 = dest;
RETURN(1);
}
#undef FPLACE_CODE
EPILOGUE(vector_bool_op)
BEGIN_BACK(vector_bool_op)
BACK_MONOTONE(vector_bool_op_0)
END_BACK(vector_bool_op)
static struct function_descr vector_bool_op_descr = {
&low_scheme_part_vectops,
JUMP_TABLE( vector_bool_op ),
rsfn_vector_bool_op_name };
#undef FUNCTION
#undef vec1
#undef vec2
#undef op
#undef newv
/**************************** Function `vassq' ****************************/
static char rsfn_vassq_name[] = "vassq";
#define FUNCTION rsfn_vassq_name
PROLOGUE(vassq)
BEGIN_FWD(vassq)
FWD_MONOTONE(vassq_0)
FWD_MONOTONE(vassq_1)
END_FWD(vassq)
#define FPLACE_CODE (1000+0)
MONOTONE(vassq_0)
{
COUNT_ARGS(2);
/* NOP: REG1 = REG1; */
/* NOP: REG0 = REG0; */
CHECK_VECTOR(REG1 /* v */);
REG2 = SUB1(RIBYTES_TO_FXWORDS(SIZEOF_PTR(REG1 /* v */)));
REG3 = int2fx(0);
JUMP(4,vassq_1);
}
#undef FPLACE_CODE
#define FPLACE_CODE (1000+1)
MONOTONE(vassq_1)
{
/* NOP: REG3 = REG3; */
if (FX_LT(REG3 /* i */,REG2 /* n */))
{
if (EQ(gvec_ref(REG1 /* v */,FXWORDS_TO_RIBYTES(REG3 /* i */)),REG0 /* key */))
{
REG0 = ADD1(REG3 /* i */);
RETURN1();
}
else
{
REG4 = FX_ADD(REG3 /* i */,int2fx(2));
REG3 = REG4;
BJUMP(4,vassq_1);
}
}
else
{
REG0 = FALSE_OBJ;
RETURN1();
}
}
#undef FPLACE_CODE
EPILOGUE(vassq)
BEGIN_BACK(vassq)
BACK_MONOTONE(vassq_0)
BACK_MONOTONE(vassq_1)
END_BACK(vassq)
static struct function_descr vassq_descr = {
&low_scheme_part_vectops,
JUMP_TABLE( vassq ),
rsfn_vassq_name };
#undef FUNCTION
/**************************** Function `vmemq' ****************************/
static char rsfn_vmemq_name[] = "vmemq";
#define FUNCTION rsfn_vmemq_name
PROLOGUE(vmemq)
BEGIN_FWD(vmemq)
FWD_MONOTONE(vmemq_0)
FWD_MONOTONE(vmemq_1)
END_FWD(vmemq)
#define FPLACE_CODE (1000+0)
MONOTONE(vmemq_0)
{
COUNT_ARGS(2);
/* NOP: REG1 = REG1; */
/* NOP: REG0 = REG0; */
CHECK_VECTOR(REG1 /* v */);
REG2 = RIBYTES_TO_FXWORDS(SIZEOF_PTR(REG1 /* v */));
REG3 = int2fx(0);
JUMP(4,vmemq_1);
}
#undef FPLACE_CODE
#define FPLACE_CODE (1000+1)
MONOTONE(vmemq_1)
{
/* NOP: REG3 = REG3; */
if (EQ(REG3 /* i */,REG2 /* n */))
{
REG0 = FALSE_OBJ;
RETURN1();
}
else
{
if (EQ(vector_ref(REG1 /* v */,REG3 /* i */),REG0 /* key */))
{
REG0 = REG3 /* i */;
RETURN1();
}
else
{
REG4 = ADD1(REG3 /* i */);
REG3 = REG4;
BJUMP(4,vmemq_1);
}
}
}
#undef FPLACE_CODE
EPILOGUE(vmemq)
BEGIN_BACK(vmemq)
BACK_MONOTONE(vmemq_0)
BACK_MONOTONE(vmemq_1)
END_BACK(vmemq)
static struct function_descr vmemq_descr = {
&low_scheme_part_vectops,
JUMP_TABLE( vmemq ),
rsfn_vmemq_name };
#undef FUNCTION
/******************************* Postamble *******************************/
/**************************** Part Link Table ****************************/
static struct function_descr *(part_vectops_tab[]) = {
&vector_bool_op_descr,
&vassq_descr,
&vmemq_descr,
NULL };
struct part_descr low_scheme_part_vectops = {
380760070,
&module_low_scheme,
part_vectops_tab,
"vectops",
0 };
#undef _MODULE_LOW_SCHEME
#undef _SCM_VECTOPS
#undef _C_VECTOPS
|