// generated by rake gen __attribute__((__noinline__)) static VALUE bspec_exec(void** ip, char* s, VALUE a) { static void* opcodes[] = { &&BS_RET, &&BS_EXPECT8, &&BS_EXPECT16, &&BS_EXPECT32, &&BS_EXPECT64, &&BS_INT8, &&BS_UINT8, &&BS_INT16, &&BS_INT16_SWAP, &&BS_INT32, &&BS_INT32_SWAP, &&BS_INT64, &&BS_INT64_SWAP, &&BS_UINT16, &&BS_UINT16_SWAP, &&BS_UINT32, &&BS_UINT32_SWAP, &&BS_UINT64, &&BS_UINT64_SWAP, &&BS_SINGLE, &&BS_SINGLE_SWAP, &&BS_DOUBLE, &&BS_DOUBLE_SWAP }; if (ip == NULL) { return (VALUE)opcodes; } goto **(ip++); BS_RET: return a; BS_EXPECT8: { char* expect = (char*)(ip++); if (strncmp(s, expect, 1)) { return Qnil; } goto **(ip++); } BS_EXPECT16: { char* expect = (char*)(ip++); if (strncmp(s, expect, 2)) { return Qnil; } goto **(ip++); } BS_EXPECT32: { char* expect = (char*)(ip++); if (strncmp(s, expect, 4)) { return Qnil; } goto **(ip++); } BS_EXPECT64: { char* expect = (char*)(ip++); if (strncmp(s, expect, 8)) { return Qnil; } goto **(ip++); } BS_INT8: { uint8_t r = ((uint8_t*)s)[0]; rb_ary_push(a, INT2FIX(CAST(r, int8_t))); s += 1; goto **(ip++); } BS_UINT8: { uint8_t r = ((uint8_t*)s)[0]; rb_ary_push(a, INT2FIX(CAST(r, uint8_t))); s += 1; goto **(ip++); } BS_INT16: { uint16_t r = ((uint16_t*)s)[0]; rb_ary_push(a, INT2FIX(CAST(r, int16_t))); s += 2; goto **(ip++); } BS_INT16_SWAP: { uint16_t r = swap16(((uint16_t*)s)[0]); rb_ary_push(a, INT2FIX(CAST(r, int16_t))); s += 2; goto **(ip++); } BS_INT32: { uint32_t r = ((uint32_t*)s)[0]; rb_ary_push(a, INT2NUM(CAST(r, int32_t))); s += 4; goto **(ip++); } BS_INT32_SWAP: { uint32_t r = swap32(((uint32_t*)s)[0]); rb_ary_push(a, INT2NUM(CAST(r, int32_t))); s += 4; goto **(ip++); } BS_INT64: { uint64_t r = ((uint64_t*)s)[0]; rb_ary_push(a, INT64toNUM(CAST(r, int64_t))); s += 8; goto **(ip++); } BS_INT64_SWAP: { uint64_t r = swap64(((uint64_t*)s)[0]); rb_ary_push(a, INT64toNUM(CAST(r, int64_t))); s += 8; goto **(ip++); } BS_UINT16: { uint16_t r = ((uint16_t*)s)[0]; rb_ary_push(a, INT2FIX(CAST(r, uint16_t))); s += 2; goto **(ip++); } BS_UINT16_SWAP: { uint16_t r = swap16(((uint16_t*)s)[0]); rb_ary_push(a, INT2FIX(CAST(r, uint16_t))); s += 2; goto **(ip++); } BS_UINT32: { uint32_t r = ((uint32_t*)s)[0]; rb_ary_push(a, UINT64toNUM(r)); s += 4; goto **(ip++); } BS_UINT32_SWAP: { uint32_t r = swap32(((uint32_t*)s)[0]); rb_ary_push(a, UINT64toNUM(r)); s += 4; goto **(ip++); } BS_UINT64: { uint64_t r = ((uint64_t*)s)[0]; rb_ary_push(a, UINT64toNUM(r)); s += 8; goto **(ip++); } BS_UINT64_SWAP: { uint64_t r = swap64(((uint64_t*)s)[0]); rb_ary_push(a, UINT64toNUM(r)); s += 8; goto **(ip++); } BS_SINGLE: { uint32_t r = ((uint32_t*)s)[0]; rb_ary_push(a, DBL2NUM((double)CAST(r, float))); s += 4; goto **(ip++); } BS_SINGLE_SWAP: { uint32_t r = swap32(((uint32_t*)s)[0]); rb_ary_push(a, DBL2NUM((double)CAST(r, float))); s += 4; goto **(ip++); } BS_DOUBLE: { uint64_t r = ((uint64_t*)s)[0]; rb_ary_push(a, DBL2NUM(CAST(r, double))); s += 8; goto **(ip++); } BS_DOUBLE_SWAP: { uint64_t r = swap64(((uint64_t*)s)[0]); rb_ary_push(a, DBL2NUM(CAST(r, double))); s += 8; goto **(ip++); } }