Re: [Inline assembly] thought on the memory

2020-05-06 Thread Segher Boessenkool
Hi! On Thu, Apr 30, 2020 at 02:48:18PM +0200, FRÉDÉRIC RECOULES wrote: > I am looking for some clarification about how are working the memory > operands, especially when the constraint allows memory only (eg. "m"). > Please note that in a lesser extent, I know (by looking the gcc sources) how >

Re: inline assembly

2012-02-24 Thread Ian Lance Taylor
reed kotler writes: > For extended inline assembly, there are constraints. Some seem to be > supported by all architectures and some specific to a particular > architecture. > > Where are these defined in gcc source? > > Some seem to be in constraints.md and some not. Machine-specific constraint

Re: inline assembly vs. intrinsic functions

2011-03-28 Thread Ian Lance Taylor
roy rosen writes: > 2011/3/24 Ian Lance Taylor : >> roy rosen writes: >> You build a RECORD_TYPE holding the fields you want to return.  You define the appropriate builtin functions to return that record type. >>> >>> How is that done? using define_insn? How do I tell it to return a st

Re: inline assembly vs. intrinsic functions

2011-03-28 Thread roy rosen
2011/3/24 Ian Lance Taylor : > roy rosen writes: > >>> You build a RECORD_TYPE holding the fields you want to return.  You >>> define the appropriate builtin functions to return that record type. >> >> How is that done? using define_insn? How do I tell it to return a struct? >> Is there an example

Re: inline assembly vs. intrinsic functions

2011-03-24 Thread Ian Lance Taylor
roy rosen writes: >> You build a RECORD_TYPE holding the fields you want to return.  You >> define the appropriate builtin functions to return that record type. > > How is that done? using define_insn? How do I tell it to return a struct? > Is there an example I can look at? A RECORD_TYPE is wha

Re: inline assembly vs. intrinsic functions

2011-03-24 Thread roy rosen
2011/3/22 Ian Lance Taylor : > roy rosen writes: > >> 2010/10/26 Ian Lance Taylor : >>> roy rosen writes: >>> I am trying to demonstrate my port capabilities. I am writing an application which needs to use instructions like max a,b,c,d,e,f where a,b,c are inputs and d,e,f are outpu

Re: inline assembly vs. intrinsic functions

2011-03-21 Thread Ian Lance Taylor
roy rosen writes: > 2010/10/26 Ian Lance Taylor : >> roy rosen writes: >> >>> I am trying to demonstrate my port capabilities. >>> I am writing an application which needs to use instructions like max >>> a,b,c,d,e,f where a,b,c are inputs and d,e,f are outputs. >>> Is that possible to write an i

Re: inline assembly vs. intrinsic functions

2011-03-17 Thread roy rosen
2010/10/26 Ian Lance Taylor : > roy rosen writes: > >> I am trying to demonstrate my port capabilities. >> I am writing an application which needs to use instructions like max >> a,b,c,d,e,f where a,b,c are inputs and d,e,f are outputs. >> Is that possible to write an intrinsic function for that?

Re: inline assembly vs. intrinsic functions

2010-11-15 Thread Ian Lance Taylor
roy rosen writes: > Is there any another way to give attributes to inline assembly insns? Not that I know of. It would be a useful feature in some cases, though difficult to document. For specific cases a backend can normally do better by providing builtin functions. Ian

Re: inline assembly vs. intrinsic functions

2010-11-15 Thread roy rosen
But this lets you just set default attributes. I want to set real attributes so that the compiler would be able to know which insn can be parallelized with another. Is there a different way? Are you saying that an inline assembly statement would stay as is, and would not be touched by the compiler

Re: inline assembly vs. intrinsic functions

2010-11-15 Thread Joern Rennecke
Quoting roy rosen : Is there any another way to give attributes to inline assembly insns? See define_asm_attributes.

Re: inline assembly vs. intrinsic functions

2010-11-15 Thread roy rosen
Is there any another way to give attributes to inline assembly insns? 2010/10/26 Ian Lance Taylor : > roy rosen writes: > >> If I want the compiler to understand the inline assembly is it >> possible to write define_insn which would match the pattern that GCC >> creates for the inline assembly an

Re: inline assembly vs. intrinsic functions

2010-10-26 Thread Ian Lance Taylor
roy rosen writes: > If I want the compiler to understand the inline assembly is it > possible to write define_insn which would match the pattern that GCC > creates for the inline assembly and then GCC would be able to 'know' > some attributes about this insn and would be able to parallelize it?

