public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Introduce be/le selectors
@ 2018-05-21 21:59 Segher Boessenkool
  2018-05-21 22:12 ` Rainer Orth
  2018-05-22 21:36 ` Jeff Law
  0 siblings, 2 replies; 11+ messages in thread
From: Segher Boessenkool @ 2018-05-21 21:59 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

This patch creates "be" and "le" selectors, which can be used by all
architectures, similar to ilp32 and lp64.

Is this okay for trunk?


Segher


2017-05-21  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_be): New.
	(check_effective_target_le): New.

---
 gcc/testsuite/lib/target-supports.exp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index cfc22a2..3b9460d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2641,6 +2641,22 @@ proc check_effective_target_long_neq_int { } {
     }]
 }
 
+# Return 1 if we're generating big-endian code.
+
+proc check_effective_target_be { } {
+    return [check_no_compiler_messages be object {
+	int dummy[__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1 : -1];
+    }]
+}
+
+# Return 1 if we're generating little-endian code.
+
+proc check_effective_target_le { } {
+    return [check_no_compiler_messages le object {
+	int dummy[__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? 1 : -1];
+    }]
+}
+
 # Return 1 if the target supports long double larger than double,
 # 0 otherwise.
 
-- 
1.8.3.1

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-21 21:59 [PATCH] testsuite: Introduce be/le selectors Segher Boessenkool
@ 2018-05-21 22:12 ` Rainer Orth
  2018-05-21 23:02   ` Segher Boessenkool
  2018-05-22 21:36 ` Jeff Law
  1 sibling, 1 reply; 11+ messages in thread
From: Rainer Orth @ 2018-05-21 22:12 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches

Hi Segher,

> This patch creates "be" and "le" selectors, which can be used by all
> architectures, similar to ilp32 and lp64.
>
> Is this okay for trunk?

two issues: I don't find be and le particularly expressive.  Maybe
big-endian and little-endian?

Besides, whatever we do, the new keywords need documenting in
sourcebuild.texi.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-21 22:12 ` Rainer Orth
@ 2018-05-21 23:02   ` Segher Boessenkool
  0 siblings, 0 replies; 11+ messages in thread
From: Segher Boessenkool @ 2018-05-21 23:02 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

On Mon, May 21, 2018 at 11:59:43PM +0200, Rainer Orth wrote:
> Hi Segher,
> 
> > This patch creates "be" and "le" selectors, which can be used by all
> > architectures, similar to ilp32 and lp64.
> >
> > Is this okay for trunk?
> 
> two issues: I don't find be and le particularly expressive.  Maybe
> big-endian and little-endian?

But they will be used a _lot_, at least for rs6000, in places where space
is it a premium.  Like in scan-assembler-times and the like.

> Besides, whatever we do, the new keywords need documenting in
> sourcebuild.texi.

Ah yes, I forgot.  Thanks.


Segher

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-21 21:59 [PATCH] testsuite: Introduce be/le selectors Segher Boessenkool
  2018-05-21 22:12 ` Rainer Orth
