Bug in PPC inline assembly?

2005-07-17 Thread Stefan
-- which means that the machine will actually try to store the value at address 0x0. Is this a bug in GCC or is it my code that is messed up? -- Stefan

Re: Bug in PPC inline assembly?

2005-07-18 Thread Stefan
Thanks for your help: using constraint "b" instead of "r" solved my problem. -- Stefan > Try using 'b' for the constraint - that selects for an "address base > register", as opposed to 'r' that is any of the general registers (inc

Comparisons between GCC and other compilers

2005-07-19 Thread Stefan
Does someone know of any comparisons (with regard to optimization, standard conformance, etc.) made between GCC and other, comercial, compilers? I'm primarily interested in comparisons made for ARM and PowerPC targets, but x86 is also of interest. -- Stefan

make static method find_reloads_address_1(...) extern accessible

2019-09-30 Thread stefan
ch would requires it? Regards Stefan

MetaC++ announcement

2005-03-05 Thread Stefan Strasser
y language constructs(its name, what namespace it is in, etc.) XML format? - You can use the library for reading and writing. However, the xml format is automatically derived from the object model,data field "isVirtual" in class "BaseSpecifier" is called "BaseSpecifier.IsVirtual" in xml files. Normal fields and pointer<>'s are attributes, element<>'s and list<>'s are subnodes. -- Stefan Strasser

Re: MetaC++ announcement

2005-03-05 Thread Stefan Strasser
compatible with unprocessed source. it does not read any variable alignment information(except c++ bitfield size) and I don't see a reason to do that. but in case you need that it can be added quite easily, search for "Parse(object -- Stefan Strasser

Re: GCC3 to GCC4 performance regression. Bug?

2005-03-17 Thread Stefan Strasser
_s *) malloc (sizeof (struct dpmatrix_s)); AllocPlan7Body(hmm, 10); for (i = 0; i < 60; i++) { P7Viterbi(500, 10, hmm, mx->mmx); } } -- Stefan Strasser

inefficient code output?

2005-03-22 Thread Stefan Strasser
no "volatile" involved. -- Stefan Strasser

Re: i want to connect gcc's front-end to my'back-end

2005-03-29 Thread Stefan Strasser
ttp://www.gccxml.org if you want to port gcc to another CPU or similar I'm sure there is some backend-howto on gcc website, but gimple trees are not the right way. there are more than one IRs in gcc so you need to be more clear. and note that gcc debugging outputs are not designed to be processed. -- Stefan Strasser

Re: Use Bohem's GC for compiler proper in 4.1?

2005-04-01 Thread Stefan Strasser
p here since it is a generational collector. -- Stefan Strasser

Re: i want to connect gcc's front-end to my'back-end

2005-04-01 Thread Stefan Strasser
> my project is change EDG's front-end to GCC's front-end because GPL expect some work to do. gcc does some transformations while parsing already, e.g. when calling virtual functions -- Stefan Strasser

Re: Use Bohem's GC for compiler proper in 4.1?

2005-04-01 Thread Stefan Strasser
Mike Stump schrieb: On Friday, April 1, 2005, at 08:48 AM, Stefan Strasser wrote: if gcc uses more memory than physically available it spends a _very_ long time swapping Swapping, what's that? Here's $20, go buy a gigabyte. expect memory to become a problem again with the advent of

Re: Use Bohem's GC for compiler proper in 4.1?

2005-04-02 Thread Stefan Strasser
tual tables involved. are there any known performance bugs in this area or should I file a PR? any suggestions on how to simplify the testcase? (preprocessed is ~60k lines) -- Stefan Strasser

Re: Use Bohem's GC for compiler proper in 4.1?

2005-04-02 Thread Stefan Strasser
file a PR. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20733 -- Stefan Strasser

Re: Use Bohem's GC for compiler proper in 4.1?

2005-04-02 Thread Stefan Strasser
Andrew Pinski schrieb: On Apr 2, 2005, at 6:12 PM, Stefan Strasser wrote: gcc-Version 4.0.0 20041218 (experimental) this 4.0.0 is almost 4 months old. That is not a far comparison as there was speedups after that and other bug fixes. you're right, I wasn't prepared to do performance

Re: GCC 4.0 Status Report (2005-04-05)

2005-04-04 Thread Stefan Strasser
bug on the list is known to cause silent miscompilation of Qt, a very major package, and it's not easy to know where the problem is. what is the workaround to this? (in the case the class the pointer target is a member of is a template parameter, unlike in the PR test case) -- Stefan Strasser

