Iyer, Balaji V | 17 May 01:01
Picon
Favicon

Vectorizer question

Hello Everyone,
	I have a question regarding the vectorizer. In the following code below...

Int func (int x, int y)
{
	If (x==y)
		Return (x+y);
	Else
		Return (x-y);
}

If we force the x and y to be vectors of vectorlength 4, then will the if-statement get a vector of booleans or
does it get 1 boolean that compares 2 very large values? I guess another way to ask is that, will it logically
break it up into 4 if-statements or just 1?

Any help is greatly appreciated!

Thanks,

Balaji V. Iyer.

PS. Please CC me in response  so that I can get to it quickly.

Brandon Philips | 16 May 22:28
Favicon
Gravatar

announce: The C Conference; San Diego, CA; August 28th

The first C Conference is happening in San Diego, CA on August 28th
2012. It is focused on the C programming language and modern
developments in that ecosystem.  The conference is co-located with
LinuxCon and Linux Plumbers Conference.

  http://www.cconf.org/

The "Reverse CFP" is open now and tickets are available. Let us know
what you want to see at the conference.

  http://www.cconf.org/pfc/

See you there.

	Brandon

Picon
Favicon

Probably inaccuracy in GCC 4.7.0 documentation.

Hello, GNU GCC team.

It seems like I've found an inaccuracy in GCC 4.7.0 documentation. It is about -fdefer-pop optimization
option. The point is that this option is mentioned in the list of optimization flags which -O1 turns on
(Chapter 3: GCC Command Options, part 3.10 Options That Control Optimization, page 107/766 of
http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc.pdf), but there are no any other allusions to
-fdefer-pop in the document, even in 3.1 Option Summary, where it is expected to be. There is no
explanation of what this flag does in HTML version of the document too (here
[http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Optimize-Options.html#Optimize-Options] and
here [http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Option-Summary.html#Option-Summary]). I'm
guessing that this flag is not further supported by G
 CC, or not yet implemented.

The statements above are valid for May 16, 2012.

May I give you my best wishes,
								Roman Sazhenkov

Hans-Peter Nilsson | 15 May 21:34
Picon
Favicon

How do I set SIG_ATOMIC_TYPE to a variant of a C-type?

I'm considering changing SIG_ATOMIC_TYPE for CRIS (*-elf and
*-linux-gnu) to the effect of
 #define SIG_ATOMIC_TYPE "int __attribute__((__aligned__(4)))"
but that by itself doesn't work.  It causes a SEGV on the 4.7
branch and no doubt also on trunk; the code is the same.  From a
gdb session it appears the type is expected to already exist as
a built-in C type, like the (undecorated) "int" or "char" types,
which are created much earlier in the same function.

How do I accomplish setting SIG_ATOMIC_TYPE as above?

Ok, someone is going to ask "why": in the ABI used for CRIS, all
types have byte alignment; structs are "packed".  Linux could
(AFAIU, theoretically) perform a context-switch if a process
gets a page-fault writing to a "sigatomic_t" plain "int" that's
straddling a page boundary where one of the pages isn't present
(say, not yet in the TLB, or paged out).  When the process gets
to execute again, a signal could be waiting (say, SIGALRM) and
the signal handler entered, but that plain "int" is not written
in whole; presto, the access not atomic as seen by the
signal-handler.  (In case of a very possible thinko here, please
don't forget the first question.)

brgds, H-P

Zdenek Dvorak | 15 May 16:13
Picon

Re: A question about loop ivopt

Hi,

> > > > Why can't we replace function force_expr_to_var_cost directly with
> function
> > > > computation_cost in tree-ssa-loop-ivopt.c?
> > > >
> > > > Actually I think it is inaccurate for the current recursive algorithm
> in
> > > > force_expr_to_var_cost to estimate expr cost. Instead
> computation_cost can
> > > > count some back-end factors and make the estimation more accurate.
> > > >
> > > > For example, using computation_cost, we may check whether back-ends
> can tie
> > > > some modes transformation expressed by SUBREG or not. If we use
> > > > force_expr_to_var_cost, some more computations around type
> > > > promotion/demotion would increase the cost estimated.
> > > >
> > > > Looking at the algorithm in force_expr_to_var_cost, it is just to
> analyze
> > > > the operator in the expression and give estimation. Should it be the
> same as
> > > > expanding EXPR to RTX and give estimation like in computation_cost?
> > > >
> > > > Any thoughts?
> > >
> > > I suppose Zdenek may remember.
> >
> > computation_cost actually expands the expression to RTL.  Since cost
> estimates
(Continue reading)

Paulo J. Matos | 15 May 15:00
Gravatar

Extension to compare-elim

Hi,

I am looking at a missed optimization and I think this is something that 
could be added to compare-elim, if it's not already done somewhere else. 
I have a double word comparison to zero, so in C it's:
int le(long a) { return a <= 0; }

My expand uses the following transformation (in my current discussion y0 
and y1 are 0):
    if x0:x1 <= y0:y1 goto L
==>
    if x0 < y0 goto L
    if x0 > y0 goto K
    if x1 <= y1 goto L
K:

This generates the assembler:
$le:
         tst     @$XAP_AH
         bmi ?L7
         cmp     AH,#H'0000
         bgt ?L3
         tst     @$XAP_AL
         bne ?L3
?L7:
         ld      AL,#H'0001
         bra     0,X
?L3:
         ld      AL,#H'0000
         bra     0,X
(Continue reading)

Rohit Arul Raj | 15 May 14:26
Picon

Help with 'ev_sl' PowerPC SPE Intrinsic

Hello All,

I need some help regarding implementation of one of the SPE instructions.

I am planning to implement 'evsl' instrinsic.
d = __ev_sl (a,b) : The value in parameter 'a' is shifted left by no.
of  bit positions specified in parameter 'b', filling vacated bit
positions with zeros, and the result is placed into parameter d.

My question: Is it better to have parameter 'b' of single scalar type
[int a] or vector type [__ev64_u64__ g = { 3 } ]?

Looking at _ev_slb, _ev_slh, _ev_slw, where a single scalar type will
not work since the shift amounts are carried by a "vector" of bytes,
half-words, and words respectively, for uniformity can we consider
64-bit shift as similar, a "vector" of one shift amount?

Thanks in advance.

Regards,
Rohit

Richard Guenther | 15 May 11:11
Picon

Re: A question about loop ivopt

On Tue, May 15, 2012 at 7:05 AM, Jiangning Liu <jiangning.liu <at> arm.com> wrote:
> Hi,
>
> Why can't we replace function force_expr_to_var_cost directly with function
> computation_cost in tree-ssa-loop-ivopt.c?
>
> Actually I think it is inaccurate for the current recursive algorithm in
> force_expr_to_var_cost to estimate expr cost. Instead computation_cost can
> count some back-end factors and make the estimation more accurate.
>
> For example, using computation_cost, we may check whether back-ends can tie
> some modes transformation expressed by SUBREG or not. If we use
> force_expr_to_var_cost, some more computations around type
> promotion/demotion would increase the cost estimated.
>
> Looking at the algorithm in force_expr_to_var_cost, it is just to analyze
> the operator in the expression and give estimation. Should it be the same as
> expanding EXPR to RTX and give estimation like in computation_cost?
>
> Any thoughts?

I suppose Zdenek may remember.

Richard.

> Thanks,
> -Jiangning
>
>
>
(Continue reading)

Руся Эрнет | 15 May 11:43

мой зайчик.))

привееееет зай..!))) 
если скучно и хош зазнакомиться ПoлинaБeлoвa_ndivhfj.land.ru
имя моё там. 