@ 2018-05-22 21:36 ` Jeff Law
  2018-05-23  9:33   ` Richard Earnshaw (lists)
  2018-05-23 17:53   ` Segher Boessenkool
  1 sibling, 2 replies; 11+ messages in thread
From: Jeff Law @ 2018-05-22 21:36 UTC (permalink / raw)
  To: Segher Boessenkool, gcc-patches

On 05/21/2018 03:46 PM, Segher Boessenkool wrote:
> This patch creates "be" and "le" selectors, which can be used by all
> architectures, similar to ilp32 and lp64.
> 
> Is this okay for trunk?
> 
> 
> Segher
> 
> 
> 2017-05-21  Segher Boessenkool  <segher@kernel.crashing.org>
> 
> gcc/testsuite/
> 	* lib/target-supports.exp (check_effective_target_be): New.
> 	(check_effective_target_le): New.
I think this is fine.  "be" "le" are used all over the place in gcc and
the kernel to denote big/little endian.

jeff

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-22 21:36 ` Jeff Law
@ 2018-05-23  9:33   ` Richard Earnshaw (lists)
  2018-05-24 17:31     ` Segher Boessenkool
  2018-05-23 17:53   ` Segher Boessenkool
  1 sibling, 1 reply; 11+ messages in thread
From: Richard Earnshaw (lists) @ 2018-05-23  9:33 UTC (permalink / raw)
  To: Jeff Law, Segher Boessenkool, gcc-patches

On 22/05/18 22:21, Jeff Law wrote:
> On 05/21/2018 03:46 PM, Segher Boessenkool wrote:
>> This patch creates "be" and "le" selectors, which can be used by all
>> architectures, similar to ilp32 and lp64.
>>
>> Is this okay for trunk?
>>
>>
>> Segher
>>
>>
>> 2017-05-21  Segher Boessenkool  <segher@kernel.crashing.org>
>>
>> gcc/testsuite/
>> 	* lib/target-supports.exp (check_effective_target_be): New.
>> 	(check_effective_target_le): New.
> I think this is fine.  "be" "le" are used all over the place in gcc and
> the kernel to denote big/little endian.

except when el and eb are used for perversity... :-)

R.

> 
> jeff
> 

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-22 21:36 ` Jeff Law
  2018-05-23  9:33   ` Richard Earnshaw (lists)
@ 2018-05-23 17:53   ` Segher Boessenkool
  2018-06-27 16:01     ` [PATCH] Backport " Kelvin Nilsen
  1 sibling, 1 reply; 11+ messages in thread
From: Segher Boessenkool @ 2018-05-23 17:53 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On Tue, May 22, 2018 at 03:21:30PM -0600, Jeff Law wrote:
> On 05/21/2018 03:46 PM, Segher Boessenkool wrote:
> > This patch creates "be" and "le" selectors, which can be used by all
> > architectures, similar to ilp32 and lp64.
>
> I think this is fine.  "be" "le" are used all over the place in gcc and
> the kernel to denote big/little endian.

Thanks.  This is what I checked in (to trunk):


2017-05-23  Segher Boessenkool  <segher@kernel.crashing.org>

	* doc/sourcebuild.texi (Endianness): New subsubsection.

gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_be): New.
	(check_effective_target_le): New.


diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index dfb0578..596007d 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1313,6 +1313,16 @@ By convention, keywords ending in @code{_nocache} can also include options
 specified for the particular test in an earlier @code{dg-options} or
 @code{dg-add-options} directive.
 
+@subsubsection Endianness
+
+@table @code
+@item be
+Target uses big-endian memory order for multi-byte and multi-word data.
+
+@item le
+Target uses little-endian memory order for multi-byte and multi-word data.
+@end table
+
 @subsubsection Data type sizes
 
 @table @code
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index aa1296e6..0a53d7b 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2523,6 +2523,22 @@ proc check_effective_target_next_runtime { } {
     }]
 }
 
+# Return 1 if we're generating code for big-endian memory order.
+
+proc check_effective_target_be { } {
+    return [check_no_compiler_messages be object {
+	int dummy[__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1 : -1];
+    }]
+}
+
+# Return 1 if we're generating code for little-endian memory order.
+
+proc check_effective_target_le { } {
+    return [check_no_compiler_messages le object {
+	int dummy[__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? 1 : -1];
+    }]
+}
+
 # Return 1 if we're generating 32-bit code using default options, 0
 # otherwise.
 
-- 
1.8.3.1

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-23  9:33   ` Richard Earnshaw (lists)
@ 2018-05-24 17:31     ` Segher Boessenkool
  2018-05-25  9:37       ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 11+ messages in thread
From: Segher Boessenkool @ 2018-05-24 17:31 UTC (permalink / raw)
  To: Richard Earnshaw (lists); +Cc: Jeff Law, gcc-patches

On Wed, May 23, 2018 at 10:07:18AM +0100, Richard Earnshaw (lists) wrote:
> On 22/05/18 22:21, Jeff Law wrote:
> > On 05/21/2018 03:46 PM, Segher Boessenkool wrote:
> >> This patch creates "be" and "le" selectors, which can be used by all
> >> architectures, similar to ilp32 and lp64.

> >> 2017-05-21  Segher Boessenkool  <segher@kernel.crashing.org>
> >>
> >> gcc/testsuite/
> >> 	* lib/target-supports.exp (check_effective_target_be): New.
> >> 	(check_effective_target_le): New.
> > I think this is fine.  "be" "le" are used all over the place in gcc and
> > the kernel to denote big/little endian.
> 
> except when el and eb are used for perversity... :-)

It should have been -BE and -EL, because that is what it means.  That
also avoids the -l/-L problem -le and -LE would have ;-)

(Confusing?  Yes, little-endian is confusing).


Segher

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-24 17:31     ` Segher Boessenkool
@ 2018-05-25  9:37       ` Richard Earnshaw (lists)
  2018-05-25 17:28         ` Segher Boessenkool
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Earnshaw (lists) @ 2018-05-25  9:37 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Jeff Law, gcc-patches

