This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, testsuite]: Do not run simulate-thread on alpha*-*-linux*


> +/* Checks for an atomic sequence of instructions beginning with a LWARX/LDARX
> +   instruction and ending with a STWCX/STDCX instruction.  If such a sequence
> +   is found, attempt to step through it.  A breakpoint is placed at the end of 
> +   the sequence.  */
> +

s/LWARX/LDL_L/g
s/LDARX/LDQ_L/g
s/STWCX/STL_C/g
s/STDCX/STQ_C/g

> +          int immediate = ((insn & 0x001fffff) << 2);
> +
> +          if (bc_insn_count >= 1)
> +            return 0; /* More than one conditional branch found, fallback 
> +                         to the standard single-step code.  */
> + 
> +	  breaks[1] = loc + ALPHA_INSN_SIZE + immediate;

The immediate needs to be sign-extended.  Add:

  immedaite = (immediate ^ 0x400000) - 0x400000;

Otherwise your computation of the address is correct.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]