Maciej W. Rozycki 0a9ea215f7 VAX: Make `extv' an expander matching the remaining bit-field operations
We have matching insns defined for `sign_extract' and `zero_extract'
expressions, so make the three named patterns for bit-field operations
consistent and make `extv' an expander rather than an insn taking a
SImode, a QImode, and a SImode general operand for the LOC, SIZE, and
POS operands respectively, like with the `extzv' and `insv' patterns,
matching the machine instructions and giving the middle end more choice
as to which actual insn to choose in a given situation.

Given this program:

typedef struct
{
  int f0:1;
  int f1:7;
  int f8:8;
  int f16:16;
} bit_t;

typedef struct
{
  unsigned int f0:1;
  unsigned int f1:7;
  unsigned int f8:8;
  unsigned int f16:16;
} ubit_t;

typedef union
{
  bit_t b;
  int i;
} bit_u;

typedef union
{
  ubit_t b;
  unsigned int i;
} ubit_u;

int
ins1 (bit_u x, int y)
{
  asm volatile ("" : "+r" (x), "+r" (y));
  x.b.f1 = y;
  return x.i;
}

int
ext1 (bit_u x)
{
  asm volatile ("" : "+r" (x));
  return x.b.f1;
}

unsigned int
extz1 (ubit_u x)
{
  asm volatile ("" : "+r" (x));
  return x.b.f1;
}

int
ins8 (bit_u x, int y)
{
  asm volatile ("" : "+r" (x), "+r" (y));
  x.b.f8 = y;
  return x.i;
}

int
ext8 (bit_u x)
{
  asm volatile ("" : "+r" (x));
  return x.b.f8;
}

unsigned int
extz8 (ubit_u x)
{
  asm volatile ("" : "+r" (x));
  return x.b.f8;
}

int
ins16 (bit_u x, int y)
{
  asm volatile ("" : "+r" (x), "+r" (y));
  x.b.f16 = y;
  return x.i;
}

int
ext16 (bit_u x)
{
  asm volatile ("" : "+r" (x));
  return x.b.f16;
}

unsigned int
extz16 (ubit_u x)
{
  asm volatile ("" : "+r" (x));
  return x.b.f16;
}

this results in the following code change:

@@ -16,12 +16,12 @@ ins1:
 .globl ext1
 	.type	ext1, @function
 ext1:
-	.word 0	# 19	[c=0]  procedure_entry_mask
-	subl2 $4,%sp	# 20	[c=32]  addsi3
+	.word 0	# 18	[c=0]  procedure_entry_mask
+	subl2 $4,%sp	# 19	[c=32]  addsi3
 	movl 4(%ap),%r0	# 2	[c=16]  movsi_2
-	cvtbl %r0,%r0	# 7	[c=4]  extendqisi2
-	ashl $-1,%r0,%r0	# 14	[c=40]  *vax.md:624
-	ret		# 24	[c=0]  return
+	extv $1,$7,%r0,%r0	# 7	[c=60]  *extv_non_const
+	cvtbl %r0,%r0	# 13	[c=4]  extendqisi2
+	ret		# 23	[c=0]  return
 	.size	ext1, .-ext1
 	.align 1
 .globl extz1
@@ -49,12 +49,12 @@ ins8:
 .globl ext8
 	.type	ext8, @function
 ext8:
-	.word 0	# 20	[c=0]  procedure_entry_mask
-	subl2 $4,%sp	# 21	[c=32]  addsi3
+	.word 0	# 18	[c=0]  procedure_entry_mask
+	subl2 $4,%sp	# 19	[c=32]  addsi3
 	movl 4(%ap),%r0	# 2	[c=16]  movsi_2
-	cvtwl %r0,%r0	# 7	[c=4]  extendhisi2
-	ashl $-8,%r0,%r0	# 15	[c=40]  *vax.md:624
-	ret		# 25	[c=0]  return
+	rotl $24,%r0,%r0	# 13	[c=60]  *extv_non_const
+	cvtbl %r0,%r0
+	ret		# 23	[c=0]  return
 	.size	ext8, .-ext8
 	.align 1
 .globl extz8

If there is a performance degradation with the replacement sequences,
then it can and should be sorted within `extv_non_const'.

	gcc/
	* config/vax/vax.md (extv): Rename insn to...
	(*extv): ... this.
	(extv): New expander.
2020-12-05 18:26:26 +00:00
2020-11-26 00:16:41 +00:00
2020-12-05 00:16:39 +00:00
2020-11-19 00:16:30 +00:00
2020-10-30 00:16:29 +00:00
2020-09-25 00:16:27 +00:00
2020-12-02 00:16:41 +00:00
2020-07-31 00:16:26 +00:00
2020-12-04 00:16:36 +00:00
2020-11-26 00:16:41 +00:00
2020-11-30 00:16:27 +00:00
2020-11-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-01-15 14:29:53 +01:00
2020-12-02 11:04:01 -07:00
2020-12-03 00:16:47 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.1 GiB
Languages
C++ 31.9%
C 31.3%
Ada 12%
D 6.5%
Go 6.4%
Other 11.5%