|
From: | Michael Matz |
Subject: | Re: [Tinycc-devel] .fill .rept broken by "Clean up 64bit immediate support" |
Date: | Mon, 16 May 2016 03:23:40 +0200 (CEST) |
User-agent: | Alpine 2.00 (LNX 1167 2008-08-23) |
Hi, On Mon, 16 May 2016, Sergey Korshunoff wrote:
With the prev fix I still have a tccboot kernel trap on PCI bus configuration.What the purpose of the -ALT(DEF_ASM_OP2(addb, 0x80, 0, OPC_ARITH | OPC_MODRM | OPC_BWLX, OPT_IM, OPT_EA | OPT_REG)) ALT(DEF_ASM_OP2(addw, 0x83, 0, OPC_ARITH | OPC_MODRM | OPC_WLX, OPT_IM8S, OPT_EA | OPT_REG)) +ALT(DEF_ASM_OP2(addb, 0x80, 0, OPC_ARITH | OPC_MODRM | OPC_BWLX, OPT_IM, OPT_EA | OPT_REG)) in the "Fix signed constants and opcode order" ?
The purpose is to prefer the short immediate forms of those instructions if the immediate value fits into 8 bit (signed). E.g. for add $-1,%ebx the encoding should be "83 c3 ff", not "81 c3 ff ff ff ff". I've tested multiple combinations of signed and unsigned constants (including the borders -129,-128,127,128,255,256) and the assembler itself does the right thing. Is it possible that the mishandled instructions doesn't have the above simple form, but perhaps that the immediate is calculated with asm expression? Can you somehow find out which file and instruction is the one that's miscompiled? If you can, please attach the pre-processed source file here.
With thise change reverted there is no problem with tccboot kernel.
I hope this means it's relatively simple to find out which file contains the problem.
Ciao, Michael.
[Prev in Thread] | Current Thread | [Next in Thread] |