On 24/05/18 18:28, Segher Boessenkool wrote:
> On Wed, May 23, 2018 at 10:07:18AM +0100, Richard Earnshaw (lists) wrote:
>> On 22/05/18 22:21, Jeff Law wrote:
>>> On 05/21/2018 03:46 PM, Segher Boessenkool wrote:
>>>> This patch creates "be" and "le" selectors, which can be used by all
>>>> architectures, similar to ilp32 and lp64.
> 
>>>> 2017-05-21  Segher Boessenkool  <segher@kernel.crashing.org>
>>>>
>>>> gcc/testsuite/
>>>> 	* lib/target-supports.exp (check_effective_target_be): New.
>>>> 	(check_effective_target_le): New.
>>> I think this is fine.  "be" "le" are used all over the place in gcc and
>>> the kernel to denote big/little endian.
>>
>> except when el and eb are used for perversity... :-)
> 
> It should have been -BE and -EL, because that is what it means.  That
> also avoids the -l/-L problem -le and -LE would have ;-)
> 
> (Confusing?  Yes, little-endian is confusing).

I beg to differ.  Big endian is the confusing one... :-)

R.

> 
> 
> Segher
> 

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

* Re: [PATCH] testsuite: Introduce be/le selectors
  2018-05-25  9:37       ` Richard Earnshaw (lists)
@ 2018-05-25 17:28         ` Segher Boessenkool
  0 siblings, 0 replies; 11+ messages in thread
From: Segher Boessenkool @ 2018-05-25 17:28 UTC (permalink / raw)
  To: Richard Earnshaw (lists); +Cc: Jeff Law, gcc-patches

On Fri, May 25, 2018 at 10:30:58AM +0100, Richard Earnshaw (lists) wrote:
> On 24/05/18 18:28, Segher Boessenkool wrote:
> > On Wed, May 23, 2018 at 10:07:18AM +0100, Richard Earnshaw (lists) wrote:
> >> On 22/05/18 22:21, Jeff Law wrote:
> >>> On 05/21/2018 03:46 PM, Segher Boessenkool wrote:
> >>>> This patch creates "be" and "le" selectors, which can be used by all
> >>>> architectures, similar to ilp32 and lp64.
> > 
> >>>> 2017-05-21  Segher Boessenkool  <segher@kernel.crashing.org>
> >>>>
> >>>> gcc/testsuite/
> >>>> 	* lib/target-supports.exp (check_effective_target_be): New.
> >>>> 	(check_effective_target_le): New.
> >>> I think this is fine.  "be" "le" are used all over the place in gcc and
> >>> the kernel to denote big/little endian.
> >>
> >> except when el and eb are used for perversity... :-)
> > 
> > It should have been -BE and -EL, because that is what it means.  That
> > also avoids the -l/-L problem -le and -LE would have ;-)
> > 
> > (Confusing?  Yes, little-endian is confusing).
> 
> I beg to differ.  Big endian is the confusing one... :-)

I thought you said -EL is perverse.  Maybe I misunderstood!

(Sorry sorry).


Segher

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

