public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Proposal
@ 2001-09-18  9:32 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-18  9:32 UTC (permalink / raw)
  To: gcc, trt

<<I'm puzzled by the argument against _ as separator in numbers,
that 1000000000000 can be written 1000 * 1000 * 1000 * 1000.
>>

By the way, speaking from an Ada perspective, once you get used to using
_ as a separator in numbers, you cannot imagine how languages without
such a feature are usable :-)

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Proposal
@ 2013-06-26 17:47 Barrister David Lopez Esq
  0 siblings, 0 replies; 45+ messages in thread
From: Barrister David Lopez Esq @ 2013-06-26 17:47 UTC (permalink / raw)
  To: gcc

My name is Barrister David Lopez Esq of the MMS Law Firm in Madrid .I have a proposal for you, if you are interested,email me at  davlopez4@aol.com 

Best regards.
Barrister David
davlopez4@aol.com



^ permalink raw reply	[flat|nested] 45+ messages in thread
* Proposal
@ 2013-06-26 17:41 Barrister David Lopez Esq
  2013-06-26 18:15 ` Proposal Paolo Carlini
  0 siblings, 1 reply; 45+ messages in thread
From: Barrister David Lopez Esq @ 2013-06-26 17:41 UTC (permalink / raw)
  To: gcc

My name is Barrister David Lopez Esq of the MMS Law Firm in Madrid .I have a proposal for you, if you are interested,email me at  davlopez4@aol.com 

Best regards.
Barrister David
davlopez4@aol.com



^ permalink raw reply	[flat|nested] 45+ messages in thread
* Proposal
@ 2012-09-03 18:35 Afeez Basit
  0 siblings, 0 replies; 45+ messages in thread
From: Afeez Basit @ 2012-09-03 18:35 UTC (permalink / raw)
  To: gcc

Good day,

I am Afeez Basit I represent the interest of my brother in-law who is a minister in the Syrian Government. As you probably know, there is a lot of crisis going on currently in Syria and my brother in-law is having problems with the ruling party and they are currently investigating his ministry. While he is sure that he has not done anything wrong, there is also every reason for him to secure to think ahead his family’s future in case the unexpected happens. He has asked me to help him find a reputable foreigner who can help him invest a substantial amount of money. I am contacting you with the hope that you can assist with investments in the market of your country. We will provide the funds. If you are interested in learning more about this opportunity, please kindly contact me back via email and I will give you more details. Hopefully, we can do some good business together.

Regards,

Afeez Basit.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Proposal
@ 2012-09-03 15:16 Afeez Basit
  0 siblings, 0 replies; 45+ messages in thread
From: Afeez Basit @ 2012-09-03 15:16 UTC (permalink / raw)
  To: gcc

Good day,

I am Afeez Basit I represent the interest of my brother in-law who is a minister in the Syrian Government. As you probably know, there is a lot of crisis going on currently in Syria and my brother in-law is having problems with the ruling party and they are currently investigating his ministry. While he is sure that he has not done anything wrong, there is also every reason for him to secure to think ahead his family’s future in case the unexpected happens. He has asked me to help him find a reputable foreigner who can help him invest a substantial amount of money. I am contacting you with the hope that you can assist with investments in the market of your country. We will provide the funds. If you are interested in learning more about this opportunity, please kindly contact me back via email and I will give you more details. Hopefully, we can do some good business together.

Regards,

Afeez Basit.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: Proposal
@ 2001-09-19  2:44 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-19  2:44 UTC (permalink / raw)
  To: Richard.Earnshaw, tim; +Cc: gcc, neil, pfk, zack

<<As should (IMO) 0xffff_0000_ffff_ffffUL
>>

Yes, as in Ada, hex digits should definitely be included, indeed grouping
hex digits in groups of 4, as in the above example, is one of the most
useful applications of this lexical device.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: Proposal
@ 2001-09-19  2:34 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-19  2:34 UTC (permalink / raw)
  To: neil, tim; +Cc: gcc, pfk, zack

I always learned pi in groups of 5

3.14159_26535_89793 ... (and I still think I could remember 100 digits :-)

but yes, of course, your example is most relevant :-)

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: Proposal
@ 2001-09-19  0:06 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-19  0:06 UTC (permalink / raw)
  To: pfk, zack; +Cc: gcc

<<You should investigate the rules for numeric syntax in languages
which already have this notation, such as Ada and Perl.
>>

In Ada, underscores can only be used to separate digits, and the extension
is thus a simple one from a syntactic definition point of view. The actual
excerpt from the Ada grammar is as follows:

2   decimal_literal ::= numeral [.numeral] [exponent]

3   numeral ::= digit {[underline] digit}

4   exponent ::= E [+] numeral | E - numeral

I don't see any language or definition issue in introducing exactly this
same restricted form into C


       16777216_UL
       16777216U_L
       0._1234
       0x_1234
       12.34_e+56
       12.34e_+56

All these should be illegal if the above approach is followed, and I think
that is the right choice. The only legitimate use of the underscore is to
separate digits in a long sequence of digits.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: Proposal
@ 2001-09-18 12:30 dewar
  2001-09-18 23:01 ` Proposal Zack Weinberg
  0 siblings, 1 reply; 45+ messages in thread