Jiangning Liu | 15 May 07:05
Favicon

A question about loop ivopt

Hi,

Why can't we replace function force_expr_to_var_cost directly with function
computation_cost in tree-ssa-loop-ivopt.c?

Actually I think it is inaccurate for the current recursive algorithm in
force_expr_to_var_cost to estimate expr cost. Instead computation_cost can
count some back-end factors and make the estimation more accurate.

For example, using computation_cost, we may check whether back-ends can tie
some modes transformation expressed by SUBREG or not. If we use
force_expr_to_var_cost, some more computations around type
promotion/demotion would increase the cost estimated.

Looking at the algorithm in force_expr_to_var_cost, it is just to analyze
the operator in the expression and give estimation. Should it be the same as
expanding EXPR to RTX and give estimation like in computation_cost?

Any thoughts?

Thanks,
-Jiangning

Andy Lutomirski | 15 May 00:26

How do I disable warnings across gcc versions?

This code warns (incorrectly, but that's a whole separate issue):

double foo(double a, double b)
{
  bool option1_ok, option2_ok;
  double option1, option2;
  if (a == 0) {
    option1_ok = false;
  } else {
    option1 = b;
    option1_ok = true;
  }
  if (a == 1) {
    option2_ok = false;
  } else {
    option2 = b;
    option2_ok = true;
  }
  if (option1_ok) return option1;
  if (option2_ok) return option2;
  return 7;
}

Unfortunately, the bogus warning is -Wuninitialized in gcc 4.6 and
-Wmaybe-uninitialized in gcc 4.7.  The obvious way to silence the
warning is to wrap it in:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
(Continue reading)


Gmane