ops_template.h 13.1 KB
Newer Older
B
bellard 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 *  i386 micro operations (included several times to generate
 *  different operand sizes)
 * 
 *  Copyright (c) 2003 Fabrice Bellard
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#define DATA_BITS (1 << (3 + SHIFT))
#define SHIFT_MASK (DATA_BITS - 1)
B
bellard 已提交
23 24 25 26 27 28
#define SIGN_MASK (((target_ulong)1) << (DATA_BITS - 1))
#if DATA_BITS <= 32
#define SHIFT1_MASK 0x1f
#else
#define SHIFT1_MASK 0x3f
#endif
B
bellard 已提交
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

#if DATA_BITS == 8
#define SUFFIX b
#define DATA_TYPE uint8_t
#define DATA_STYPE int8_t
#define DATA_MASK 0xff
#elif DATA_BITS == 16
#define SUFFIX w
#define DATA_TYPE uint16_t
#define DATA_STYPE int16_t
#define DATA_MASK 0xffff
#elif DATA_BITS == 32
#define SUFFIX l
#define DATA_TYPE uint32_t
#define DATA_STYPE int32_t
#define DATA_MASK 0xffffffff
B
bellard 已提交
45 46 47 48 49
#elif DATA_BITS == 64
#define SUFFIX q
#define DATA_TYPE uint64_t
#define DATA_STYPE int64_t
#define DATA_MASK 0xffffffffffffffff
B
bellard 已提交
50 51 52 53 54 55 56 57 58
#else
#error unhandled operand size
#endif

/* dynamic flags computation */