Re: inline assembly vs. intrinsic functions

2010-10-26 Thread roy rosen
If I want the compiler to understand the inline assembly is it possible to write define_insn which would match the pattern that GCC creates for the inline assembly and then GCC would be able to 'know' some attributes about this insn and would be able to parallelize it? 2010/10/26 roy rosen : > I d

Re: inline assembly vs. intrinsic functions

2010-10-26 Thread roy rosen
I didn't give the full details of the instruction but for example a max instruction which gets an array and returns both the max value and its index in the array will need to return more than one argument. 2010/10/26 Ian Lance Taylor : > roy rosen writes: > >> I am trying to demonstrate my port c

Re: inline assembly vs. intrinsic functions

2010-10-26 Thread Ian Lance Taylor
roy rosen writes: > I am trying to demonstrate my port capabilities. > I am writing an application which needs to use instructions like max > a,b,c,d,e,f where a,b,c are inputs and d,e,f are outputs. > Is that possible to write an intrinsic function for that? > I think not because that means that

Re: Inline assembly operand specification

2009-10-05 Thread Ian Lance Taylor
Zoltán Kócsi writes: > Is there a documentation of the various magic letters that you can > apply to an operand in inline assembly? Unfortunately, no. > The > only place I found some information was going through the > gcc/config//.c file and trying to find the meaning of such > letters in the

Re: Inline Assembly Error: suffix or operands invalid for 'shr'

2009-03-24 Thread Chris Lattner
On Mar 24, 2009, at 11:02 AM, Rodrigo Dominguez wrote: When assembling this program, 'cc1' emits a 'shrl %ecx, %eax' instruction. The 'shr' instruction can only take an 8-bit register as the first operand. The emitted instruction should have been 'shrl %cl, %eax'. Therefore, the compilation

Re: Inline Assembly Error: suffix or operands invalid for 'shr'

2009-03-24 Thread H.J. Lu
3 i386]$ H.J. --- > Thank you, > > Rodrigo > >> -Original Message- >> From: H.J. Lu [mailto:hjl.to...@gmail.com] >> Sent: Tuesday, March 24, 2009 2:09 PM >> To: Rodrigo Dominguez >> Cc: gcc@gcc.gnu.org >> Subject: Re: Inline Assembly Error

RE: Inline Assembly Error: suffix or operands invalid for 'shr'

2009-03-24 Thread Paul Koning
> "Rodrigo" == Rodrigo Dominguez writes: Rodrigo> H.J, Thanks for replying but this doesn't answer my Rodrigo> question. Shouldn't __asm__ generate the right code without Rodrigo> using the %b1 trick? The reason I am asking is I have a 350 Rodrigo> line macro which I can't change. GCC do

RE: Inline Assembly Error: suffix or operands invalid for 'shr'

2009-03-24 Thread Rodrigo Dominguez
ssue? Something like an Intel/AMD/AT&T manual explaining this? Thank you, Rodrigo > -Original Message- > From: H.J. Lu [mailto:hjl.to...@gmail.com] > Sent: Tuesday, March 24, 2009 2:09 PM > To: Rodrigo Dominguez > Cc: gcc@gcc.gnu.org > Subject: Re: Inline Assembly

Re: Inline Assembly Error: suffix or operands invalid for 'shr'

2009-03-24 Thread H.J. Lu
On Tue, Mar 24, 2009 at 11:02 AM, Rodrigo Dominguez wrote: > Hi, > > While debugging a problem with Open64, I ran into a similar problem with > GCC. I created the following unit test program: > > #include > > int main(void) > { >    uint32_t    a = 7; >    int8_t      s = -1; > >    __asm__ ("shr

Re: inline assembly question (memory side-effects)

2008-05-12 Thread Andrew Haley
Till Straumann wrote: > What is the proper way to tell gcc that a > inline assembly statement either modifies > a particular area of memory or needs it > to be updated/in-sync because the assembly > reads from it. > > E.g., assume I have a > > struct blah { >int sum; > ... > }; > > which i

Re: inline assembly question (memory side-effects)

2008-05-12 Thread Etienne Lorrain
> What is the proper way to tell gcc that a inline assembly statement either > modifies > a particular area of memory or needs it to be updated/in-sync because the > assembly > reads from it. Maybe also related to: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32642 i.e. "=m" works for variables