From: dewar @ 2001-09-18 12:30 UTC (permalink / raw)
  To: gcc, pfk, zack

<<Most programmers don't know the standard and are not interested in knowing
the standard, because their (present) job is to solve a problem for one or
two different systems, not for every theoretically possible system,
and the standard supports nearly every stuff which has more than 4 pins ;-)
>>

This very much varies by language. Nearly all Ada programmers *do* know
the Ada standard, and use it as at least one of their reference sources.
And it is probably not coincidental that the Ada ISO/ANSI standard *is*
freely available.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: Proposal
@ 2001-09-17  8:55 Thomas R. Truscott
  0 siblings, 0 replies; 45+ messages in thread
From: Thomas R. Truscott @ 2001-09-17  8:55 UTC (permalink / raw)
  To: gcc

Perhaps http://gcc.gnu.org/projects/ is appropriate for your proposals.
Perhaps that page should be subdivided
into bug fixes, optimizations, language extensions, etc.

I'm puzzled by the argument against _ as separator in numbers,
that 1000000000000 can be written 1000 * 1000 * 1000 * 1000.
In addition to operator precedence hazard,
the following typically results in a negative value in x:

   long long x = 1000 * 1000 * 1000 * 1000;

(Were you just having fun? :-)

Tom Truscott

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Proposal
@ 2001-09-15 11:45 Frank Klemm
  2001-09-15 12:15 ` Proposal Gerald Pfeifer
  2001-09-17 16:00 ` Proposal Neil Booth
  0 siblings, 2 replies; 45+ messages in thread
From: Frank Klemm @ 2001-09-15 11:45 UTC (permalink / raw)
  To: gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6778 bytes --]

I propose a websites with the following contents:

  - gcc language extentions
  - possible performance enhancements 2)
  - warnings of the compiler  3)
  - libc related issues

  - gcc language extentions (future)  1)
  - possible performance enhancements (future)
  - warnings of the compiler (future)  
  - libc related issues (future)

  - gcc language extentions (decline)
  - possible performance enhancements (decline)
  - warnings of the compiler (decline)
  - libc related issues (decline)

  
Every proposal is discussed in the mailing list and is classified into:

  - should be done in the next time
  - future improvement, useful, but too difficult to implement in the next time
  - decline, not so useful, too many problems, too difficult to implement
  
  - gcc language extentions: Extention of the language C or C++
  - where are performance improvements possible
  - additional or superfluous warnings (or errors)
  - libc related issues, missing library function, problems,
    bugs and flaws


Performance test suite

  - list of small *.inc files containing a small piece of code  4)
  - a body function which does all the rest
  - a table for the Duron/Athlon family, for the PII/PIII/Celeron family and
    one for the P4 family
  - a table for -O, -O2 and for -O3
  - task is to show improvements and deterioration in the compilers code


Test#  Description                    operations/µs
                                2.95.2  3.00    3.01    3.02
-------------------------------------------------------------
 137  round test (int)floor()   11.5    11.9    11.8    191
 138  foobar                    91      75      75      92








1) ******************************************************************************

Separator for long number
~~~~~~~~~~~~~~~~~~~~~~~~~