static int glue(compute_all_add, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
B
bellard 已提交
59
    target_long src1, src2;
B
bellard 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72
    src1 = CC_SRC;
    src2 = CC_DST - CC_SRC;
    cf = (DATA_TYPE)CC_DST < (DATA_TYPE)src1;
    pf = parity_table[(uint8_t)CC_DST];
    af = (CC_DST ^ src1 ^ src2) & 0x10;
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    of = lshift((src1 ^ src2 ^ -1) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O;
    return cf | pf | af | zf | sf | of;
}

static int glue(compute_c_add, SUFFIX)(void)
{
B
bellard 已提交
73 74
    int cf;
    target_long src1;
B
bellard 已提交
75 76 77 78 79 80 81 82
    src1 = CC_SRC;
    cf = (DATA_TYPE)CC_DST < (DATA_TYPE)src1;
    return cf;
}

static int glue(compute_all_adc, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
B
bellard 已提交
83
    target_long src1, src2;
B
bellard 已提交
84 85 86 87 88 89 90 91 92 93 94 95 96
    src1 = CC_SRC;
    src2 = CC_DST - CC_SRC - 1;
    cf = (DATA_TYPE)CC_DST <= (DATA_TYPE)src1;
    pf = parity_table[(uint8_t)CC_DST];
    af = (CC_DST ^ src1 ^ src2) & 0x10;
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    of = lshift((src1 ^ src2 ^ -1) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O;
    return cf | pf | af | zf | sf | of;
}

static int glue(compute_c_adc, SUFFIX)(void)
{
B
bellard 已提交
97 98
    int cf;
    target_long src1;
B
bellard 已提交
99 100 101 102 103 104 105 106
    src1 = CC_SRC;
    cf = (DATA_TYPE)CC_DST <= (DATA_TYPE)src1;
    return cf;
}

static int glue(compute_all_sub, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
B
bellard 已提交
107
    target_long src1, src2;
B
bellard 已提交
108 109 110 111 112 113 114 115 116 117 118 119 120
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;
    cf = (DATA_TYPE)src1 < (DATA_TYPE)src2;
    pf = parity_table[(uint8_t)CC_DST];
    af = (CC_DST ^ src1 ^ src2) & 0x10;
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    of = lshift((src1 ^ src2) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O;
    return cf | pf | af | zf | sf | of;
}

static int glue(compute_c_sub, SUFFIX)(void)
{
B
bellard 已提交
121 122
    int cf;
    target_long src1, src2;
B
bellard 已提交
123 124 125 126 127 128 129 130 131
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;
    cf = (DATA_TYPE)src1 < (DATA_TYPE)src2;
    return cf;
}

static int glue(compute_all_sbb, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
B
bellard 已提交
132
    target_long src1, src2;
B
bellard 已提交
133 134 135 136 137 138 139 140 141 142 143 144 145
    src1 = CC_DST + CC_SRC + 1;
    src2 = CC_SRC;
    cf = (DATA_TYPE)src1 <= (DATA_TYPE)src2;
    pf = parity_table[(uint8_t)CC_DST];
    af = (CC_DST ^ src1 ^ src2) & 0x10;
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    of = lshift((src1 ^ src2) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O;
    return cf | pf | af | zf | sf | of;
}

static int glue(compute_c_sbb, SUFFIX)(void)
{
B
bellard 已提交
146 147
    int cf;
    target_long src1, src2;
B
bellard 已提交
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
    src1 = CC_DST + CC_SRC + 1;
    src2 = CC_SRC;
    cf = (DATA_TYPE)src1 <= (DATA_TYPE)src2;
    return cf;
}

static int glue(compute_all_logic, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
    cf = 0;
    pf = parity_table[(uint8_t)CC_DST];
    af = 0;
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    of = 0;
    return cf | pf | af | zf | sf | of;
}

static int glue(compute_c_logic, SUFFIX)(void)
{
    return 0;
}

static int glue(compute_all_inc, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
B
bellard 已提交
174
    target_long src1, src2;
B
bellard 已提交
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
    src1 = CC_DST - 1;
    src2 = 1;
    cf = CC_SRC;
    pf = parity_table[(uint8_t)CC_DST];
    af = (CC_DST ^ src1 ^ src2) & 0x10;
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    of = ((CC_DST & DATA_MASK) == SIGN_MASK) << 11;
    return cf | pf | af | zf | sf | of;
}

#if DATA_BITS == 32
static int glue(compute_c_inc, SUFFIX)(void)
{
    return CC_SRC;
}
#endif

static int glue(compute_all_dec, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
B
bellard 已提交
196
    target_long src1, src2;
B
bellard 已提交
197 198 199 200 201 202 203
    src1 = CC_DST + 1;
    src2 = 1;
    cf = CC_SRC;
    pf = parity_table[(uint8_t)CC_DST];
    af = (CC_DST ^ src1 ^ src2) & 0x10;
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
B
bellard 已提交
204
    of = ((CC_DST & DATA_MASK) == ((target_ulong)SIGN_MASK - 1)) << 11;
B
bellard 已提交
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
    return cf | pf | af | zf | sf | of;
}

static int glue(compute_all_shl, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
    cf = (CC_SRC >> (DATA_BITS - 1)) & CC_C;
    pf = parity_table[(uint8_t)CC_DST];
    af = 0; /* undefined */
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    /* of is defined if shift count == 1 */
    of = lshift(CC_SRC ^ CC_DST, 12 - DATA_BITS) & CC_O;
    return cf | pf | af | zf | sf | of;
}

static int glue(compute_c_shl, SUFFIX)(void)
{
    return (CC_SRC >> (DATA_BITS - 1)) & CC_C;
}

#if DATA_BITS == 32
static int glue(compute_c_sar, SUFFIX)(void)
{
    return CC_SRC & 1;
}
#endif

static int glue(compute_all_sar, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
    cf = CC_SRC & 1;
    pf = parity_table[(uint8_t)CC_DST];
    af = 0; /* undefined */
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    /* of is defined if shift count == 1 */
    of = lshift(CC_SRC ^ CC_DST, 12 - DATA_BITS) & CC_O; 
    return cf | pf | af | zf | sf | of;
}

B
bellard 已提交
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
#if DATA_BITS == 32
static int glue(compute_c_mul, SUFFIX)(void)
{
    int cf;
    cf = (CC_SRC != 0);
    return cf;
}
#endif

/* NOTE: we compute the flags like the P4. On olders CPUs, only OF and
   CF are modified and it is slower to do that. */
static int glue(compute_all_mul, SUFFIX)(void)
{
    int cf, pf, af, zf, sf, of;
    cf = (CC_SRC != 0);
    pf = parity_table[(uint8_t)CC_DST];
    af = 0; /* undefined */
    zf = ((DATA_TYPE)CC_DST == 0) << 6;
    sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
    of = cf << 11;
    return cf | pf | af | zf | sf | of;
}

B
bellard 已提交
269 270 271 272
/* various optimized jumps cases */

void OPPROTO glue(op_jb_sub, SUFFIX)(void)
{
B
bellard 已提交
273
    target_long src1, src2;
B
bellard 已提交
274 275 276 277
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    if ((DATA_TYPE)src1 < (DATA_TYPE)src2)
B
bellard 已提交
278
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
279 280 281 282 283 284
    FORCE_RET();
}

void OPPROTO glue(op_jz_sub, SUFFIX)(void)
{
    if ((DATA_TYPE)CC_DST == 0)
B
bellard 已提交
285 286 287 288 289 290 291 292
        GOTO_LABEL_PARAM(1);
    FORCE_RET();
}

void OPPROTO glue(op_jnz_sub, SUFFIX)(void)
{
    if ((DATA_TYPE)CC_DST != 0)
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
293 294 295 296 297
    FORCE_RET();
}

void OPPROTO glue(op_jbe_sub, SUFFIX)(void)
{
B
bellard 已提交
298
    target_long src1, src2;
B
bellard 已提交
299 300 301 302
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    if ((DATA_TYPE)src1 <= (DATA_TYPE)src2)
B
bellard 已提交
303
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
304 305 306 307 308 309
    FORCE_RET();
}

void OPPROTO glue(op_js_sub, SUFFIX)(void)
{
    if (CC_DST & SIGN_MASK)
B
bellard 已提交
310
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
311 312 313 314 315
    FORCE_RET();
}

void OPPROTO glue(op_jl_sub, SUFFIX)(void)
{
B
bellard 已提交
316
    target_long src1, src2;
B
bellard 已提交
317 318 319 320
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    if ((DATA_STYPE)src1 < (DATA_STYPE)src2)
B
bellard 已提交
321
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
322 323 324 325 326
    FORCE_RET();
}

void OPPROTO glue(op_jle_sub, SUFFIX)(void)
{
B
bellard 已提交
327
    target_long src1, src2;
B
bellard 已提交
328 329 330 331
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    if ((DATA_STYPE)src1 <= (DATA_STYPE)src2)
B
bellard 已提交
332
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
333 334 335 336 337 338 339 340 341 342 343
    FORCE_RET();
}

/* oldies */

#if DATA_BITS >= 16

void OPPROTO glue(op_loopnz, SUFFIX)(void)
{
    int eflags;
    eflags = cc_table[CC_OP].compute_all();
B
bellard 已提交
344 345
    if ((DATA_TYPE)ECX != 0 && !(eflags & CC_Z))
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
346 347 348 349 350 351 352
    FORCE_RET();
}

void OPPROTO glue(op_loopz, SUFFIX)(void)
{
    int eflags;
    eflags = cc_table[CC_OP].compute_all();
B
bellard 已提交
353 354
    if ((DATA_TYPE)ECX != 0 && (eflags & CC_Z))
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
355 356 357
    FORCE_RET();
}

B
bellard 已提交
358
void OPPROTO glue(op_jz_ecx, SUFFIX)(void)
B
bellard 已提交
359
{
B
bellard 已提交
360 361
    if ((DATA_TYPE)ECX == 0)
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
362 363 364
    FORCE_RET();
}

B
bellard 已提交
365
void OPPROTO glue(op_jnz_ecx, SUFFIX)(void)
B
bellard 已提交
366
{
B
bellard 已提交
367 368
    if ((DATA_TYPE)ECX != 0)
        GOTO_LABEL_PARAM(1);
B
bellard 已提交
369 370 371 372 373 374 375 376 377
    FORCE_RET();
}

#endif

/* various optimized set cases */

void OPPROTO glue(op_setb_T0_sub, SUFFIX)(void)
{
B
bellard 已提交
378
    target_long src1, src2;
B
bellard 已提交
379 380 381 382 383 384 385 386 387 388 389 390 391
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    T0 = ((DATA_TYPE)src1 < (DATA_TYPE)src2);
}

void OPPROTO glue(op_setz_T0_sub, SUFFIX)(void)
{
    T0 = ((DATA_TYPE)CC_DST == 0);
}

void OPPROTO glue(op_setbe_T0_sub, SUFFIX)(void)
{
B
bellard 已提交
392
    target_long src1, src2;
B
bellard 已提交
393 394 395 396 397 398 399 400 401 402 403 404 405
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    T0 = ((DATA_TYPE)src1 <= (DATA_TYPE)src2);
}

void OPPROTO glue(op_sets_T0_sub, SUFFIX)(void)
{
    T0 = lshift(CC_DST, -(DATA_BITS - 1)) & 1;
}

void OPPROTO glue(op_setl_T0_sub, SUFFIX)(void)
{
B
bellard 已提交
406
    target_long src1, src2;
B
bellard 已提交
407 408 409 410 411 412 413 414
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    T0 = ((DATA_STYPE)src1 < (DATA_STYPE)src2);
}

void OPPROTO glue(op_setle_T0_sub, SUFFIX)(void)
{
B
bellard 已提交
415
    target_long src1, src2;
B
bellard 已提交
416 417 418 419 420 421 422 423 424 425 426
    src1 = CC_DST + CC_SRC;
    src2 = CC_SRC;

    T0 = ((DATA_STYPE)src1 <= (DATA_STYPE)src2);
}

/* shifts */

void OPPROTO glue(glue(op_shl, SUFFIX), _T0_T1)(void)
{
    int count;
B
bellard 已提交
427
    count = T1 & SHIFT1_MASK;
B
bellard 已提交
428 429 430 431 432 433 434
    T0 = T0 << count;
    FORCE_RET();
}

void OPPROTO glue(glue(op_shr, SUFFIX), _T0_T1)(void)
{
    int count;
B
bellard 已提交
435
    count = T1 & SHIFT1_MASK;
B
bellard 已提交
436 437 438 439 440 441 442
    T0 &= DATA_MASK;
    T0 = T0 >> count;
    FORCE_RET();
}

void OPPROTO glue(glue(op_sar, SUFFIX), _T0_T1)(void)
{
B
bellard 已提交
443 444 445 446
    int count;
    target_long src;

    count = T1 & SHIFT1_MASK;
B
bellard 已提交
447 448 449 450 451 452 453 454
    src = (DATA_STYPE)T0;
    T0 = src >> count;
    FORCE_RET();
}

#undef MEM_WRITE
#include "ops_template_mem.h"

455
#define MEM_WRITE 0
B
bellard 已提交
456 457
#include "ops_template_mem.h"

458 459 460 461 462 463 464 465
#if !defined(CONFIG_USER_ONLY)
#define MEM_WRITE 1
#include "ops_template_mem.h"

#define MEM_WRITE 2
#include "ops_template_mem.h"
#endif

B
bellard 已提交
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
/* bit operations */
#if DATA_BITS >= 16

void OPPROTO glue(glue(op_bt, SUFFIX), _T0_T1_cc)(void)
{
    int count;
    count = T1 & SHIFT_MASK;
    CC_SRC = T0 >> count;
}

void OPPROTO glue(glue(op_bts, SUFFIX), _T0_T1_cc)(void)
{
    int count;
    count = T1 & SHIFT_MASK;
    T1 = T0 >> count;
B
bellard 已提交
481
    T0 |= (((target_long)1) << count);
B
bellard 已提交
482 483 484 485 486 487 488
}

void OPPROTO glue(glue(op_btr, SUFFIX), _T0_T1_cc)(void)
{
    int count;
    count = T1 & SHIFT_MASK;
    T1 = T0 >> count;
B
bellard 已提交
489
    T0 &= ~(((target_long)1) << count);
B
bellard 已提交
490 491 492 493 494 495 496
}

void OPPROTO glue(glue(op_btc, SUFFIX), _T0_T1_cc)(void)
{
    int count;
    count = T1 & SHIFT_MASK;
    T1 = T0 >> count;
B
bellard 已提交
497 498 499 500 501 502
    T0 ^= (((target_long)1) << count);
}

void OPPROTO glue(glue(op_add_bit, SUFFIX), _A0_T1)(void)
{
    A0 += ((DATA_STYPE)T1 >> (3 + SHIFT)) << SHIFT;
B
bellard 已提交
503 504 505 506
}

void OPPROTO glue(glue(op_bsf, SUFFIX), _T0_cc)(void)
{
B
bellard 已提交
507 508 509
    int count;
    target_long res;
    
B
bellard 已提交
510 511 512 513 514 515 516
    res = T0 & DATA_MASK;
    if (res != 0) {
        count = 0;
        while ((res & 1) == 0) {
            count++;
            res >>= 1;
        }
B
bellard 已提交
517
        T1 = count;
B
bellard 已提交
518
        CC_DST = 1; /* ZF = 0 */
B
bellard 已提交
519 520 521 522 523 524 525 526
    } else {
        CC_DST = 0; /* ZF = 1 */
    }
    FORCE_RET();
}

void OPPROTO glue(glue(op_bsr, SUFFIX), _T0_cc)(void)
{
B
bellard 已提交
527 528 529
    int count;
    target_long res;

B
bellard 已提交
530 531 532 533 534 535 536
    res = T0 & DATA_MASK;
    if (res != 0) {
        count = DATA_BITS - 1;
        while ((res & SIGN_MASK) == 0) {
            count--;
            res <<= 1;
        }
B
bellard 已提交
537
        T1 = count;
B
bellard 已提交
538
        CC_DST = 1; /* ZF = 0 */
B
bellard 已提交
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
    } else {
        CC_DST = 0; /* ZF = 1 */
    }
    FORCE_RET();
}

#endif

#if DATA_BITS == 32
void OPPROTO op_update_bt_cc(void)
{
    CC_SRC = T1;
}
#endif

/* string operations */

void OPPROTO glue(op_movl_T0_Dshift, SUFFIX)(void)
{
    T0 = DF << SHIFT;
}

/* port I/O */
B
bellard 已提交
562
#if DATA_BITS <= 32
B
bellard 已提交
563 564
void OPPROTO glue(glue(op_out, SUFFIX), _T0_T1)(void)
{
B
bellard 已提交
565
    glue(cpu_out, SUFFIX)(env, T0, T1 & DATA_MASK);
B
bellard 已提交
566 567 568 569
}

void OPPROTO glue(glue(op_in, SUFFIX), _T0_T1)(void)
{
B
bellard 已提交
570
    T1 = glue(cpu_in, SUFFIX)(env, T0);
B
bellard 已提交
571 572 573 574
}

void OPPROTO glue(glue(op_in, SUFFIX), _DX_T0)(void)
{
B
bellard 已提交
575
    T0 = glue(cpu_in, SUFFIX)(env, EDX & 0xffff);
B
bellard 已提交
576 577 578 579
}

void OPPROTO glue(glue(op_out, SUFFIX), _DX_T0)(void)
{
B
bellard 已提交
580
    glue(cpu_out, SUFFIX)(env, EDX & 0xffff, T0);
B
bellard 已提交
581 582
}

B
bellard 已提交
583 584 585 586 587 588 589 590 591
void OPPROTO glue(glue(op_check_io, SUFFIX), _T0)(void)
{
    glue(glue(check_io, SUFFIX), _T0)();
}

void OPPROTO glue(glue(op_check_io, SUFFIX), _DX)(void)
{
    glue(glue(check_io, SUFFIX), _DX)();
}
B
bellard 已提交
592
#endif
B
bellard 已提交
593

B
bellard 已提交
594 595
#undef DATA_BITS
#undef SHIFT_MASK
B
bellard 已提交
596
#undef SHIFT1_MASK
B
bellard 已提交
597 598 599 600 601
#undef SIGN_MASK
#undef DATA_TYPE
#undef DATA_STYPE
#undef DATA_MASK
#undef SUFFIX