Re: Questions about a constant array reference in the C++ front end

2005-05-08 Thread Stefan Strasser
codes including STL, boost and custom code including function bodies and I have never seen a RANGE_EXPR. I suppose it's only used at later stages or only in other language's frontends. Regards, -- Stefan Strasser

Re: Questions about a constant array reference in the C++ front end

2005-05-08 Thread Stefan Strasser
Nathan Sidwell schrieb: Stefan Strasser wrote: I don't know anything about fold but in general a c++ array in the frontend is cv-qualified, not its elements. this is untrue. the elements hold the qualification. right I have been processing large source codes including STL, boost and custom

Almost an order of magnitude faster __udimodti4() for AMD64

2020-08-10 Thread Stefan Kanthak
tps://skanthak.homepage.t-online.de/integer.html#as-5>, as well as (after trivial editing) __udivdi3() from <https://skanthak.homepage.t-online.de/integer.html#ml-1> and __divdi3() from <https://skanthak.homepage.t-online.de/integer.html#ml-2> regards Stefan

Peephole optimisation: isWhitespace()

2020-08-14 Thread Stefan Kanthak
x27;) shreax, cl ; eax >>= (c % ' ') xoredx, edx cmp ecx, 33 ; CF = c <= ' ' adcedx, edx ; edx = (c <= ' ') andeax, edx ret regards Stefan Kanthak

Re: Peephole optimisation: isWhitespace()

2020-08-16 Thread Stefan Kanthak
"Nathan Sidwell" wrote: > On 8/14/20 12:43 PM, Stefan Kanthak wrote: >> Hi @ll, >> >> in his ACM queue article <https://queue.acm.org/detail.cfm?id=3372264>, >> Matt Godbolt used the function >> >> | bool isWhitespace(char c)

Re: Peephole optimisation: isWhitespace()

2020-08-17 Thread Stefan Kanthak
"Nathan Sidwell" > On 8/16/20 9:54 AM, Stefan Kanthak wrote: >> "Nathan Sidwell" wrote: [...] >>> Have you benchmarked it? >> >> Of course! Did you? [...] > you seem very angry about being asked for data. As much as you hallucinated

Re: Peephole optimisation: isWhitespace()

2020-08-17 Thread Stefan Kanthak
"Allan Sandfeld Jensen" wrote: > On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: >> Hi @ll, >> >> in his ACM queue article <https://queue.acm.org/detail.cfm?id=3372264>, >> Matt Godbolt used the function >> >> | b

Re: Peephole optimisation: isWhitespace()

2020-08-24 Thread Stefan Kanthak
"Richard Biener" wrote: > On Mon, Aug 17, 2020 at 7:09 PM Stefan Kanthak > wrote: >> >> "Allan Sandfeld Jensen" wrote: >> >> > On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: >> >> Hi @ll, >> >>

Re: Peephole optimisation: isWhitespace()

2020-08-24 Thread Stefan Kanthak
"Richard Biener" wrote: > On Mon, Aug 24, 2020 at 1:22 PM Stefan Kanthak > wrote: >> >> "Richard Biener" wrote: >> >> > On Mon, Aug 17, 2020 at 7:09 PM Stefan Kanthak >> > wrote: >> >> >> >> "Al

Re: Peephole optimisation: isWhitespace()

2020-08-25 Thread Stefan Kanthak
ken" or "almost never taken" may help the | processor better predict the remaining branches. JFTR: I didn't know his article before, but I hope that you are willing to learn. Stefan

Missed optimisation in __udivmoddi4 of libgcc2

2020-09-13 Thread Stefan Kanthak
ng? (I use the variable names from the C source instead of register names here) mov %r11d, %ecx shld %cl, d0, d1 xor n2, n2 shld %cl, n1, n2 shld %cl, n0, n1 JFTR: the test at b8 is superfluous. regards Stefan

UB or !UB? Plus poor register allocation

2020-10-01 Thread Stefan Kanthak
The following source implements the __absv?i2() functions (see <https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html>) for 32-bit, 64-bit and 128-bit integers in 3 different ways: --- ub_or_!ub.c --- // Copyleft 2014-2020, Stefan Kanthak #ifdef __amd64__ __int128_t __a

[Patch] Overflow-trapping integer arithmetic routines7code: bloated and slooooow