The bigger the number the more difficult is it to decipher large numbers:

    0xFFFFFFFFFFFFFFFC
    1000000000000
    0x0FFFFFFFFFFFFFFC
    10000000000000
    3.14159265358979
    12768487.0

Ada 83 and Ada 95 allows '_' in numbers to separate groups of numbers:

    0xFFFF_FFFF_FFFF_FFFC
    1_000_000_000_000
    0x0FFF_FFFF_FFFF_FFFC
    10_000_000_000_000
    3.14159_26535_8979
    12_768_487.0
    
The '_' is allowed at every position between digits, but it is recommend to use 
it in the way above.

  integral hexadecimal numbers:		4 digits
  decimal integral part of numbers:	3 digits
  fractional part of numbers:		5 digits

May be we should introduce this is C too.

It is not allowed to compose numbers with '_' inside of macros.

  #define MILLION	_MERGE5 ( 1, _, 000, _, 000 )

This allows easily to write a filter to generate C89 or C99 files.
    

Problems
~~~~~~~~

The are no problems with foreward compatibilty, syntax always generates a syntax error on standard C99 compilers.
Programs are not backward compatible at all.

gcc should contain a filter to convert files with '_' inside of numbers into
C89 or C99 files.

    gcc -_ program.c > filtered/program.c


Pros
~~~~

It makes C and C++ programs easier to read
It is easier to find errors.


Cons
~~~~

Bad backward compatibility.
There are other writing possible:

  1000000000000      = 1_000_000_000_000     = 1000 * 1000 * 1000 * 1000
  0xFFFFFFFFFFFFFF00 = 0xFFFF_FFFF_FFFF_FF00 = ~0x100
  
But it is easy to introduce other bugs with these writings




2 ****************************************************************************

Command line ----------------------------------------

gcc302 -O3 -fomit-frame-pointer

C code ----------------------------------------------

unsigned long long x;

void
main ( void )
{
    x >>= 32;
    return 0;
}

Assembler code ---------------------------------------

main:	pushl	%ebp		<------
	movl	%esp, %ebp	<------
	subl	$8, %esp	<------
	movl	x+4, %eax
	xorl	%edx, %edx
	andl	$-16, %esp	<------
	movl	%edx, x+4
	movl	%eax, x
	movl	%ebp, %esp	<------
	xorl	%eax, %eax
	popl	%ebp		<------
	ret


Suggested optimized Assembler code: ------------------------------

// -O2
main:	movl	x+4, %eax
	xorl	%edx, %edx
	movl	%eax, x
	movl	%edx, x+4
	xorl	%eax, %eax
	ret
	
// -Os	
main:	movl	$x, %ecx
	xorl	%edx, %edx
	movl	4(%ecx), %eax
	movl	%edx, 4(%ecx)
	movl	%eax,  (%ecx)
	xorl	%eax, %eax
	ret

// -Oss
main:	movl	$x+4, %ecx
	xorl	%eax, %eax
	movl	(%ecx), %edx
	movl	%eax, (%ecx)
	movl	%edx, -4(%ecx)
	ret

Current version: 33 byte
proposed -O2:    21 byte
proposed -Os:    18 byte
proposed -Oss:   15 byte


Remarks ----------------------------------------------

Stack alignment of gcc 3.02 is really a nasty thing.
It blows up code, it slows down code. It is really a pain.

Before doing alignment on stack there should be clarified:

  - who is responsable for aligning (caller / called)
  - when it have a chance to speed up code (you need at least 64 bit items)
  - what other conditions are needed to speed up code
    (manipulating %esp decreases speed of push/pop/mov)


Proposal ------------------------------------------------

  - A caller should never align the stack
  - A function aligns the stack if there are arrays of 64 bit local
    variables on the stack
  - If there are many 64 bit local variables on stack the function may align
    the stack
  - functions arguments can be copied to such a local place if the variable
    is often used and not copied to a FPU register.

3 ***************************************************************


Problem
~~~~~~~

Using of operator <=, >= or != although only one of the two partial conditions
is possible:

   unsigned int  x;
   if ( x <= 0 ) {
       ...
   }

   unsigned char  c;
   if ( c != 255 ) {
       ...
   }

