text
stringlengths
9
39.2M
dir
stringlengths
25
226
lang
stringclasses
163 values
created_date
timestamp[s]
updated_date
timestamp[s]
repo_name
stringclasses
751 values
repo_full_name
stringclasses
752 values
star
int64
1.01k
183k
len_tokens
int64
1
18.5M
```objective-c uint32_t ropFLDs(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropFLDd(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropFSTs(codeblock_t *block, ir_data_t *ir, uint8_t opco...
/content/code_sandbox/src/codegen_new/codegen_ops_fpu_loadstore.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
605
```objective-c #ifndef _CODEGEN_H_ #define _CODEGEN_H_ #include <86box/mem.h> #include <stddef.h> #include "x86_ops.h" /*Handling self-modifying code (of which there is a lot on x86) : PCem tracks a 'dirty mask' for each physical page, in which each bit represents 64 bytes. This is only tracked for pages that ha...
/content/code_sandbox/src/codegen_new/codegen.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
3,267
```objective-c #include "codegen_backend_arm_defs.h" #define BLOCK_SIZE 0x4000 #define BLOCK_MASK 0x3fff #define BLOCK_START 0 #define HASH_SIZE 0x20000 #define HASH_MASK 0x1ffff #define HASH(l) ((l) &0x1ffff) #define BLOCK_MAX 0x3c0 void host_arm_ADD_IMM(codeblock_t *block, int dst_reg, int src_reg, u...
/content/code_sandbox/src/codegen_new/codegen_backend_arm.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
257
```c #if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_backend.h" # include "codegen_ba...
/content/code_sandbox/src/codegen_new/codegen_backend_arm_ops.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
15,894
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86seg_common.h" #include "x86seg.h" #include "x86_flags.h" #include "386_common.h" #include "codegen.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codegen...
/content/code_sandbox/src/codegen_new/codegen_ops_stack.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
4,833
```objective-c /*RBP = cpu_state + 128 R12 = ram (if block->flags & CODEBLOCK_NO_IMMEDIATES)*/ #define REG_AX 0 #define REG_CX 1 #define REG_DX 2 #define REG_BX 3 #define REG_SP 4 #define REG_BP 5 #define REG_SI 6 #defin...
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64_defs.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
492
```c #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86 # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_back...
/content/code_sandbox/src/codegen_new/codegen_backend_x86_ops.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
15,053
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86seg_common.h" #include "x86seg.h" #include "x86_flags.h" #include "386_common.h" #include "codegen.h" #include "codegen_backend.h" #include "codegen_ir.h" #include "cod...
/content/code_sandbox/src/codegen_new/codegen_ops_shift.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
13,737
```c #if defined __amd64__ || defined _M_X64 # include <stdint.h> # include <inttypes.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_backend.h" # include "code...
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64_ops.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
21,116
```objective-c #define COND_SHIFT 28 #define COND_EQ (0x0 << COND_SHIFT) #define COND_NE (0x1 << COND_SHIFT) #define COND_CS (0x2 << COND_SHIFT) #define COND_CC (0x3 << COND_SHIFT) #define COND_MI (0x4 << COND_SHIFT) #define COND_PL (0x5 << COND_SHIFT) #define COND_VS (0x6 << COND_SHIFT) #define CO...
/content/code_sandbox/src/codegen_new/codegen_backend_arm_ops.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
4,796
```objective-c void host_arm64_ADD_IMM(codeblock_t *block, int dst_reg, int src_n_reg, uint32_t imm_data); void host_arm64_ADD_REG(codeblock_t *block, int dst_reg, int src_n_reg, int src_m_reg, int shift); void host_arm64_ADD_REG_LSR(codeblock_t *block, int dst_reg, int src_n_reg, int src_m_reg, int shift); void host_a...
/content/code_sandbox/src/codegen_new/codegen_backend_arm64_ops.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
4,807
```objective-c uint32_t ropC0(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropC1_w(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropC1_l(codeblock_t *block, ir_data_t *ir, uint8_t opcode,...
/content/code_sandbox/src/codegen_new/codegen_ops_shift.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
565
```objective-c uint32_t ropFADD(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropFADDr(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropFADDP(codeblock_t *block, ir_data_t *ir, uint8_t opc...
/content/code_sandbox/src/codegen_new/codegen_ops_fpu_arith.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
2,596
```objective-c uint32_t ropFFREE(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropFLD(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropFST(codeblock_t *block, ir_data_t *ir, uint8_t opco...
/content/code_sandbox/src/codegen_new/codegen_ops_fpu_misc.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
342
```objective-c #include "386_common.h" #include "codegen_backend.h" static inline int LOAD_SP_WITH_OFFSET(ir_data_t *ir, int offset) { if (stack32) { if (offset) { uop_ADD_IMM(ir, IREG_eaaddr, IREG_ESP, offset); return IREG_eaaddr; } else return IREG_ESP; } e...
/content/code_sandbox/src/codegen_new/codegen_ops_helpers.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,194
```c #if defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__) # include <sys/mman.h> # include <unistd.h> # include <stdlib.h> #endif #if defined WIN32 || defined _WIN32 || defined _WIN32 # include <windows.h> #endif #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <86box/86box....
/content/code_sandbox/src/codegen_new/codegen_allocator.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
979
```objective-c #define JMP_LEN_BYTES 5 static inline void codegen_addbyte(UNUSED(codeblock_t *block), uint8_t val) { if (block_pos >= BLOCK_MAX) fatal("codegen_addbyte over! %i\n", block_pos); block_write_data[block_pos++] = val; } static inline void codegen_addbyte2(UNUSED(codeblock_t *block), uint8_t...
/content/code_sandbox/src/codegen_new/codegen_backend_x86_ops_helpers.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
816
```objective-c #include "codegen_ir_defs.h" ir_data_t *codegen_ir_init(void); void codegen_ir_set_unroll(int count, int start, int first_instruction); void codegen_ir_compile(ir_data_t *ir, codeblock_t *block); ```
/content/code_sandbox/src/codegen_new/codegen_ir.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
51
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codegen...
/content/code_sandbox/src/codegen_new/codegen_ops_arith.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
30,579
```c #if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM # include <stdint.h> # include <stdlib.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_backend.h" # include "codegen_backend_arm_d...
/content/code_sandbox/src/codegen_new/codegen_backend_arm.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
4,027
```objective-c #define REG_W0 0 #define REG_W1 1 #define REG_W2 2 #define REG_W3 3 #define REG_W4 4 #define REG_W5 5 #define REG_W6 6 #define REG_W7 7 #define REG_W8 8 #define REG_W9 ...
/content/code_sandbox/src/codegen_new/codegen_backend_arm64_defs.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
994
```c #include <stdio.h> #include <stdint.h> /*ARM64 logical instructions have an 'interesting' immediate encoding. All valid values are in the table below, which we perform a binary search over*/ #define IMM_NR 1302 static uint32_t imm_table[][2] = { { 0x800, 0x00000001}, { 0xfc0, 0x00000002}, { 0x801,...
/content/code_sandbox/src/codegen_new/codegen_backend_arm64_imm.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
19,160
```objective-c #ifndef _CODEGEN_REG_H_ #define _CODEGEN_REG_H_ #define IREG_REG_MASK 0xff #define IREG_SIZE_SHIFT 8 #define IREG_SIZE_MASK (7 << IREG_SIZE_SHIFT) #define IREG_GET_REG(reg) ((reg) &IREG_REG_MASK) #define IREG_GET_SIZE(reg) ((reg) &IREG_SIZE_MASK) #define IREG_SIZE_L (0 << IREG_SIZE...
/content/code_sandbox/src/codegen_new/codegen_reg.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
4,007
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_accumulate.h" #include "codegen_ir.h" #include "...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_logic.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,223
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codegen...
/content/code_sandbox/src/codegen_new/codegen_ops_logic.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
9,207
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "x87_sf.h" #include "x87.h" #include "codegen.h" #include "codegen_accumulate....
/content/code_sandbox/src/codegen_new/codegen_ops_fpu_arith.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
8,006
```c #if defined __amd64__ || defined _M_X64 # include <stdlib.h> # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_backend.h" # include "codegen_backend_x86-64_defs.h" # inclu...
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
4,161
```objective-c #include "codegen_backend_x86-64_defs.h" #define BLOCK_SIZE 0x4000 #define BLOCK_MASK 0x3fff #define BLOCK_START 0 #define HASH_SIZE 0x20000 #define HASH_MASK 0x1ffff #define HASH(l) ((l) &0x1ffff) #define BLOCK_MAX 0x3c0 #define CODEGEN_BACKEND_HAS_MOV_IMM ```
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
91
```objective-c uint32_t ropPCMPEQB(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPCMPEQW(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPCMPEQD(codeblock_t *block, ir_data_t *ir, uint...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_cmp.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
264
```c #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86 # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_back...
/content/code_sandbox/src/codegen_new/codegen_backend_x86_ops_fpu.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
769
```objective-c #define JMP_LEN_BYTES 5 static inline void codegen_addbyte(UNUSED(codeblock_t *block), uint8_t val) { if (block_pos >= BLOCK_MAX) { fatal("codegen_addbyte over! %i\n", block_pos); #if 0 CPU_BLOCK_END(); #endif } block_write_data[block_pos++] = val; } static inline void codege...
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64_ops_helpers.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
858
```objective-c void host_x86_ADDPS_XREG_XREG(codeblock_t *block, int dst_reg, int src_reg); void host_x86_ADDSD_XREG_XREG(codeblock_t *block, int dst_reg, int src_reg); #define CMPPS_EQ 0 #define CMPPS_NLT 5 #define CMPPS_NLE 6 void host_x86_CMPPS_XREG_XREG(codeblock_t *block, int dst_reg, int src_reg, int type); vo...
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64_ops_sse.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
2,280
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" #include "codegen_backend.h" #include "codegen_ir.h" #include "codegen_reg.h" extern int has_ea; static ir_data_t ir_block; static int codegen_unroll_start; static int c...
/content/code_sandbox/src/codegen_new/codegen_ir.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,939
```objective-c #include "codegen_backend_x86_defs.h" #define BLOCK_SIZE 0x10000 #define BLOCK_MASK 0xffff #define BLOCK_START 0 #define HASH_SIZE 0x20000 #define HASH_MASK 0x1ffff #define HASH(l) ((l) &0x1ffff) #define BLOCK_MAX 0x3c0 #define CODEGEN_BACKEND_HAS_MOV_IMM ```
/content/code_sandbox/src/codegen_new/codegen_backend_x86.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
87
```objective-c uint32_t ropPADDB(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPADDW(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPADDD(codeblock_t *block, ir_data_t *ir, uint8_t op...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_arith.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
732
```c #include <inttypes.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86_ops.h" #include "x86seg_common.h" #include "x86seg.h" #include "x87_sf.h" #include...
/content/code_sandbox/src/codegen_new/codegen_block.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
6,621
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_accumulate.h" #include "codegen_ir.h" #include "...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_loadstore.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,206
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_accumulate.h" #include "codegen_ir.h" #include "...
/content/code_sandbox/src/codegen_new/codegen_ops_3dnow.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
2,353
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codegen_ops_helpers.h" #includ...
/content/code_sandbox/src/codegen_new/codegen_ops_mov.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
8,201
```objective-c uint32_t ropPACKSSWB(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPACKSSDW(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPACKUSWB(codeblock_t *block, ir_data_t *ir, u...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_pack.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
406
```objective-c void host_x86_ADD32_REG_ABS(codeblock_t *block, int dst_reg, void *p); void host_x86_ADD8_REG_IMM(codeblock_t *block, int dst_reg, uint8_t imm_data); void host_x86_ADD16_REG_IMM(codeblock_t *block, int dst_reg, uint16_t imm_data); void host_x86_ADD32_REG_IMM(codeblock_t *block, int dst_reg, uint32_t imm...
/content/code_sandbox/src/codegen_new/codegen_backend_x86_ops.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
3,081
```c #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86 # include <stddef.h> # include <stdint.h> # include <stdlib.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include "codegen.h" # include "codegen_allocator.h" # include ...
/content/code_sandbox/src/codegen_new/codegen_backend_x86.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
3,714
```objective-c uint32_t ropLEA_16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropLEA_32(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropF6(codeblock_t *block, ir_data_t *ir, uint8_t op...
/content/code_sandbox/src/codegen_new/codegen_ops_misc.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,244
```objective-c #ifndef _CODEGEN_OPS_H_ #define _CODEGEN_OPS_H_ #include "codegen.h" struct ir_data_t; typedef uint32_t (*RecompOpFn)(codeblock_t *block, struct ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); extern RecompOpFn recomp_opcodes[512]; extern RecompOpFn recomp_opcodes_0...
/content/code_sandbox/src/codegen_new/codegen_ops.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
450
```c #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86 # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_back...
/content/code_sandbox/src/codegen_new/codegen_backend_x86_ops_sse.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
8,762
```objective-c #ifndef _CODEGEN_BACKEND_H_ #define _CODEGEN_BACKEND_H_ #if defined __amd64__ || defined _M_X64 # include "codegen_backend_x86-64.h" #elif defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86 # include "codegen_backend_x86.h" #elif defined __ARM_EABI__ || defined ...
/content/code_sandbox/src/codegen_new/codegen_backend.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
309
```objective-c uint32_t ropMOV_rb_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropMOV_rw_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropMOV_rl_imm(codeblock_t *block, ir_data_t ...
/content/code_sandbox/src/codegen_new/codegen_ops_mov.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,451
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codegen_ops_helpers.h" #includ...
/content/code_sandbox/src/codegen_new/codegen_ops_jump.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
3,201
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_accumulate.h" #include "codegen_ir.h" #include "...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_shift.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
897
```c #if defined __amd64__ || defined _M_X64 # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "x86.h" # include "x86seg_common.h" # include "x86seg.h" # include "x87_sf.h" # include "x87.h" # include "38...
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64_uops.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
38,603
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_accumulate.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codege...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_pack.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
536
```objective-c void host_x87_FILDq_BASE(codeblock_t *block, int base_reg); void host_x87_FISTPq_BASE(codeblock_t *block, int base_reg); void host_x87_FLDCW(codeblock_t *block, void *p); void host_x87_FLDd_BASE(codeblock_t *block, int base_reg); void host_x87_FSTPd_BASE(codeblock_t *block, int base_reg); ```
/content/code_sandbox/src/codegen_new/codegen_backend_x86_ops_fpu.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
92
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "x87_sf.h" #include "x87.h" #include "codegen.h" #include "codegen_accumulate....
/content/code_sandbox/src/codegen_new/codegen_ops_fpu_misc.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,265
```objective-c uint32_t ropADC_AL_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropADC_AX_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropADC_EAX_imm(codeblock_t *block, ir_data_t...
/content/code_sandbox/src/codegen_new/codegen_ops_arith.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
2,388
```objective-c uint32_t ropMOVD_r_d(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropMOVD_d_r(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropMOVQ_r_q(codeblock_t *block, ir_data_t *ir, ...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_loadstore.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
177
```c #if defined __aarch64__ || defined _M_ARM64 # include <stdlib.h> # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_backend.h" # include "codegen_backend_arm64_defs.h" # in...
/content/code_sandbox/src/codegen_new/codegen_backend_arm64.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
4,110
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_accumulate.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codege...
/content/code_sandbox/src/codegen_new/codegen_ops_mmx_cmp.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
502
```c #if defined __amd64__ || defined _M_X64 # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "codegen.h" # include "codegen_allocator.h" # include "codegen_backend.h" # include "codegen_backend_x86-64_defs.h"...
/content/code_sandbox/src/codegen_new/codegen_backend_x86-64_ops_sse.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
9,517
```objective-c #ifndef _CODEGEN_IR_DEFS_ #define _CODEGEN_IR_DEFS_ #include "codegen_reg.h" #define UOP_REG(reg, size, version) ((reg) | (size) | (version << 8)) /*uOP is a barrier. All previous uOPs must have completed before this one executes. All registers must have been written back or discarded. This should...
/content/code_sandbox/src/codegen_new/codegen_ir_defs.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
16,078
```objective-c #define REG_R0 0 #define REG_R1 1 #define REG_R2 2 #define REG_R3 3 #define REG_R4 4 #define REG_R5 5 #define REG_R6 6 #define REG_R7 7 #define REG_R8 8 #define REG_R9 ...
/content/code_sandbox/src/codegen_new/codegen_backend_arm_defs.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
733
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include "codegen.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codegen_ops_3dnow.h" #include "codegen_ops_arith.h" #include "codegen_ops_branch.h" #include "codegen_ops_fpu_arith.h" #include "codegen_ops_fpu_cons...
/content/code_sandbox/src/codegen_new/codegen_ops.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
32,966
```objective-c #ifndef _CODEGEN_ALLOCATOR_H_ #define _CODEGEN_ALLOCATOR_H_ /*The allocator handles all allocation of executable memory. Since the two-pass recompiler design makes applying hard limits to codeblock size difficult, the allocator allows memory to be provided as and when required. The allocator prov...
/content/code_sandbox/src/codegen_new/codegen_allocator.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
409
```objective-c uint32_t ropJMP_r8(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropJMP_r16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropJMP_r32(codeblock_t *block, ir_data_t *ir, uint8...
/content/code_sandbox/src/codegen_new/codegen_ops_jump.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
661
```c #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86 # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "x86.h" # include "x86_ops.h" # include "x86seg_common.h" # incl...
/content/code_sandbox/src/codegen_new/codegen_backend_x86_uops.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
39,069
```objective-c uint32_t ropPF2ID(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPFADD(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPFCMPEQ(codeblock_t *block, ir_data_t *ir, uint8_t ...
/content/code_sandbox/src/codegen_new/codegen_ops_3dnow.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
652
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen.h" #include "codegen_ir.h" #include "codegen_ops.h" #include "codegen...
/content/code_sandbox/src/codegen_new/codegen_ops_misc.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
6,940
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86_ops.h" #include "codegen.h" #include "x86.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "codegen_accumulate.h" #include "codegen_allocator.h" #in...
/content/code_sandbox/src/codegen_new/codegen.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
8,642
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "codegen.h" #include "codegen_accumulate.h" #include "codegen_ir.h" static struct { int count; int dest_reg; } acc_regs[] = { [ACCREG_cycles] = {0, IREG_cycles} }; void codege...
/content/code_sandbox/src/codegen_new/codegen_accumulate.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
262
```objective-c uint32_t ropJB_8(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropJB_16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropJB_32(codeblock_t *block, ir_data_t *ir, uint8_t opc...
/content/code_sandbox/src/codegen_new/codegen_ops_branch.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
2,273
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" #include "x86seg_common.h" #include "x86seg.h" #include "386_common.h" #include "x87_sf.h" #include "x87.h" #include "codegen.h" #include "codegen_accumulate....
/content/code_sandbox/src/codegen_new/codegen_ops_fpu_loadstore.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
2,943
```c #include <stdint.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "codegen.h" #include "codegen_backend.h" #include "codegen_ir_defs.h" #include "codegen_reg.h" int max_version_refcount; uint16_t reg_dead_list = 0; uint8_t reg_last_version[IR...
/content/code_sandbox/src/codegen_new/codegen_reg.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
10,330
```objective-c uint32_t ropPUSH_r16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPUSH_r32(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc); uint32_t ropPOP_r16(codeblock_t *block, ir_data_t *ir, u...
/content/code_sandbox/src/codegen_new/codegen_ops_stack.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,691
```objective-c #ifndef _CODEGEN_BACKEND_X86_DEFS_H_ #define _CODEGEN_BACKEND_X86_DEFS_H_ #define REG_EAX 0 #define REG_ECX 1 #define REG_EDX 2 #define REG_EBX 3 #define REG_ESP 4 #define REG_EBP 5 #define REG_ESI 6 #define REG_E...
/content/code_sandbox/src/codegen_new/codegen_backend_x86_defs.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
343
```objective-c #ifdef USE_NEW_DYNAREC # define CALL_FAR_w(new_seg, new_pc) \ old_cs = CS; \ old_pc = cpu_state.pc; \ cpu_state.pc = new_pc; \ optype = CALL; \ cgate16 = cgate32 = 0; \ if (msw & 1) ...
/content/code_sandbox/src/cpu/x86_ops_call.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
8,381
```c #include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <wchar.h> #include <math.h> #ifndef INFINITY # define INFINITY (__builtin_inff()) #endif #define HAVE_STDARG_H #include <86box/86box.h> #include "cpu.h" #include <86box/timer.h> #include "x86.h" #include ...
/content/code_sandbox/src/cpu/x86_ops_mmx.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
391
```objective-c #ifdef USE_NEW_DYNAREC # define CPU_SET_OXPC #else # define CPU_SET_OXPC oxpc = cpu_state.pc; #endif #define RETF_a16(stack_offset) \ if ((msw & 1) && !(cpu_state.eflags & VM_FLAG)) { \ op_pmoderetf(0, stack_offset); \ return 1; ...
/content/code_sandbox/src/cpu/x86_ops_ret_2386.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
2,590
```objective-c static int opMOV_AL_imm(uint32_t fetchdat) { AL = getbytef(); CLOCK_CYCLES(timing_rr); PREFETCH_RUN(timing_rr, 2, -1, 0, 0, 0, 0, 0); return 0; } static int opMOV_AH_imm(uint32_t fetchdat) { AH = getbytef(); CLOCK_CYCLES(timing_rr); PREFETCH_RUN(timing_rr, 2, -1, 0, 0, 0, 0, 0...
/content/code_sandbox/src/cpu/x86_ops_mov.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
8,041
```c #if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM # include <math.h> # include <stdint.h> # include <86box/86box.h> # include "cpu.h" # include <86box/mem.h> # include <86box/plat_unused.h> # include "x86.h" # include "x86seg_common.h" # include "x86seg.h" # include "x87_s...
/content/code_sandbox/src/codegen_new/codegen_backend_arm_uops.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
44,380
```c /* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent * system designs based on the PCI bus. * * This file is part of the 86Box di...
/content/code_sandbox/src/cpu/fpu.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
599
```objective-c static int opRDTSC(uint32_t fetchdat) { if (!cpu_has_feature(CPU_FEATURE_RDTSC)) { cpu_state.pc = cpu_state.oldpc; x86illegal(); return 1; } if ((cr4 & CR4_TSD) && CPL) { x86gpf("RDTSC when TSD set and CPL != 0", 0); return 1; } EAX = tsc & 0xff...
/content/code_sandbox/src/cpu/x86_ops_msr.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
241
```objective-c #define SSATB(val) (((val) < -128) ? -128 : (((val) > 127) ? 127 : (val))) #define SSATW(val) (((val) < -32768) ? -32768 : (((val) > 32767) ? 32767 : (val))) #define USATB(val) (((val) < 0) ? 0 : (((val) > 255) ? 255 : (val))) #define USATW(val) (((val) < 0) ? 0 : (((val) > 65535) ? 65535...
/content/code_sandbox/src/cpu/x86_ops_mmx.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
474
```objective-c #ifdef FPU_8087 static int opFI(uint32_t fetchdat) { FP_ENTER(); cpu_state.pc++; cpu_state.npxc &= ~0x80; if (rmdat == 0xe1) cpu_state.npxc |= 0x80; wait(3, 0); return 0; } #else static int opFSTSW_AX(uint32_t fetchdat) { FP_ENTER(); cpu_state.pc++; AX = cpu_st...
/content/code_sandbox/src/cpu/x87_ops_misc.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
12,125
```objective-c #ifdef IS_DYNAREC # define BS_common(start, end, dir, dest, time) \ flags_rebuild(); \ if (temp) { \ int c; \ cpu_state.flags &= ~Z_FLAG; \ for (c = s...
/content/code_sandbox/src/cpu/x86_ops_bitscan.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,879
```objective-c static int opCBW(uint32_t fetchdat) { AH = (AL & 0x80) ? 0xff : 0; CLOCK_CYCLES(3); PREFETCH_RUN(3, 1, -1, 0, 0, 0, 0, 0); return 0; } static int opCWDE(uint32_t fetchdat) { EAX = (AX & 0x8000) ? (0xffff0000 | AX) : AX; CLOCK_CYCLES(3); PREFETCH_RUN(3, 1, -1, 0, 0, 0, 0, 0); ...
/content/code_sandbox/src/cpu/x86_ops_misc.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
11,704
```c #include <stdio.h> #include <stdint.h> #include <string.h> #include <wchar.h> #include <86box/86box.h> #include "cpu.h" #include <86box/machine.h> #include "x87_timings.h" x87_timings_t x87_timings; x87_timings_t x87_concurrency; const x87_timings_t x87_timings_8087 = { .f2xm1 = (310 + 630) / 2, .fa...
/content/code_sandbox/src/cpu/x87_timings.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
7,196
```c /* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent * system designs based on the PCI bus. * * This file is part of the 86Box di...
/content/code_sandbox/src/cpu/x86.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
3,403
```c #include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <wchar.h> #define fplog 0 #include <math.h> #define HAVE_STDARG_H #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/pic.h> #include "x86.h" #include "x86_flags.h" #include "x86_ops.h" #include "x8...
/content/code_sandbox/src/cpu/x87.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
5,072
```objective-c static uint32_t fpu_save_environment(void) { int tag; unsigned offset = 0; /* read all registers in stack order and update x87 tag word */ for (int n = 0; n < 8; n++) { // update tag only if it is not empty if (!IS_TAG_EMPTY(n)) { tag = FPU_tagof(FPU_read...
/content/code_sandbox/src/cpu/x87_ops_sf.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
7,040
```objective-c static int opAAA(uint32_t fetchdat) { flags_rebuild(); if ((cpu_state.flags & A_FLAG) || ((AL & 0xF) > 9)) { /* On 286, it's indeed AX - behavior difference from 808x. */ AX += 6; AH++; cpu_state.flags |= (A_FLAG | C_FLAG); } else cpu_state.flags &= ~(A...
/content/code_sandbox/src/cpu/x86_ops_bcd.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,110
```objective-c /* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent * system designs based on the PCI bus. * * This file is part of th...
/content/code_sandbox/src/cpu/cpu.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
7,304
```c #include <stdio.h> #include <stdint.h> #include <string.h> #include <wchar.h> #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> #include <86box/plat_unused.h> #include "x86.h" #include "x86_ops.h" #include "x87_sf.h" #include "x87.h" #include "codegen.h" #include "codegen_ops.h" #include "codegen_t...
/content/code_sandbox/src/cpu/codegen_timing_winchip.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
10,728
```c /* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent * system designs based on the PCI bus. * * This file is part of the 86Box di...
/content/code_sandbox/src/cpu/8080.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
1,675
```objective-c #define cond_O (VF_SET()) #define cond_NO (!VF_SET()) #define cond_B (CF_SET()) #define cond_NB (!CF_SET()) #define cond_E (ZF_SET()) #define cond_NE (!ZF_SET()) #define cond_BE (CF_SET() || ZF_SET()) #define cond_NBE (!CF_SET() && !ZF_SET()) #define cond_S (NF_SET()) #define cond_NS (!NF_SE...
/content/code_sandbox/src/cpu/x86_ops_jump.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
3,359
```objective-c #include <math.h> static int opPREFETCH_a16(uint32_t fetchdat) { fetch_ea_16(fetchdat); ILLEGAL_ON(cpu_mod == 3); CLOCK_CYCLES(1); return 0; } static int opPREFETCH_a32(uint32_t fetchdat) { fetch_ea_32(fetchdat); ILLEGAL_ON(cpu_mod == 3); CLOCK_CYCLES(1); return 0; } s...
/content/code_sandbox/src/cpu/x86_ops_3dnow.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
5,913
```objective-c /* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent * system designs based on the PCI bus. * * This file is part of th...
/content/code_sandbox/src/cpu/x87_ops_sf_load_store.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
13,512
```objective-c /* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent * system designs based on the PCI bus. * * This file is part of th...
/content/code_sandbox/src/cpu/386_common.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
11,701
```objective-c static int opARPL_a16(uint32_t fetchdat) { uint16_t temp_seg; NOTRM fetch_ea_16(fetchdat); if (cpu_mod != 3) SEG_CHECK_WRITE(cpu_state.ea_seg); temp_seg = geteaw(); if (cpu_state.abrt) return 1; flags_rebuild(); if ((temp_seg & 3) < (cpu_state.regs[cpu_re...
/content/code_sandbox/src/cpu/x86_ops_pmode.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
5,546
```c /*Elements taken into account : - U/V integer pairing - FPU/FXCH pairing - Prefix decode delay (including shadowing) - FPU latencies - AGI stalls Elements not taken into account : - Branch prediction (beyond most simplistic approximation) - PMMX decode queu...
/content/code_sandbox/src/cpu/codegen_timing_pentium.c
c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
22,620
```objective-c #define BIAS80 16383 #define BIAS64 1023 typedef struct { int16_t begin; union { double d; uint64_t ll; } eind; } x87_conv_t; static __inline double x87_from80(x87_conv_t *test) { int64_t exp64; int64_t blah; int64_t exp64final; int64_t mant64; int64_t ...
/content/code_sandbox/src/cpu/x87_ops_conv.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
657
```objective-c static int opMOVSB_a16(uint32_t fetchdat) { uint8_t temp; addr64 = addr64_2 = 0x00000000; SEG_CHECK_READ(cpu_state.ea_seg); SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_READ(cpu_state.ea_seg, SI, SI); CHECK_WRITE(&cpu_state.seg_es, DI, DI); high_page = 0; do_mmut_rb(cpu_sta...
/content/code_sandbox/src/cpu/x86_ops_string.h
objective-c
2016-06-25T22:29:10
2024-08-16T19:09:21
86Box
86Box/86Box
2,616
9,526