2020-10-05 Thread Stefan Kanthak
.de/gcc.html> for some examples. The attached diff/patch provides better implementations. Stefan libgcc2.diff Description: Binary data

[__mulvti3] register allocator plays shell game

2020-10-25 Thread Stefan Kanthak
, 63 cmp r8, rsi jne __mulvti3+0x48+65-31 cmp r9, rcx jne __mulvti3+0xa0+65-31 mov rax, rdi imul rdx ret ... not amused Stefan Kanthak

Re: [__mulvti3] register allocator plays shell game

2020-10-26 Thread Stefan Kanthak
Richard Biener wrote: > On Sun, Oct 25, 2020 at 8:37 PM Stefan Kanthak > wrote: >> >> Hi, >> >> for the AMD64 alias x86_64 platform and the __int128_t [DW]type, >> the first few lines of the __mulvDI3() function from libgcc2.c >> >

Re: [__mulvti3] register allocator plays shell game

2020-10-27 Thread Stefan Kanthak
Richard Biener wrote: > On Tue, Oct 27, 2020 at 12:01 AM Stefan Kanthak > wrote: >> >> Richard Biener wrote: >> >>> On Sun, Oct 25, 2020 at 8:37 PM Stefan Kanthak >>> wrote: >>>> >>>> Hi, >>>> >>>> fo

[libgcc2.c] Implementation of __bswapsi2()

2020-11-12 Thread Stefan Kanthak
nt w) { return (v >> (31 & w)) | (v << (31 & -w)); } int __bswapsi2 (int u) // should better be unsigned __bswapsi2 (unsigned u)! { return __rotlsi3 (u & 0xff00ff00, 8) | __rotrsi3 (u & 0x00ff00ff, 8); } Stefan KanthaK PS: reimplementing __bswapdi2(

Re: gcc-4.9.2: Assembly for i386 Target

2015-10-12 Thread Stefan Ring
On Mon, Oct 12, 2015 at 11:11 AM, Abhishek Aggarwal wrote: > I was befuddled by the following 3 assembly instructions (generated > right in the beginning of 'main' function): >lea 0x4(%esp), %ecx >and 0xfff0, %esp >pushl -0x4(%ecx) > > I am not able to understand the p

Re: gcc-4.9.2: Assembly for i386 Target

2015-10-12 Thread Stefan Ring
On Mon, Oct 12, 2015 at 1:06 PM, Abhishek Aggarwal wrote: > @Jonathan: The reason I started this discussion is due to my suspicion > of a potential bug in gcc-4.9.2. However, I may be wrong. Here is the > explanation: I think everything is alright. The code is only emitted for the main function,

Re: how to tweak x86 code generation to instrument certain opcodes with CC trap?

2015-10-27 Thread Stefan Ring
On Mon, Oct 26, 2015 at 8:47 PM, Yasser Shalabi wrote: > So back to square one. Any tips on what code/config-files I need to > modify with to get GCC to emit additional opcodes for certain > instructions? Maybe you should try cross-compiling. It looks like you have already succeeded with the inst

nonnull, -Wnonnull, and do/while

2016-02-16 Thread Stefan Sobernig
} while (s != NULL); } Under a recent gcc 6 [*], we run into -Wnonnull warnings using the nonnull attribute: test.c: In function 'f': test.c:16:14: warning: nonnull argument 's' compared to NULL [-Wnonnull] } while (s != NULL); Am I missing sth.? Is this a false positive

Re: nonnull, -Wnonnull, and do/while

2016-02-17 Thread Stefan Sobernig
> On Tue, Feb 16, 2016 at 11:04:38AM +0100, Marek Polacek wrote: >> On Tue, Feb 16, 2016 at 10:43:08AM +0100, Stefan Sobernig wrote: >>> Under a recent gcc 6 [*], we run into -Wnonnull warnings using the >>> nonnull attribute: >> >> Yes, this warning has b

Re: [WWWDocs] Deprecate support for non-thumb ARM devices

2016-02-25 Thread Stefan Ring
On Thu, Feb 25, 2016 at 10:20 AM, Richard Earnshaw (lists) wrote: > The point is to permit the compiler to use interworking compatible > sequences of code when generating ARM code, not to force users to use > Thumb code. The necessary instruction (BX) is available in armv5 and > armv5e, even thou

Re: [WWWDocs] Deprecate support for non-thumb ARM devices