* [PATCH] Backport testsuite: Introduce be/le selectors
  2018-05-23 17:53   ` Segher Boessenkool
@ 2018-06-27 16:01     ` Kelvin Nilsen
  2018-06-27 18:39       ` Jeff Law
  0 siblings, 1 reply; 11+ messages in thread
From: Kelvin Nilsen @ 2018-06-27 16:01 UTC (permalink / raw)
  To: Segher Boessenkool, Jeff Law; +Cc: gcc-patches

Hi Jeff,

Is it ok to backport this patch to gcc 8?  There are other backports of test programs that would like to use the new selector options.

Thanks.


On 5/23/18 12:31 PM, Segher Boessenkool wrote:
> On Tue, May 22, 2018 at 03:21:30PM -0600, Jeff Law wrote:
>> On 05/21/2018 03:46 PM, Segher Boessenkool wrote:
>>> This patch creates "be" and "le" selectors, which can be used by all
>>> architectures, similar to ilp32 and lp64.
>>
>> I think this is fine.  "be" "le" are used all over the place in gcc and
>> the kernel to denote big/little endian.
> 
> Thanks.  This is what I checked in (to trunk):
> 
> 
> 2017-05-23  Segher Boessenkool  <segher@kernel.crashing.org>
> 
> 	* doc/sourcebuild.texi (Endianness): New subsubsection.
> 
> gcc/testsuite/
> 	* lib/target-supports.exp (check_effective_target_be): New.
> 	(check_effective_target_le): New.
> 
> 
> diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
> index dfb0578..596007d 100644
> --- a/gcc/doc/sourcebuild.texi
> +++ b/gcc/doc/sourcebuild.texi
> @@ -1313,6 +1313,16 @@ By convention, keywords ending in @code{_nocache} can also include options
>  specified for the particular test in an earlier @code{dg-options} or
>  @code{dg-add-options} directive.
> 
> +@subsubsection Endianness
> +
> +@table @code
> +@item be
> +Target uses big-endian memory order for multi-byte and multi-word data.
> +
> +@item le
> +Target uses little-endian memory order for multi-byte and multi-word data.
> +@end table
> +
>  @subsubsection Data type sizes
> 
>  @table @code
> diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
> index aa1296e6..0a53d7b 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -2523,6 +2523,22 @@ proc check_effective_target_next_runtime { } {
>      }]
>  }
> 
> +# Return 1 if we're generating code for big-endian memory order.
> +
> +proc check_effective_target_be { } {
> +    return [check_no_compiler_messages be object {
> +	int dummy[__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1 : -1];
> +    }]
> +}
> +
> +# Return 1 if we're generating code for little-endian memory order.
> +
> +proc check_effective_target_le { } {
> +    return [check_no_compiler_messages le object {
> +	int dummy[__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? 1 : -1];
> +    }]
> +}
> +
>  # Return 1 if we're generating 32-bit code using default options, 0
>  # otherwise.
> 

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

* Re: [PATCH] Backport testsuite: Introduce be/le selectors
  2018-06-27 16:01     ` [PATCH] Backport " Kelvin Nilsen
@ 2018-06-27 18:39       ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2018-06-27 18:39 UTC (permalink / raw)
  To: Kelvin Nilsen, Segher Boessenkool; +Cc: gcc-patches

On 06/27/2018 10:01 AM, Kelvin Nilsen wrote:
> Hi Jeff,
> 
> Is it ok to backport this patch to gcc 8?  There are other backports of test programs that would like to use the new selector options.
Sure.
jeff

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

end of thread, other threads:[~2018-06-27 18:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-21 21:59 [PATCH] testsuite: Introduce be/le selectors Segher Boessenkool
2018-05-21 22:12 ` Rainer Orth
2018-05-21 23:02   ` Segher Boessenkool
2018-05-22 21:36 ` Jeff Law
2018-05-23  9:33   ` Richard Earnshaw (lists)
2018-05-24 17:31     ` Segher Boessenkool
2018-05-25  9:37       ` Richard Earnshaw (lists)
2018-05-25 17:28         ` Segher Boessenkool
2018-05-23 17:53   ` Segher Boessenkool
2018-06-27 16:01     ` [PATCH] Backport " Kelvin Nilsen
2018-06-27 18:39       ` Jeff Law

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).