diff options
author | Björn Gustavsson <[email protected]> | 2017-10-09 11:31:48 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-09 11:31:48 +0200 |
commit | e38c688d3961bedcd85f842fd052836cb345a902 (patch) | |
tree | 05b1bbdbb0e17ab368e9ec016e24e46c02e4d6d4 /erts/emulator/beam/erl_vm.h | |
parent | 52449634868e38087d0c93a0145fcfd9d2de394b (diff) | |
parent | c2e746117b24235b8f2c508ef8f90e35ad422bf2 (diff) | |
download | otp-e38c688d3961bedcd85f842fd052836cb345a902.tar.gz otp-e38c688d3961bedcd85f842fd052836cb345a902.tar.bz2 otp-e38c688d3961bedcd85f842fd052836cb345a902.zip |
Merge branch 'bjorn/erts/pack-with-opcode/OTP-14325'
OTP-14327
OTP-14340
* bjorn/erts/pack-with-opcode/OTP-14325:
Pack operands for combined instructions into the instruction word
beam_makeops: Use named arguments for the code generation functions
Optimize packing for "optional use" operands
beam_makeops: Print the instruction name for fatal packing errors
Introduce a syntax for marking operands as "optional use"
beam_makeops: Refactor parsing of specific instructions
Optimize instruction prefetch
Pack operands into the instruction word
Use 32-bits pointers to C code
Move LD flags for hipe from Makefile.in to configure.in
beam_disasm: Correct printing of y registers
ops.tab: Slightly optimize badmatch on a Y register
macros.tab: Fix assertion in SET_I_REL()
Diffstat (limited to 'erts/emulator/beam/erl_vm.h')
-rw-r--r-- | erts/emulator/beam/erl_vm.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h index 661538eadd..76980b5871 100644 --- a/erts/emulator/beam/erl_vm.h +++ b/erts/emulator/beam/erl_vm.h @@ -209,6 +209,15 @@ extern void** beam_ops; # define BeamOpCodeAddr(OpCode) ((BeamInstr)beam_ops[(OpCode)]) #endif -#define BeamIsOpCode(InstrWord, OpCode) ((InstrWord) == BeamOpCodeAddr(OpCode)) +#if defined(ARCH_64) && defined(CODE_MODEL_SMALL) +# define BeamCodeAddr(InstrWord) ((BeamInstr)(Uint32)(InstrWord)) +# define BeamSetCodeAddr(InstrWord, Addr) (((InstrWord) & ~((1ull << 32)-1)) | (Addr)) +# define BeamExtraData(InstrWord) ((InstrWord) >> 32) +#else +# define BeamCodeAddr(InstrWord) ((BeamInstr)(InstrWord)) +# define BeamSetCodeAddr(InstrWord, Addr) (Addr) +#endif + +#define BeamIsOpCode(InstrWord, OpCode) (BeamCodeAddr(InstrWord) == BeamOpCodeAddr(OpCode)) #endif /* __ERL_VM_H__ */ |