2016-02-25 Thread Stefan Ring
On Thu, Feb 25, 2016 at 3:15 PM, David Brown wrote: > The "t" is thumb, "e" means "DSP-like extensions", and I suspect the "l" > is a misprint for "j", meaning the Jazelle (Java) acceleration instructions. I doubt that as "armv5tejl" is also quite common.

Re: [WWWDocs] Deprecate support for non-thumb ARM devices

2016-02-25 Thread Stefan Ring
On Thu, Feb 25, 2016 at 3:15 PM, David Brown wrote: > Great link, thanks!

successfully built and installed GCC 4.9.1 armv7l-unknown-linux-gnueabihf

2014-07-22 Thread Stefan Fleischmann
$ ../gcc-4.9.1/config.guess armv7l-unknown-linux-gnueabihf $ /opt/gcc/4.9.1/bin/gcc -v Using built-in specs. COLLECT_GCC=/opt/gcc/4.9.1/bin/gcc COLLECT_LTO_WRAPPER=/opt/gcc/4.9.1/libexec/gcc/arm-linux-gnueabihf/4.9.1/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../gcc-4.9.1/con

Re: no response to cfarm request

2014-12-16 Thread Stefan Ring
On Tue, Dec 16, 2014 at 10:13 AM, Jay Foad wrote: > I've pinged again and waited another week with no response. Is there > no-one else who can administer compile farm accounts? Maybe you should try the gcc-cfarm mailing list: https://mail.gna.org/listinfo/gcc-cfarm-users It seems very responsive

g++keeps unused objects with virtual functions

2015-04-07 Thread Stefan Ehrlich
there a plan to add this feature to the linker? greetings from Austria Stefan

AW: g++keeps unused objects with virtual functions

2015-04-08 Thread Stefan Ehrlich
t without any effect. Is here something missing or too much? Lg Stefan -Ursprüngliche Nachricht- Von: Richard Biener [mailto:richard.guent...@gmail.com] Gesendet: Dienstag, 07. April 2015 18:42 An: Stefan Ehrlich; gcc@gcc.gnu.org Betreff: Re: g++keeps unused objects with virtual functi

AW: g++keeps unused objects with virtual functions

2015-04-08 Thread Stefan Ehrlich
le, the virtual function, and the 100 ints are present in the executable. class CObject { public: virtual void virtFunction() {} public: int SomeData[100]; }; //CObject NotUsedObject; int main() { CObject UsedObject; UsedObject.virtFunction(); return 0; } So what ca

AW: g++keeps unused objects with virtual functions

2015-04-08 Thread Stefan Ehrlich
Dear Richard, The optimization step for doing it does already exist --> it is used for stack variables/objects, but unfortunately not for the global ones. The same optimization should work for the global variables/objects, too. Or am I wrong? Stefan -Ursprüngliche Nachricht-

AW: g++keeps unused objects with virtual functions

2015-04-08 Thread Stefan Ehrlich
That means, that there is no chance to find this in the next future GCC releases :-( But anyway... Thanks so far Stefan PS: Hope dies last -Ursprüngliche Nachricht- Von: Richard Biener [mailto:richard.guent...@gmail.com] Gesendet: Mittwoch, 08. April 2015 13:27 An: Stefan Ehrlich Cc

AW: g++keeps unused objects with virtual functions

2015-04-09 Thread Stefan Ehrlich
= === == call_count 00100128 next_counter (common) ENTRY ADDRESS REF BY = === == main 8138 __main (?CSTARTUP) Lg Stefan -Ursprüngliche Nachricht- Von: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] Im Auftrag von Stefan Ehrlich Gesendet: Mittwoch, 08

Poor code generation/optimisation in all versions of GCC x86-64 and x86-32

2018-11-05 Thread Stefan Kanthak
inverse "mov rdx, rcx". I also wonder why a shld is created here: at least for "n += n;" I expect a more straightforward add rax, rax adc rdx, rdx regards Stefan Kanthak PS: of course GCC x86-32 exhibits the same flaws with int64_t!

Bug in divmodhi4(), plus poor inperformant code

2018-12-04 Thread Stefan Kanthak
Hi @ll, libgcc's divmodhi4() function has an obvious bug; additionally it shows rather poor inperformant code: two of the three conditions tested in the first loop should clearly moved outside the loop! divmodsi4() shows this inperformant code too! regards Stefan Kanthak --- divmod

