Re: [Tinycc-devel] TOK_PPNUM for asm

2016-05-07 Thread Sergey Korshunoff
> > There may be a float numbers in assembler like 0x1eP+1 and 10e-1

> Are you sure that syntax is correct? Can you show an example that is
> accepted by GCC or TCC?

An example of float declaration (compiles by gcc but not tcc)
data
.global pi_minus
pi_minus:
.float 0f-31415926535897932384626433832795028841971.693993751E-40

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] TOK_PPNUM for asm

2016-05-05 Thread Edmund Grimley Evans
> There may be a float numbers in assembler like 0x1eP+1 and 10e-1

Are you sure that syntax is correct? Can you show an example that is
accepted by GCC or TCC?

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] TOK_PPNUM for asm

2016-05-05 Thread Sergey Korshunoff
> Also, presumably there's a good reason why your patch modified 43
> lines, rather than just one, as below. What is that reason?

There may be a float numbers in assembler like 0x1eP+1 and 10e-1 but
0x1e+1 must be parsed as 0x1e +1

2016-05-05 2:12 GMT+03:00 Edmund Grimley Evans :
>> > Proposed patch: handle 0x1e+1 as 0x1e +1 if (parse_flags & 
>> > PARSE_FLAG_ASM_FILE)
>>
>> Please explain and justify exactly what you're trying to do. What do
>> you believe the correct definition of a pp-number is when tokenising
>> assembly? What definition does the GNU toolchain use?
>
> Also, presumably there's a good reason why your patch modified 43
> lines, rather than just one, as below. What is that reason?
>
> diff --git a/tccpp.c b/tccpp.c
> index ad35687..7dd6d36 100644
> --- a/tccpp.c
> +++ b/tccpp.c
> @@ -2766,6 +2766,7 @@ maybe_newline:
>|| c == '.'
>|| ((c == '+' || c == '-')
>&& (t == 'e' || t == 'E' || t == 'p' || t == 'P')
> +  && !(parse_flags & PARSE_FLAG_ASM_FILE)
>)))
>  break;
>  }
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] TOK_PPNUM for asm

2016-05-04 Thread Edmund Grimley Evans
> > Proposed patch: handle 0x1e+1 as 0x1e +1 if (parse_flags & 
> > PARSE_FLAG_ASM_FILE)
> 
> Please explain and justify exactly what you're trying to do. What do
> you believe the correct definition of a pp-number is when tokenising
> assembly? What definition does the GNU toolchain use?

Also, presumably there's a good reason why your patch modified 43
lines, rather than just one, as below. What is that reason?

diff --git a/tccpp.c b/tccpp.c
index ad35687..7dd6d36 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -2766,6 +2766,7 @@ maybe_newline:
   || c == '.'
   || ((c == '+' || c == '-')
   && (t == 'e' || t == 'E' || t == 'p' || t == 'P')
+  && !(parse_flags & PARSE_FLAG_ASM_FILE)
   )))
 break;
 }

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] TOK_PPNUM for asm

2016-05-04 Thread Edmund Grimley Evans
Sergey Korshunoff :

> Proposed patch: handle 0x1e+1 as 0x1e +1 if (parse_flags & 
> PARSE_FLAG_ASM_FILE)

Please explain and justify exactly what you're trying to do. What do
you believe the correct definition of a pp-number is when tokenising
assembly? What definition does the GNU toolchain use?

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] TOK_PPNUM for asm

2016-05-01 Thread Sergey Korshunoff
Hi!
Proposed patch: handle 0x1e+1 as 0x1e +1 if (parse_flags & PARSE_FLAG_ASM_FILE)
This helps to compile asm code like:
__asm("mov $0x1e" "-1");
(a code from linux kernel)

https://github.com/seyko2/tinycc/commit/22d279c24ce8873b3f90b364478fad70f8a6dae3

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel