Source

hotpy_2 / Include / register_macros.h

Full commit
#define FORMAT_ID_E 0
#define FORMAT_ID_K 1
#define FORMAT_ID_kkK 2
#define FORMAT_ID_o 3
#define FORMAT_ID_oK 4
#define FORMAT_ID_oKE 5
#define FORMAT_ID_oKKK 6
#define FORMAT_ID_oo 7
#define FORMAT_ID_p 8
#define FORMAT_ID_r 9
#define FORMAT_ID_rE 10
#define FORMAT_ID_rK 11
#define FORMAT_ID_rKE 12
#define FORMAT_ID_rKKE 13
#define FORMAT_ID_ro 14
#define FORMAT_ID_roK 15
#define FORMAT_ID_roKE 16
#define FORMAT_ID_rok 17
#define FORMAT_ID_rokE 18
#define FORMAT_ID_rokk 19
#define FORMAT_ID_rokkkE 20
#define FORMAT_ID_roo 21
#define FORMAT_ID_rr 22
#define FORMAT_ID_rrE 23
#define FORMAT_ID_rrK 24
#define FORMAT_ID_rrKE 25
#define FORMAT_ID_rrk 26
#define FORMAT_ID_rrkkk 27
#define FORMAT_ID_rro 28
#define FORMAT_ID_rroE 29
#define FORMAT_ID_rroK 30
#define FORMAT_ID_rroKE 31
#define FORMAT_ID_rrok 32
#define FORMAT_ID_rroo 33
#define FORMAT_ID_rrooE 34
#define FORMAT_ID_rroooE 35
#define FORMAT_ID_rrr 36
#define FORMAT_ID_rrrKE 37
#define FORMAT_ID_rrro 38
#define FORMAT_ID_rrroE 39
#define FORMAT_ID_rrrokE 40

#define FORMAT_E \
    int e0; \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-1] & 255, "E"))

#define FORMAT_K \
    int k0; \
    k0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-1] & 255, "K"))

#define FORMAT_kkK \
    int k0, k1, k2; \
    k0 = (instruction_word >> 8) & 255; \
    k1 = (instruction_word >> 16) & 255; \
    instruction_word = *next_instr++; \
    k2 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "kkK"))

#define FORMAT_o \
    int r0; \
    r0 = (instruction_word >> 8) & 255; \
    assert(consistent_format(next_instr[-1] & 255, "o"))

#define FORMAT_oK \
    int r0, k0; \
    r0 = (instruction_word >> 8) & 255; \
    k0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-1] & 255, "oK"))

#define FORMAT_oKE \
    int r0, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    k0 = instruction_word >> 16; \
    instruction_word = *next_instr++; \
    e0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "oKE"))

#define FORMAT_oKKK \
    int r0, k0, k1, k2; \
    r0 = (instruction_word >> 8) & 255; \
    k0 = instruction_word >> 16; \
    instruction_word = *next_instr++; \
    k1 = instruction_word & ((1 << 16)-1); \
    k2 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "oKKK"))

#define FORMAT_oo \
    int r0, r1; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    assert(consistent_format(next_instr[-1] & 255, "oo"))

#define FORMAT_p \
    int r0; \
    r0 = (instruction_word >> 8) & 255; \
    assert(consistent_format(next_instr[-1] & 255, "p"))

#define FORMAT_r \
    int r0; \
    r0 = (instruction_word >> 8) & 255; \
    assert(consistent_format(next_instr[-1] & 255, "r"))

#define FORMAT_rE \
    int r0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-1] & 255, "rE"))

#define FORMAT_rK \
    int r0, k0; \
    r0 = (instruction_word >> 8) & 255; \
    k0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-1] & 255, "rK"))

#define FORMAT_rKE \
    int r0, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    k0 = instruction_word >> 16; \
    instruction_word = *next_instr++; \
    e0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "rKE"))

#define FORMAT_rKKE \
    int r0, k0, k1, e0; \
    r0 = (instruction_word >> 8) & 255; \
    k0 = instruction_word >> 16; \
    instruction_word = *next_instr++; \
    k1 = instruction_word & ((1 << 16)-1); \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rKKE"))

#define FORMAT_ro \
    int r0, r1; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    assert(consistent_format(next_instr[-1] & 255, "ro"))

#define FORMAT_roK \
    int r0, r1, k0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    instruction_word = *next_instr++; \
    k0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "roK"))

#define FORMAT_roKE \
    int r0, r1, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    instruction_word = *next_instr++; \
    k0 = instruction_word & ((1 << 16)-1); \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "roKE"))

#define FORMAT_rok \
    int r0, r1, k0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    k0 = (instruction_word >> 24); \
    assert(consistent_format(next_instr[-1] & 255, "rok"))

#define FORMAT_rokE \
    int r0, r1, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    k0 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    e0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "rokE"))

#define FORMAT_rokk \
    int r0, r1, k0, k1; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    k0 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    k1 = instruction_word & 255; \
    assert(consistent_format(next_instr[-2] & 255, "rokk"))

#define FORMAT_rokkkE \
    int r0, r1, k0, k1, k2, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    k0 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    k1 = instruction_word & 255; \
    k2 = (instruction_word >> 8) & 255; \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rokkkE"))

#define FORMAT_roo \
    int r0, r1, r2; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    assert(consistent_format(next_instr[-1] & 255, "roo"))

#define FORMAT_rr \
    int r0, r1; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    assert(consistent_format(next_instr[-1] & 255, "rr"))

#define FORMAT_rrE \
    int r0, r1, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    instruction_word = *next_instr++; \
    e0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "rrE"))

#define FORMAT_rrK \
    int r0, r1, k0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    instruction_word = *next_instr++; \
    k0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "rrK"))

#define FORMAT_rrKE \
    int r0, r1, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    instruction_word = *next_instr++; \
    k0 = instruction_word & ((1 << 16)-1); \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rrKE"))

#define FORMAT_rrk \
    int r0, r1, k0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    k0 = (instruction_word >> 24); \
    assert(consistent_format(next_instr[-1] & 255, "rrk"))

#define FORMAT_rrkkk \
    int r0, r1, k0, k1, k2; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    k0 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    k1 = instruction_word & 255; \
    k2 = (instruction_word >> 8) & 255; \
    assert(consistent_format(next_instr[-2] & 255, "rrkkk"))

#define FORMAT_rro \
    int r0, r1, r2; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    assert(consistent_format(next_instr[-1] & 255, "rro"))

#define FORMAT_rroE \
    int r0, r1, r2, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    e0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "rroE"))

#define FORMAT_rroK \
    int r0, r1, r2, k0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    k0 = instruction_word & ((1 << 16)-1); \
    assert(consistent_format(next_instr[-2] & 255, "rroK"))

#define FORMAT_rroKE \
    int r0, r1, r2, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    k0 = instruction_word & ((1 << 16)-1); \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rroKE"))

#define FORMAT_rrok \
    int r0, r1, r2, k0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    k0 = instruction_word & 255; \
    assert(consistent_format(next_instr[-2] & 255, "rrok"))

#define FORMAT_rroo \
    int r0, r1, r2, r3; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    r3 = instruction_word & 255; \
    assert(consistent_format(next_instr[-2] & 255, "rroo"))

#define FORMAT_rrooE \
    int r0, r1, r2, r3, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    r3 = instruction_word & 255; \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rrooE"))

#define FORMAT_rroooE \
    int r0, r1, r2, r3, r4, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    r3 = instruction_word & 255; \
    r4 = (instruction_word >> 8) & 255; \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rroooE"))

#define FORMAT_rrr \
    int r0, r1, r2; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    assert(consistent_format(next_instr[-1] & 255, "rrr"))

#define FORMAT_rrrKE \
    int r0, r1, r2, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    k0 = instruction_word & ((1 << 16)-1); \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rrrKE"))

#define FORMAT_rrro \
    int r0, r1, r2, r3; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    r3 = instruction_word & 255; \
    assert(consistent_format(next_instr[-2] & 255, "rrro"))

#define FORMAT_rrroE \
    int r0, r1, r2, r3, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    r3 = instruction_word & 255; \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rrroE"))

#define FORMAT_rrrokE \
    int r0, r1, r2, r3, k0, e0; \
    r0 = (instruction_word >> 8) & 255; \
    r1 = (instruction_word >> 16) & 255; \
    r2 = (instruction_word >> 24); \
    instruction_word = *next_instr++; \
    r3 = instruction_word & 255; \
    k0 = (instruction_word >> 8) & 255; \
    e0 = instruction_word >> 16; \
    assert(consistent_format(next_instr[-2] & 255, "rrrokE"))