This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports 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 05/26] arm: Introduce thumb helpers s and pc_ofs


On Tue, 26 Feb 2013, Richard Henderson wrote:

> 	* sysdeps/arm/sysdep.h (s, pc_ofs): New macros.

Other assembler syntax macros have names in uppercase, and a single 
character seems too short for a macro name to me.

> +/* This number is the offset from the pc at the current location.  */
> +#ifdef __thumb__
> +# define pc_ofs		4
> +#else
> +# define pc_ofs		8
> +#endif

As noted, I don't think this can have a conditional definition like this 
until .S files are actually built as Thumb.

However, there are existing cases in asm statements with conditionals for 
this (sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c and 
sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c).  So what I'd 
actually suggest is defining such a macro for both C and .S code, but 
always defining it to 8 for __ASSEMBLER__ at this point and only 
conditioning on __thumb__ for C, and making those two C files use the 
result of stringizing the macro.  Then, when .S files are built as Thumb 
the __ASSEMBLER__ conditionals on how to define this macro can be removed.

-- 
Joseph S. Myers
joseph@codesourcery.com


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