[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-04-25 Thread uros at gcc dot gnu dot org


--- Comment #12 from uros at gcc dot gnu dot org  2009-04-25 08:11 ---
Subject: Bug 39590

Author: uros
Date: Sat Apr 25 08:10:51 2009
New Revision: 146761

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=146761
Log:
PR target/39590
* configure.ac (HAVE_AS_IX86_FILDQ): On x86 targets check whether
the configured assembler supports fildq and fistpq mnemonics.
(HAVE_AS_IX86_FILDS): Rename from HAVE_GAS_FILDS_FISTS.
* configure: Regenerated.
* config.in: Ditto.

* config/i386/i386.c (print_operand): Handle 'Z'.
['z']: Remove handling of special fild/fist suffixes.
(output_fix_trunc): Use '%Z' to output suffix of fist{,p,tp} insn.
* config/i386/i386.md (*floathimode2_i387): Use '%Z' to output
suffix of fild insn.
(*floatsimode2_vector_mixed): Ditto.
(*floatSSEMODEI24:modeMODEF:mode2_mixed_interunit): Ditto.
(*floatSSEMODEI24:modeMODEF:mode2_mixed_nointerunit): Ditto.
(*floatSSEMODEI24:modeX87MODEF:mode2_i387_with_temp): Ditto.
(*floatSSEMODEI24:modeX87MODEF:mode2_i387): Ditto.
* config/i386/gas.h (GAS_MNEMONICS): Remove.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config.in
trunk/gcc/config/i386/gas.h
trunk/gcc/config/i386/i386.c
trunk/gcc/config/i386/i386.md
trunk/gcc/configure
trunk/gcc/configure.ac


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-04-25 Thread ubizjak at gmail dot com


--- Comment #13 from ubizjak at gmail dot com  2009-04-25 08:23 ---
Fixed for 4.5.0.


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-04-16 Thread pinskia at gcc dot gnu dot org


--- Comment #11 from pinskia at gcc dot gnu dot org  2009-04-16 18:34 
---
Stop setting the target milestone unless it is a regression.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.5.0   |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-04-01 Thread hjl dot tools at gmail dot com


--- Comment #10 from hjl dot tools at gmail dot com  2009-04-01 19:09 
---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00112.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2009-
   ||04/msg00112.html
   Target Milestone|--- |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-31 Thread hjl dot tools at gmail dot com


--- Comment #8 from hjl dot tools at gmail dot com  2009-03-31 22:42 ---
Darwin assembler and GNU assembler support fildq (%rax). But
Solaris assembler doesn't. Only fildll works with all assemblers.
We can't generate the 'q' suffix for %z.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||ubizjak at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-31 Thread hjl dot tools at gmail dot com


--- Comment #9 from hjl dot tools at gmail dot com  2009-04-01 01:08 ---
I don't think it will hurt to generate fildq in 64bit if
assembler supports it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-30 Thread hjl dot tools at gmail dot com


--- Comment #1 from hjl dot tools at gmail dot com  2009-03-30 19:19 ---
Please provide a testcase.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||hjl dot tools at gmail dot
   ||com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-30 Thread felix-gcc at fefe dot de


--- Comment #2 from felix-gcc at fefe dot de  2009-03-30 19:54 ---
Uh, I did.  Use the macro like this:

int foo=2;
atomic_add(foo,3);

then try size_t as type of foo and compile on x86_64.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-30 Thread hjl dot tools at gmail dot com


--- Comment #3 from hjl dot tools at gmail dot com  2009-03-30 19:59 ---
(In reply to comment #2)
 Uh, I did.  Use the macro like this:
 
 int foo=2;
 atomic_add(foo,3);
 
 then try size_t as type of foo and compile on x86_64.
 

That is not a testcase. I need a valid C source code, which
I can compile.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-30 Thread felix-gcc at fefe dot de


--- Comment #4 from felix-gcc at fefe dot de  2009-03-30 20:27 ---
#include stddef.h

#define atomic_add(mem,val) asm volatile (lock; add%z0 %1, %0: +m (mem):
ir (val))

int main() {
  size_t foo;
  atomic_add(foo,23);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-30 Thread hjl dot tools at gmail dot com


--- Comment #5 from hjl dot tools at gmail dot com  2009-03-30 21:07 ---
'z' is for x87 insns. You have to check size of size_t and use
proper suffix in your code.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-30 Thread felix-gcc at fefe dot de


--- Comment #6 from felix-gcc at fefe dot de  2009-03-30 22:10 ---
 'z' is for x87 insns.

Uh, what?!  Let me quote the relevant documentation
(gcc/config/i386/i386.md):

;; The special asm out single letter directives following a '%' are:
;; 'z' mov%z1 would be movl, movw, or movb depending on the mode of
;; operands[1].

No mention of floating point.

 You have to check size of size_t and use
 proper suffix in your code.

No.  The whole point of %z is that you can write asm statements in a way that
does not specify the argument size explicitly in the statement.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590



[Bug inline-asm/39590] inline asm %z on amd64 says ll instead of q

2009-03-30 Thread hjl dot tools at gmail dot com


--- Comment #7 from hjl dot tools at gmail dot com  2009-03-31 01:28 ---
(In reply to comment #6)
  'z' is for x87 insns.
 
 Uh, what?!  Let me quote the relevant documentation
 (gcc/config/i386/i386.md):
 
 ;; The special asm out single letter directives following a '%' are:
 ;; 'z' mov%z1 would be movl, movw, or movb depending on the mode of
 ;; operands[1].
 

This was written before x86-64 and movq is mentioned here. 64bit is for
fildll/fildq. I don't know if all x86-64 assemblers support fildq.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590