Re: Bug in divmodhi4(), plus poor inperformant code

2018-12-04 Thread Stefan Kanthak
more sense, and a few targets do that. Moving 2 of 3 conditions from the loop is not an optimisation, but a necessity! In other words: why test 3 conditions in every pass of the loop when you need to test only 1 condition inside the loop, and the other 2 outside/before the loop? regards Stefa

Re: Bug in divmodhi4(), plus poor inperformant code

2018-12-06 Thread Stefan Kanthak
"Segher Boessenkool" wrote: > On Wed, Dec 05, 2018 at 02:19:14AM +0100, Stefan Kanthak wrote: >> "Paul Koning" wrote: >> >> > Yes, that's a rather nasty cut & paste error I made. >> >> I suspected that. >> Replacing &g

misleading "-Wmisleading-indentation" warning on break in switch/case?

2017-08-24 Thread Stefan Sobernig
atement, but the latter is misleadingly indented > as if it were guarded by the 'if' >) out = 1; break; > ^ > d.c:6:7: warning: variable 'out' set but not used [-Wunused-but-set-variable] >int out = 0; >^~~ Droping/aligning the second break on its own line silences the warning, but I see no reason to do so. Pls. advise! Stefan

Re: Building on gcc112 is stuck in msgfmt

2017-08-29 Thread Stefan Ring
On Tue, Aug 29, 2017 at 9:32 AM, Martin Liška wrote: > On 08/28/2017 09:15 PM, Martin Liška wrote: >> On 08/28/2017 04:06 PM, Jeff Law wrote: >>> On 08/28/2017 01:16 AM, Martin Liška wrote: Hello. I've just repeatedly seen stuck in build process: make[5]: Entering director

Missed possible branch elimination

2017-10-26 Thread Stefan Ring
While poring over the Transport Tycoon Deluxe disassembly, commonly known to have been hand-written in assembler, I stumbled across this tidbit, which I think is kinda neat: 004057F7 83 7D B8 01 cmp dword ptr [ebp-48h],1 004057FB 1B C0sbb eax,eax 004057FD F

Re: Missed possible branch elimination

2017-11-17 Thread Stefan Ring
On Thu, Oct 26, 2017 at 8:23 PM, Stefan Ring wrote: > While poring over the Transport Tycoon Deluxe disassembly, commonly > known to have been hand-written in assembler, I stumbled across this > tidbit, which I think is kinda neat: > > 004057F7 83 7D B8 01 cmp dwo

template instantiation and anonymous namespaces

2009-07-14 Thread Stefan Lampe
correct. For the program I was working on I use named namespaces to provide the right semantics. Thanks for your time, Stefan -- nonsingleton.hpp #ifndef NON_SINGLETON #define NON_SINGLETON #include namespace { class Dummy {}; } template class Singleton { static ObjectT* object; p

MSVC hook function prologue

2009-09-02 Thread Stefan Dösinger
at other changes are needed to get a functionality like this into mainline? Thank you, Stefan Dösinger Index: gcc/configure.ac === --- gcc/configure.ac (revision 151348) +++ gcc/configure.ac (working copy) @@ -3035,6 +3035,12

Re: MSVC hook function prologue

2009-09-03 Thread Stefan Dösinger
Am Thursday 03 September 2009 00:04:43 schrieb Paolo Bonzini: >> *) The stack alignment code + msvc_prologue is used by Wine on osx though. >> ... > I don't think this would prevent the patch from getting the patch in. Ok, I'll read the patch contribution guidelines again and hope for the best. I

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Thursday 03 September 2009 00:04:43 schrieb Paolo Bonzini: > (define_insn "vswapmov" > [(set (match_operand 0 "register_operand" "0") >(match_operand 1 "register_operand" "1") > (unspec_volatile [] UNSPECV_VSWAPMOV)] I ran into a problem with this: build/genattrtab doesn't like the emp

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 13:47:20 schrieb Paolo Bonzini: > > I guess the error isn't about the const_int 0, but about operand 0. Any > > ideas? > > Yes, you need this: > > [(set (match_operand:SI 0 "register_operand" "=r") >(match_operand:SI 1 "register_operand" "r")) > (u

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 14:23:39 schrieb Paolo Bonzini: > The parallel is implicit in define_insn, so it is not different. It > does not make any harm I guess, but it looks "weird" to a more familiar > eye. :-) Ok, I removed it again :-) > +#ifdef HAVE_AS_IX86_SWAP > + { "msvc_prologue", 0,

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 14:49:42 schrieb Stefan Dösinger: > I attached another version of the patch - I restarted the compile, so I > still don't know if it fully works. Seems to be working - gcc compiles fine, my test function has the right starting bytes. Wine compiles and runs