This is often a hint that the code is wrong.
It should be possible to genarte a warning for such code.


4 *******************************************************************

/*
 *  Rounding floats to integers, always rounding to -inf.
 */

/* Argument is the ca. execution time on a 1 GHz computer in milliseconds */

float  test0137_float [1000];
int    test0137_int   [1000];

struct result
test0137_run ( unsigned int  ms )
{
    struct result  ret;
    unsigned int   i;
    unsigned int   j;
    unsigned int   k;

    for ( k = 0; k < ms; k++ )
        for ( i = 0; i < 200000; i++ )
            for ( j = 0; j < 1000; j++ )
                test0137_int [j] = (int) floor (test0137_float [j]);

    ret.name = "round test (int)floor()";
    ret.ops  = 200.e6 * ms;
    return ret;
}

void
test0137_init ( void )
{
}

/* The rest will be done by the program around */


-- 
Mit freundlichen Grüßen
Frank Klemm
 
eMail | pfk@uni-jena.de       home: pfk@schnecke.offl.uni-jena.de
      | fingerprint: CDBB D7AE 0488 96B2  E0F9 98C2 1441 051C
phone | +49 (3641) 64-2721    home: +49 (3641) 390545
sMail | R.-Breitscheid-Str. 43, 07747 Jena, Germany

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2013-06-26 18:40 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-18  9:32 Proposal dewar
  -- strict thread matches above, loose matches on Subject: below --
2013-06-26 17:47 Proposal Barrister David Lopez Esq
2013-06-26 17:41 Proposal Barrister David Lopez Esq
2013-06-26 18:15 ` Proposal Paolo Carlini
2013-06-26 18:40   ` Proposal Daniel Santos
2012-09-03 18:35 Proposal Afeez Basit
2012-09-03 15:16 Proposal Afeez Basit
2001-09-19  2:44 Proposal dewar
2001-09-19  2:34 Proposal dewar
2001-09-19  0:06 Proposal dewar
2001-09-18 12:30 Proposal dewar
2001-09-18 23:01 ` Proposal Zack Weinberg
2001-09-17  8:55 Proposal Thomas R. Truscott
2001-09-15 11:45 Proposal Frank Klemm
2001-09-15 12:15 ` Proposal Gerald Pfeifer
2001-09-17 16:00 ` Proposal Neil Booth
2001-09-18  2:30   ` Proposal Joseph S. Myers
2001-09-18 10:21     ` Proposal Zack Weinberg
2001-09-18 11:14       ` Proposal Joseph S. Myers
2001-09-18 22:20         ` Proposal Zack Weinberg
2001-09-19  1:14           ` Proposal Joseph S. Myers
2001-09-18 12:23       ` Proposal Frank Klemm
2001-09-18 22:37         ` Proposal Zack Weinberg
2001-09-19  0:02           ` Proposal Neil Booth
2001-09-19  2:23             ` Proposal Tim Hollebeek
2001-09-19  2:41               ` Proposal Richard Earnshaw
2001-09-19 13:38         ` Proposal Joe Buck
2001-09-18 15:35       ` Proposal Robert Lipe
2001-09-18 16:59         ` Proposal Russ Allbery
2001-09-20 11:17           ` Proposal Kai Henningsen
2001-09-20 12:34             ` Proposal Russ Allbery
2001-09-18  9:48   ` Proposal Frank Klemm
2001-09-18 11:06     ` Proposal Neil Booth
2001-09-18 11:37     ` Proposal Kevin Handy
2001-09-18 15:48       ` Proposal Neil Booth
2001-09-18 15:55         ` Proposal Toon Moene
2001-09-27  5:39     ` Proposal Alexandre Oliva
2001-09-27  7:09       ` Proposal Frank Klemm
2001-09-27 16:22         ` Proposal Zack Weinberg
2001-09-29 15:45           ` Proposal Frank Klemm
2001-09-30  9:35             ` Proposal Zack Weinberg
2001-09-27 16:36         ` Proposal Neil Booth
2001-09-29 15:45           ` Proposal Frank Klemm
2001-09-29 17:22             ` Proposal Daniel Jacobowitz
2001-10-03  3:52         ` Proposal Fergus Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).