Skip to content

Commit e31af11

Browse files
committed
Pass the external word size to the beam_makeops script
Giving the beam_makeops script access to the external word size (=the size of instruction words) will allow it to pack more operands into a word for the 64 bits emulator.
1 parent ec325cc commit e31af11

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

erts/configure.in

+5
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,11 @@ AC_SUBST(WFLAGS)
580580
AC_SUBST(CFLAG_RUNTIME_LIBRARY_PATH)
581581

582582
AC_CHECK_SIZEOF(void *) # Needed for ARCH and smp checks below
583+
if test "x$ac_cv_sizeof_void_p" = x8; then
584+
AC_SUBST(EXTERNAL_WORD_SIZE, 64)
585+
else
586+
AC_SUBST(EXTERNAL_WORD_SIZE, 32)
587+
fi
583588

584589
dnl
585590
dnl Figure out operating system and cpu architecture

erts/emulator/Makefile.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,9 @@ OPCODE_TABLES += hipe/hipe_ops.tab
506506
endif
507507

508508
$(TTF_DIR)/beam_opcodes.h $(TTF_DIR)/beam_opcodes.c: $(OPCODE_TABLES) utils/beam_makeops
509-
LANG=C $(PERL) utils/beam_makeops -outdir $(TTF_DIR) \
509+
LANG=C $(PERL) utils/beam_makeops \
510+
-wordsize @EXTERNAL_WORD_SIZE@ \
511+
-outdir $(TTF_DIR) \
510512
-emulator $(OPCODE_TABLES)
511513

512514
# bif and atom table

erts/emulator/utils/beam_makeops

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ my $outdir = "."; # Directory for output files.
2727
my $verbose = 0;
2828
my $hot = 1;
2929
my $num_file_opcodes = 0;
30+
my $wordsize = 32;
3031

3132
# This is shift counts and mask for the packer.
3233
my $WHOLE_WORD = '';
@@ -171,6 +172,7 @@ while (@ARGV && $ARGV[0] =~ /^-(.*)/) {
171172
($target = \&emulator_output), next if /^emulator/;
172173
($target = \&compiler_output), next if /^compiler/;
173174
($outdir = shift), next if /^outdir/;
175+
($wordsize = shift), next if /^wordsize/;
174176
($verbose = 1), next if /^v/;
175177
die "$0: Bad option: -$_\n";
176178
}

0 commit comments

Comments
 (0)