[PATCH]Disable DECLARE_ASM_CONST workaround for icc 12
Hi! Intel icc finally supports __attribute__((used)) correctly, so the work-around for DECLARE_ASM_CONST can be disabled from upcoming version 12 on. Please comment, Carl Eugen
Carl Eugen Hoyos <cehoyos at ag.or.at> writes:
Hi!
Intel icc finally supports __attribute__((used)) correctly, so the work-around for DECLARE_ASM_CONST can be disabled from upcoming version 12 on.
Please comment, Carl Eugen
Index: libavutil/mem.h =================================================================== --- libavutil/mem.h (revision 23468) +++ libavutil/mem.h (working copy) @@ -28,7 +28,7 @@
#include "attributes.h"
-#if defined(__ICC) || defined(__SUNPRO_C) +#if defined(__ICC) && _ICC < 1200 || defined(__SUNPRO_C) #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v #elif defined(__TI_COMPILER_VERSION__)
IMO this problem should be solved differently. Combining it with the alignment macro is weird to say the least. -- M?ns Rullg?rd mans at mansr.com
On Sat, Jun 05, 2010 at 11:33:08AM +0100, M?ns Rullg?rd wrote:
Carl Eugen Hoyos <cehoyos at ag.or.at> writes:
Hi!
Intel icc finally supports __attribute__((used)) correctly, so the work-around for DECLARE_ASM_CONST can be disabled from upcoming version 12 on.
Please comment, Carl Eugen
Index: libavutil/mem.h =================================================================== --- libavutil/mem.h (revision 23468) +++ libavutil/mem.h (working copy) @@ -28,7 +28,7 @@
#include "attributes.h"
-#if defined(__ICC) || defined(__SUNPRO_C) +#if defined(__ICC) && _ICC < 1200 || defined(__SUNPRO_C) #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v #elif defined(__TI_COMPILER_VERSION__)
IMO this problem should be solved differently. Combining it with the alignment macro is weird to say the least.
I was never supposed to be combined with the aligned macro, that's why the DECLARE_ASM_CONST was added. The DECLARE_ALIGNED actually is and always was the same for ICC as for GCC.
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
On Sat, Jun 05, 2010 at 11:33:08AM +0100, M?ns Rullg?rd wrote:
Carl Eugen Hoyos <cehoyos at ag.or.at> writes:
Hi!
Intel icc finally supports __attribute__((used)) correctly, so the work-around for DECLARE_ASM_CONST can be disabled from upcoming version 12 on.
Please comment, Carl Eugen
Index: libavutil/mem.h =================================================================== --- libavutil/mem.h (revision 23468) +++ libavutil/mem.h (working copy) @@ -28,7 +28,7 @@
#include "attributes.h"
-#if defined(__ICC) || defined(__SUNPRO_C) +#if defined(__ICC) && _ICC < 1200 || defined(__SUNPRO_C) #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v #elif defined(__TI_COMPILER_VERSION__)
IMO this problem should be solved differently. Combining it with the alignment macro is weird to say the least.
I was never supposed to be combined with the aligned macro, that's why the DECLARE_ASM_CONST was added.
DECLARE_ASM_CONST expands to something containing an alignment specifier, and that is IMO mixing unrelated things. A better solution would be to do something like #define static_used static __attribute__((used)) when that attribute works and to nothing otherwise, then use that in a normal DECLARE_ALIGNED invocation if extra alignment is required.
The DECLARE_ALIGNED actually is and always was the same for ICC as for GCC.
That is beside the point. -- M?ns Rullg?rd mans at mansr.com
On Sat, Jun 05, 2010 at 03:56:36PM +0100, M?ns Rullg?rd wrote:
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
On Sat, Jun 05, 2010 at 11:33:08AM +0100, M?ns Rullg?rd wrote:
Carl Eugen Hoyos <cehoyos at ag.or.at> writes: IMO this problem should be solved differently. Combining it with the alignment macro is weird to say the least.
I was never supposed to be combined with the aligned macro, that's why the DECLARE_ASM_CONST was added.
DECLARE_ASM_CONST expands to something containing an alignment specifier, and that is IMO mixing unrelated things. A better solution would be to do something like #define static_used static __attribute__((used)) when that attribute works and to nothing otherwise, then use that in a normal DECLARE_ALIGNED invocation if extra alignment is required.
Well, the idea was just to have one single macro saying "do whatever it takes so that this is available as a constant for assembler code in this file". To me such a static_used define feels like naming things after a gcc-specific hack instead of what is really teh intention. But I'm not objecting if anyone has strong feelings about this...
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
On Sat, Jun 05, 2010 at 03:56:36PM +0100, M?ns Rullg?rd wrote:
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
On Sat, Jun 05, 2010 at 11:33:08AM +0100, M?ns Rullg?rd wrote:
Carl Eugen Hoyos <cehoyos at ag.or.at> writes: IMO this problem should be solved differently. Combining it with the alignment macro is weird to say the least.
I was never supposed to be combined with the aligned macro, that's why the DECLARE_ASM_CONST was added.
DECLARE_ASM_CONST expands to something containing an alignment specifier, and that is IMO mixing unrelated things. A better solution would be to do something like #define static_used static __attribute__((used)) when that attribute works and to nothing otherwise, then use that in a normal DECLARE_ALIGNED invocation if extra alignment is required.
Well, the idea was just to have one single macro saying "do whatever it takes so that this is available as a constant for assembler code in this file".
Yes, and that description doesn't include anything about alignment. Preventing the compiler from removing a seemingly unused variable and increasing the alignment are quite distinct operations. There is no inherent reason you'd always want them together.
To me such a static_used define feels like naming things after a gcc-specific hack instead of what is really teh intention.
So name it something else. It was only an example.
But I'm not objecting if anyone has strong feelings about this...
It would reduce the amount of duplication in those macros. -- M?ns Rullg?rd mans at mansr.com
On Sat, Jun 05, 2010 at 04:31:05PM +0100, M?ns Rullg?rd wrote:
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
On Sat, Jun 05, 2010 at 03:56:36PM +0100, M?ns Rullg?rd wrote:
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
On Sat, Jun 05, 2010 at 11:33:08AM +0100, M?ns Rullg?rd wrote:
Carl Eugen Hoyos <cehoyos at ag.or.at> writes: IMO this problem should be solved differently. Combining it with the alignment macro is weird to say the least.
I was never supposed to be combined with the aligned macro, that's why the DECLARE_ASM_CONST was added.
DECLARE_ASM_CONST expands to something containing an alignment specifier, and that is IMO mixing unrelated things. A better solution would be to do something like #define static_used static __attribute__((used)) when that attribute works and to nothing otherwise, then use that in a normal DECLARE_ALIGNED invocation if extra alignment is required.
Well, the idea was just to have one single macro saying "do whatever it takes so that this is available as a constant for assembler code in this file".
Yes, and that description doesn't include anything about alignment.
Caught me. I meant to say "so that this is usable", which does somewhat imply the alignment. Well, anyway those were my thoughts back when I implemented it, it may not make quite as much sense as I thought in hindsight.
But I'm not objecting if anyone has strong feelings about this...
It would reduce the amount of duplication in those macros.
It would probably increase the amount of "duplication"/complexity in the declarations of the assembler constants. I wouldn't consider it a win, however "bikeshed", do as you want from my side.
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Intel icc finally supports __attribute__((used)) correctly, so the work-around for DECLARE_ASM_CONST can be disabled from upcoming version 12 on.
Applied after discussing it personally with M?ns. Michael, if you had any objections, I will revert. Carl Eugen
participants (3)
-
cehoyos@ag.or.at -
mans@mansr.com -
Reimar.Doeffinger@gmx.de