CVS/SVN binutils and gcc on MacOS X?

2009-09-04 Thread Stefan Dösinger
is a known problem? Am I doing something wrong here? Do I need any special Darwin patches for as or gcc? Thanks, Stefan

Re: CVS/SVN binutils and gcc on MacOS X?

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 23:35:55 schrieb Andreas Tobler: > No, you don't do anything wrong. It is simply not supported, the > binutils from gnu. > > You can rely on gcc being able to work with the MacOS-X 'binutils' aka: > ld, as. But don't try to build it for yourself. It's somehow like sparc

Re: CVS/SVN binutils and gcc on MacOS X?

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 23:50:11 schrieb Stefan Dösinger: > Unfortunately I need support for the swap suffix in as, so using the system > binaries is not an option. Is the only thing I can do to find the source of > the as version, backport the swap suffix and hope for the best? Ok,

Re: MSVC hook function prologue

2009-09-05 Thread Stefan Dösinger
Are there non-Microsoft DLLs that expect to be hooked this way? If so, I think the patch is interesting for gcc independent of whether it is useful for Wine. I haven't seen any so far. Its certainly possible some server apps have the 2 byte nop at the beginning of functions for a similar hot-

Re: MSVC hook function prologue

2009-09-06 Thread Stefan Dösinger
Am Saturday 05 September 2009 17:08:19 schrieb Ross Ridge: > If this patch is essentially only for one application, maybe the idea > of implementing a more generally useful naked attribute would be the > way to go. I implemented a naked attribute in my private sources to > do something similar, al

Re: MSVC hook function prologue

2009-09-08 Thread Stefan Dösinger
Ok, Alexandre hasn't changed his opinion, the function attrib is ok with him. I attached another version of the patch, this time adding some testcases. Two more questions though: *) How can I skip the tests if msvc_prologue is not available because as doesn't support the swap suffix? I think it

Re: wie kann Ich gcc herunterladen ?

2009-09-25 Thread Stefan Dösinger
Am 25.09.2009 um 07:38 schrieb gerhard gangl: hallo gcc_team suche gcc zum downloaden wer kann mir helfen ? liebe grüße u. danke im vorraus _gerhard_ gangl, reichsstr. 77, 8045 graz Fast alle Linux Distributionen bringen gcc mit, man muss ihn nur mit dem Paketmanager installieren. Ansonste

Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
e has it. Does gcc attempt to detect binutils features, or does it just assume that everything it needs is there? Thanks for your help, Stefan Dösinger gcc.diff Description: Binary data

RE: Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
> -Original Message- > From: H.J. Lu [mailto:hjl.to...@gmail.com] Nice to see a familiar face, or better, mail address :-) > You need to check assembler feature with autconf before using them. > See HAVE_AS_IX86_SAHF as example. Thanks! Does that look ok? It seems to detect the support

RE: Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
> You can make a new instruction pattern with an UNSPEC_VOLATILE pattern. > For a quick prototype you could also use an assembler prologue, > although > if you need not experiment with different insn sequences, this will > likely > be more work in the long run if/when assembler prologues are eventu

