diff options
author | Björn Gustavsson <[email protected]> | 2012-03-30 11:05:16 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-07-03 14:28:03 +0200 |
commit | 45f469ca089096c8a59ca53d948d05d1a998386e (patch) | |
tree | 2da989257d20ae659c7ad8a503d4978e4b6b7a3f /erts/emulator/beam | |
parent | 54189af4a519b72883dde3263135baf6aba0f81f (diff) | |
download | otp-45f469ca089096c8a59ca53d948d05d1a998386e.tar.gz otp-45f469ca089096c8a59ca53d948d05d1a998386e.tar.bz2 otp-45f469ca089096c8a59ca53d948d05d1a998386e.zip |
Change the meaning of 'x' in a transformation
The purpose of this series of commits is to improve code generation
for the Clang compiler.
As a first step we want to change the meaning of 'x' in a
transformation such as:
operation Literal=q => move Literal x | operation x
Currently, a plain 'x' means reg[0] or x(0), which is the first
element in the X register array. That element is distinct from
r(0) which is a variable in process_main(). Therefore, since r(0)
and x(0) are currently distinct it is fine to use x(0) as a
scratch register.
However, in the next commit we will eliminate the separate variable
for storing the contents of X register zero (thus, x(0) and r(0)
will point to the same location in the X register array). Therefore,
we must use another scratch register in transformation. Redefine
a plain 'x' in a transformation to mean x(1023). Also define
SCRATCH_X_REG so that we can refer to the register by name from
C code.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 10baab506a..f5f1147261 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -4322,7 +4322,7 @@ gen_has_map_fields(LoaderState* stp, GenOpArg Fail, GenOpArg Src, for (i = 0; i < n; i++) { op->a[3+2*i] = Rest[i]; op->a[3+2*i+1].type = TAG_x; - op->a[3+2*i+1].val = 0; /* x(0); normally not used */ + op->a[3+2*i+1].val = SCRATCH_X_REG; /* Ignore result */ } return op; } |