[cfe-dev] linux/i386 and mregparm

pageexec at freemail.hu pageexec at freemail.hu
Tue Mar 1 14:14:06 PST 2011


On 2 Mar 2011 at 1:42, Anton Korobeynikov wrote:

> > once again, there're two different ranges allowed for the offset yet llvm
> > allows neither fully, not even the sign extended case.
> Assembler treats imm field as signed int. Thus we check only sext case.

it depends on the insn, some sign extend, some zero extend so the callers
of this function had better be for sign extending insns ;).

> Note that both cases are handled correctly, because (in kernel code
> model) too large positive offsets cannot be represented with 32-bit
> signed offset (the range is -2^31 ... 2^31-1) .

i don't understand what you mean by 'too large positive offsets' in that
the offset range that a 32 bit signed int can represent is the same regardless
of the code model (which is an artificial choice made by a given ABI)...

in any case, the ABI does allow a certain negative range for the kernel
code model that llvm doesn't, this omission may very well be the source of
my problem in fact, i'll check it out next time i boot my amd64 env.

> In any case, currently negative offsets are properly excluded for
> kernel code mode [...]

if you want to follow the ABI then it's not correct to exclude all
of them.




More information about the cfe-dev mailing list