| @@ -329,7 +329,7 @@ static void asm_binary_opcode(TCCState *s1, int token) · 328 unmodified lines |
| 329 | static void asm_block_data_transfer_opcode(TCCState *s1, int token) | 329 | static void asm_block_data_transfer_opcode(TCCState *s1, int token) |
| 330 | { | 330 | { |
| 331 | uint32_t opcode; | 331 | uint32_t opcode; |
| 332 | int op0_exclam; | 332 | int op0_exclam = 0; |
| 333 | Operand ops[2]; | 333 | Operand ops[2]; |
| 334 | int nb_ops = 1; | 334 | int nb_ops = 1; |
| 335 | parse_operand(s1, &ops[0]); | 335 | parse_operand(s1, &ops[0]); |
| @@ -388,30 +388,30 @@ static void asm_block_data_transfer_opcode(TCCState *s1, int token) · 52 unmodified lines |
| 388 | case TOK_ASM_ldmibeq: | 388 | case TOK_ASM_ldmibeq: |
| 389 | switch (ARM_INSTRUCTION_GROUP(token)) { | 389 | switch (ARM_INSTRUCTION_GROUP(token)) { |
| 390 | case TOK_ASM_stmdaeq: // post-decrement store | 390 | case TOK_ASM_stmdaeq: // post-decrement store |
| 391 | opcode = 0x82 << 20; | 391 | opcode = 0x80 << 20; |
| 392 | break; | 392 | break; |
| 393 | case TOK_ASM_ldmdaeq: // post-decrement load | 393 | case TOK_ASM_ldmdaeq: // post-decrement load |
| 394 | opcode = 0x83 << 20; | 394 | opcode = 0x81 << 20; |
| 395 | break; | 395 | break; |
| 396 | case TOK_ASM_stmeq: // post-increment store | 396 | case TOK_ASM_stmeq: // post-increment store |
| 397 | case TOK_ASM_stmiaeq: // post-increment store | 397 | case TOK_ASM_stmiaeq: // post-increment store |
| 398 | opcode = 0x8a << 20; | 398 | opcode = 0x88 << 20; |
| 399 | break; | 399 | break; |
| 400 | case TOK_ASM_ldmeq: // post-increment load | 400 | case TOK_ASM_ldmeq: // post-increment load |
| 401 | case TOK_ASM_ldmiaeq: // post-increment load | 401 | case TOK_ASM_ldmiaeq: // post-increment load |
| 402 | opcode = 0x8b << 20; | 402 | opcode = 0x89 << 20; |
| 403 | break; | 403 | break; |
| 404 | case TOK_ASM_stmdbeq: // pre-decrement store | 404 | case TOK_ASM_stmdbeq: // pre-decrement store |
| 405 | opcode = 0x92 << 20; | 405 | opcode = 0x90 << 20; |
| 406 | break; | 406 | break; |
| 407 | case TOK_ASM_ldmdbeq: // pre-decrement load | 407 | case TOK_ASM_ldmdbeq: // pre-decrement load |
| 408 | opcode = 0x93 << 20; | 408 | opcode = 0x91 << 20; |
| 409 | break; | 409 | break; |
| 410 | case TOK_ASM_stmibeq: // pre-increment store | 410 | case TOK_ASM_stmibeq: // pre-increment store |
| 411 | opcode = 0x9a << 20; | 411 | opcode = 0x98 << 20; |
| 412 | break; | 412 | break; |
| 413 | case TOK_ASM_ldmibeq: // pre-increment load | 413 | case TOK_ASM_ldmibeq: // pre-increment load |
| 414 | opcode = 0x9b << 20; | 414 | opcode = 0x99 << 20; |
| 415 | break; | 415 | break; |
| 416 | default: | 416 | default: |
| 417 | tcc_error("internal error: This place should not be reached (fallback in asm_block_data_transfer_opcode)"); | 417 | tcc_error("internal error: This place should not be reached (fallback in asm_block_data_transfer_opcode)"); |
| @@ -423,10 +423,11 @@ static void asm_block_data_transfer_opcode(TCCState *s1, int token) · 5 unmodified lines |
| 423 | expect("exactly two operands"); | 423 | expect("exactly two operands"); |
| 424 | else if (ops[0].type != OP_REG32) | 424 | else if (ops[0].type != OP_REG32) |
| 425 | expect("(first operand) register"); | 425 | expect("(first operand) register"); |
| 426 | else if (!op0_exclam) | 426 | else { |
| 427 | tcc_error("first operand of '%s' should have an exclamation mark", get_tok_str(token, NULL)); | 427 | if (op0_exclam) |
| 428 | else | 428 | opcode |= 1 << 21; // writeback |
| 429 | asm_emit_opcode(token, opcode | ENCODE_RN(ops[0].reg) | ops[1].regset); | 429 | asm_emit_opcode(token, opcode | ENCODE_RN(ops[0].reg) | ops[1].regset); |
| | 430 | } |
| 430 | break; | 431 | break; |
| 431 | default: | 432 | default: |
| 432 | expect("block data transfer instruction"); | 433 | expect("block data transfer instruction"); |