RE: Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
> An example of an unspec_volatile instruction pattern in > config/i386/i386.md > is "cld". I ran across that, your hints should give me some information to chew on for the next hours. Currently I am compiling with this code to see what happens: (define_insn "movnop" [(unspec_volatile [(const_int

RE: Feature request concerning opcodes in the function prolog

2009-01-08 Thread Stefan Dösinger
> >> But since you have to have a new gas anyway, wouldn't it be simpler > to > >> have > >> a new option for gas to instruct it to choose the opcodes that are > >> expected > >> by the win32 applications? > > This was my first idea, but Alexandre Julliard(the Wine maintainer) > disliked > > it and

RE: Feature request concerning opcodes in the function prolog

2009-01-08 Thread Stefan Dösinger
> You don't need to force the frame pointer on, it is sufficient to say > that > ebp needs restoring at the end of the function no matter if it looks > otherwise > used or not - and you have to take the frame size impact of the saved > ebp into > account. How does this fit together with the stack

RE: Feature request concerning opcodes in the function prolog

2009-01-08 Thread Stefan Dösinger
> If ebp needs to be saved because it contains a user variable, it is > better > not to pop it in the prologue - pop it in the epilogue instead, and you > don't > need to have another save/restore. Sounds reasonable. Is there any flag I can set to make the epilogue pop ebp? > This can be done wit

RE: Feature request concerning opcodes in the function prolog

2009-01-12 Thread Stefan Dösinger
Here's some code attached that actually works, but is far from perfect. The 'msvc_prologue' attribute is limited to 32 bit. None of the applications that try to place hooks are ported to Win64 yet, so it is impossible to tell what they'll need. Besides, maybe I am lucky that when they appear I can

RE: Feature request concerning opcodes in the function prolog

2009-01-12 Thread Stefan Dösinger
> Have you thought about making .s an assembler command-line flag, so > that > this flag could be passed automatically by the compiler under mingw? Yes. For my purposes it is not really suitable, because we have to make sure that the push %ebp and mov %esp, %ebp are there, no matter what the compi

Problem with type safety and the "sentinel" attribute

2006-06-09 Thread Stefan Westerfeld
can have both? By the way, there is already an existing gcc bug, which is about the same thing (NULL passed within named args), but wants to have it the way it works now: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21911 so if it gets changed, then gcc might need to support both - NULL

Re: Problem with type safety and the "sentinel" attribute

2006-06-13 Thread Stefan Westerfeld
...); > that's for instance a function which is called in many projects. > putting the burden on the caller is clearly the wrong trade off here. > > so please take this as a vote for the worthiness of a fix ;) Good. Of course I would be happy if somebody with knowledge of the compiler source could implement it. I never hacked gcc code before. But since you suggested sending a patch, I'll at least try to implement a new __null_terminated__ attribute, and ask for help if I can't figure out what to do. Cu... Stefan -- Stefan Westerfeld, Hamburg/Germany, http://space.twc.de/~stefan

Optimiser failure for ternary foo == 0L ? NULL : bar;

2021-07-17 Thread Stefan Kanthak
e: 66 90 xchg %ax,%ax 10: 31 c0 xor%eax,%eax 12: c3 ret not amused Stefan Kanthak

Are some builtin functions (for example log() vs. sqrt()) more equal than others?

2021-07-30 Thread Stefan Kanthak
on log(sqrt(5.0) * 0.5 + 0.5)! NOT amused Stefan Kanthak

Re: Are some builtin functions (for example log() vs. sqrt()) more equal than others?

2021-07-30 Thread Stefan Kanthak
before calling the main() routine. JFTR: doing so would but inhibit the placement of such constants in the read-only data section ... what is also allowed by the standard. regards Stefan

Re: Are some builtin functions (for example log() vs. sqrt()) more equal than others?

2021-07-30 Thread Stefan Kanthak
"Joseph Myers" wrote: > On Fri, 30 Jul 2021, Stefan Kanthak wrote: > >> Joseph Myers wrote: >> >> > None of these are valid constant expressions as defined by the standard >> > (constant expressions cannot involve evaluated function calls). >

Suboptimal code generated for __buitlin_rint on AMD64 without SS4_4.1

2021-08-05 Thread Stefan Kanthak
6 c1 orpdxmm0, xmm1 # xmm0 = round(argument) 20: c3 .L0: ret .end regards Stefan

Suboptimal code generated for __buitlin_ceil on AMD64 without SS4_4.1

2021-08-05 Thread Stefan Kanthak
6 0f 56 c3 orpdxmm0, xmm3 # xmm0 = ceil(argument) 40: c3 .L0: ret .end regards Stefan

Suboptimal code generated for __buitlin_trunc on AMD64 without SS4_4.1

2021-08-05 Thread Stefan Kanthak
# xmm0 = (argument & -0.0) ? -0.0 : 0.0 1c: 66 0f 56 c1 orpdxmm0, xmm1 # xmm0 = trunc(argument) 20: c3 .L0: ret .end regards Stefan

Suboptimal code generated for __buitlin_floor on AMD64 without SS4_4.1

2021-08-05 Thread Stefan Kanthak
66 0f 73 d0 3fpsrlq xmm0, 63 37: 66 0f 73 f0 3fpsllq xmm0, 63 # xmm0 = (argument & -0.0) ? -0.0 : 0.0 3c: 66 0f 56 c3 orpdxmm0, xmm3 # xmm0 = floor(argument) 40: c3 .L0: ret .end regards Stefan

Re: Suboptimal code generated for __buitlin_trunc on AMD64 without SS4_4.1

2021-08-05 Thread Stefan Kanthak
Gabriel Paubert wrote: > On Thu, Aug 05, 2021 at 09:25:02AM +0200, Stefan Kanthak wrote: >> Hi, >> >> targeting AMD64 alias x86_64 with -O3, GCC 10.2.0 generates the >> following code (13 instructions using 57 bytes, plus 4 quadwords >> using 32 bytes) for _

Re: Suboptimal code generated for __buitlin_trunc on AMD64 without SS4_4.1

2021-08-06 Thread Stefan Kanthak
Gabriel Paubert wrote: > Hi, > > On Thu, Aug 05, 2021 at 01:58:12PM +0200, Stefan Kanthak wrote: >> Gabriel Paubert wrote: >> >> >> > On Thu, Aug 05, 2021 at 09:25:02AM +0200, Stefan Kanthak wrote: >> >> .intel_

Re: Suboptimal code generated for __buitlin_trunc on AMD64 without SS4_4.1

2021-08-06 Thread Stefan Kanthak
Michael Matz wrote: > Hello, > > On Fri, 6 Aug 2021, Stefan Kanthak wrote: > >> For -ffast-math, where the sign of -0.0 is not handled and the spurios >> invalid floating-point exception for |argument| >= 2**63 is acceptable, > > This claim would need to be p

Re: Suboptimal code generated for __buitlin_trunc on AMD64 without SS4_4.1

2021-08-06 Thread Stefan Kanthak
Gabriel Paubert wrote: > On Fri, Aug 06, 2021 at 02:43:34PM +0200, Stefan Kanthak wrote: >> Gabriel Paubert wrote: >> >> > Hi, >> > >> > On Thu, Aug 05, 2021 at 01:58:12PM +0200, Stefan Kanthak wrote: [...] >> >> The whole idea

Re: Suboptimal code generated for __buitlin_trunc on AMD64 without SS4_4.1

2021-08-06 Thread Stefan Kanthak
Richard Biener wrote: > On August 6, 2021 4:32:48 PM GMT+02:00, Stefan Kanthak > wrote: >>Michael Matz wrote: >>> Btw, have you made speed measurements with your improvements? >> >>No. [...] >>If the constant happens to be present in L1 cache, it MAY lo

Optimizer failure

2021-08-07 Thread Stefan Kanthak
eax testl %eax, %eax js L0 leal1(%eax), %edx movl$0, %eax # SUPERFLUOUS: cmovne %edx, %eax# cmovne is only executed if eax was not 0 ret L0: subl$1, %eax ret regards Stefan

Re: Suboptimal code generated for __buitlin_trunc on AMD64 without SS4_4.1

2021-08-07 Thread Stefan Kanthak
Joseph Myers wrote: > On Fri, 6 Aug 2021, Stefan Kanthak wrote: PLEASE DON'T STRIP ATTRIBUTION LINES: I did not write the following paragraph! >> > I don't know what the standard says about NaNs in this case, I seem to >> > remember that arithmetic instructions

Superfluous branches due to insufficient flow analysis

2021-08-13 Thread Stefan Kanthak
movapd %xmm1, %xmm0 ret .L15: jne .L4 movabsq $-9223372036854775808, %rdx movq%xmm1, %rax andq%rdx, %rax orq $1, %rax movq%rax, %xmm0 ret Stefan

Re: Superfluous branches due to insufficient flow analysis

2021-08-14 Thread Stefan Kanthak
"Gabriel Ravier" wrote: Please don't FULL QUOTE! > On 8/13/21 8:58 PM, Stefan Kanthak wrote: >> Hi, >> >> compile the following naive implementation of nextafter() for AMD64: >> >> JFTR: ignore the aliasing casts, they don't matter here!

Re: 3rd deficiency (was: Superfluous branches due to insufficient flow analysis)

2021-08-14 Thread Stefan Kanthak
Gabriel Ravier wrote: Independent from the defunct flow analysis in the presence of NaNs, my example demonstrates another minor deficiency: know thy instruction set! See the comments in the assembly below. > On 8/13/21 8:58 PM, Stefan Kanthak wrote: >> Hi, >> >> compil

  1   2   >