mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 15:34:09 +00:00
Add a description of how immediate actions should be encoded.
Also sets the action list type to unsigned short (uint16_t) which I think is the most appropriate type for s390x (x86 uses uint8_t and other platforms use uint32_t).
This commit is contained in:
parent
36479af87a
commit
d97dea2e3f
@ -9,7 +9,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define DASM_ARCH "s390"
|
#define DASM_ARCH "s390x"
|
||||||
|
|
||||||
#ifndef DASM_EXTERN
|
#ifndef DASM_EXTERN
|
||||||
#define DASM_EXTERN(a,b,c,d) 0
|
#define DASM_EXTERN(a,b,c,d) 0
|
||||||
@ -49,7 +49,7 @@ enum {
|
|||||||
#define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos))
|
#define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos))
|
||||||
|
|
||||||
/* Action list type. */
|
/* Action list type. */
|
||||||
typedef const unsigned int *dasm_ActList;
|
typedef const unsigned short *dasm_ActList;
|
||||||
|
|
||||||
/* Per-section structure. */
|
/* Per-section structure. */
|
||||||
typedef struct dasm_Section {
|
typedef struct dasm_Section {
|
||||||
|
@ -970,6 +970,19 @@ local function parse_template(params, template, nparams, pos)
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO
|
||||||
|
-- 12-bit displacements (DISP12) and 16-bit immediates (IMM16) can be put at
|
||||||
|
-- one of two locations relative to the end of the instruction.
|
||||||
|
-- To make decoding easier we should insert the actions for these immediately
|
||||||
|
-- after the halfword they modify.
|
||||||
|
-- For example, take the instruction ahik, which is laid out as follows (each
|
||||||
|
-- char is 4 bits):
|
||||||
|
-- o = op code, r = register, i = immediate
|
||||||
|
-- oorr iiii 00oo
|
||||||
|
-- This should be emitted as oorr, followed by the immediate action, followed by
|
||||||
|
-- 00oo.
|
||||||
|
|
||||||
wputpos(pos, op)
|
wputpos(pos, op)
|
||||||
end
|
end
|
||||||
function op_template(params, template, nparams)
|
function op_template(params, template, nparams)
|
||||||
|
Loading…
Reference in New Issue
Block a user