mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
Hexagon (target/hexagon) load into shifted register instructions
The following instructions are added L2_loadalignb_io Ryy32 = memb_fifo(Rs32+#s11:1) L2_loadalignh_io Ryy32 = memh_fifo(Rs32+#s11:1) L4_loadalignb_ur Ryy32 = memb_fifo(Rt32<<#u2+#U6) L4_loadalignh_ur Ryy32 = memh_fifo(Rt32<<#u2+#U6) L4_loadalignb_ap Ryy32 = memb_fifo(Re32=#U6) L4_loadalignh_ap Ryy32 = memh_fifo(Re32=#U6) L2_loadalignb_pr Ryy32 = memb_fifo(Rx32++Mu2) L2_loadalignh_pr Ryy32 = memh_fifo(Rx32++Mu2) L2_loadalignb_pbr Ryy32 = memb_fifo(Rx32++Mu2:brev) L2_loadalignh_pbr Ryy32 = memh_fifo(Rx32++Mu2:brev) L2_loadalignb_pi Ryy32 = memb_fifo(Rx32++#s4:1) L2_loadalignh_pi Ryy32 = memh_fifo(Rx32++#s4:1) L2_loadalignb_pci Ryy32 = memb_fifo(Rx32++#s4:1:circ(Mu2)) L2_loadalignh_pci Ryy32 = memh_fifo(Rx32++#s4:1:circ(Mu2)) L2_loadalignb_pcr Ryy32 = memb_fifo(Rx32++I:circ(Mu2)) L2_loadalignh_pcr Ryy32 = memh_fifo(Rx32++I:circ(Mu2)) Test cases in tests/tcg/hexagon/load_align.c Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <1617930474-31979-26-git-send-email-tsimpson@quicinc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
0d0b91a804
commit
7aa9ffab79
5 changed files with 504 additions and 0 deletions
|
@ -260,6 +260,72 @@
|
|||
#define fGEN_TCG_L2_loadbsw4_pi(SHORTCODE) \
|
||||
fGEN_TCG_loadbXw4(GET_EA_pi, true)
|
||||
|
||||
/*
|
||||
* These instructions load a half word, shift the destination right by 16 bits
|
||||
* and place the loaded value in the high half word of the destination pair.
|
||||
* The GET_EA macro determines the addressing mode.
|
||||
*/
|
||||
#define fGEN_TCG_loadalignh(GET_EA) \
|
||||
do { \
|
||||
TCGv tmp = tcg_temp_new(); \
|
||||
TCGv_i64 tmp_i64 = tcg_temp_new_i64(); \
|
||||
GET_EA; \
|
||||
fLOAD(1, 2, u, EA, tmp); \
|
||||
tcg_gen_extu_i32_i64(tmp_i64, tmp); \
|
||||
tcg_gen_shri_i64(RyyV, RyyV, 16); \
|
||||
tcg_gen_deposit_i64(RyyV, RyyV, tmp_i64, 48, 16); \
|
||||
tcg_temp_free(tmp); \
|
||||
tcg_temp_free_i64(tmp_i64); \
|
||||
} while (0)
|
||||
|
||||
#define fGEN_TCG_L4_loadalignh_ur(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(fEA_IRs(UiV, RtV, uiV))
|
||||
#define fGEN_TCG_L2_loadalignh_io(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(fEA_RI(RsV, siV))
|
||||
#define fGEN_TCG_L2_loadalignh_pci(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(GET_EA_pci)
|
||||
#define fGEN_TCG_L2_loadalignh_pcr(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(GET_EA_pcr(1))
|
||||
#define fGEN_TCG_L4_loadalignh_ap(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(GET_EA_ap)
|
||||
#define fGEN_TCG_L2_loadalignh_pr(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(GET_EA_pr)
|
||||
#define fGEN_TCG_L2_loadalignh_pbr(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(GET_EA_pbr)
|
||||
#define fGEN_TCG_L2_loadalignh_pi(SHORTCODE) \
|
||||
fGEN_TCG_loadalignh(GET_EA_pi)
|
||||
|
||||
/* Same as above, but loads a byte instead of half word */
|
||||
#define fGEN_TCG_loadalignb(GET_EA) \
|
||||
do { \
|
||||
TCGv tmp = tcg_temp_new(); \
|
||||
TCGv_i64 tmp_i64 = tcg_temp_new_i64(); \
|
||||
GET_EA; \
|
||||
fLOAD(1, 1, u, EA, tmp); \
|
||||
tcg_gen_extu_i32_i64(tmp_i64, tmp); \
|
||||
tcg_gen_shri_i64(RyyV, RyyV, 8); \
|
||||
tcg_gen_deposit_i64(RyyV, RyyV, tmp_i64, 56, 8); \
|
||||
tcg_temp_free(tmp); \
|
||||
tcg_temp_free_i64(tmp_i64); \
|
||||
} while (0)
|
||||
|
||||
#define fGEN_TCG_L2_loadalignb_io(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(fEA_RI(RsV, siV))
|
||||
#define fGEN_TCG_L4_loadalignb_ur(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(fEA_IRs(UiV, RtV, uiV))
|
||||
#define fGEN_TCG_L2_loadalignb_pci(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(GET_EA_pci)
|
||||
#define fGEN_TCG_L2_loadalignb_pcr(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(GET_EA_pcr(0))
|
||||
#define fGEN_TCG_L4_loadalignb_ap(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(GET_EA_ap)
|
||||
#define fGEN_TCG_L2_loadalignb_pr(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(GET_EA_pr)
|
||||
#define fGEN_TCG_L2_loadalignb_pbr(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(GET_EA_pbr)
|
||||
#define fGEN_TCG_L2_loadalignb_pi(SHORTCODE) \
|
||||
fGEN_TCG_loadalignb(GET_EA_pi)
|
||||
|
||||
/*
|
||||
* Predicated loads
|
||||
* Here is a primer to understand the tag names
|
||||
|
|
|
@ -348,6 +348,9 @@ STD_LD_ENC(bzw2,"0 011")
|
|||
STD_LD_ENC(bsw4,"0 111")
|
||||
STD_LD_ENC(bsw2,"0 001")
|
||||
|
||||
STD_LDX_ENC(alignh,"0 010")
|
||||
STD_LDX_ENC(alignb,"0 100")
|
||||
|
||||
STD_LD_ENC(rb, "1 000")
|
||||
STD_LD_ENC(rub, "1 001")
|
||||
STD_LD_ENC(rh, "1 010")
|
||||
|
|
|
@ -80,6 +80,25 @@ ATTRIBS(A_LOAD),"2",
|
|||
|
||||
|
||||
|
||||
STD_LD_AMODES(loadalignh, "Ryy32=memh_fifo", "Load Half-word into shifted vector",
|
||||
ATTRIBS(A_LOAD),"1",
|
||||
{
|
||||
fHIDE(size8u_t tmpV;)
|
||||
fLOAD(1,2,u,EA,tmpV);
|
||||
RyyV = (((size8u_t)RyyV)>>16)|(tmpV<<48);
|
||||
},1)
|
||||
|
||||
|
||||
STD_LD_AMODES(loadalignb, "Ryy32=memb_fifo", "Load byte into shifted vector",
|
||||
ATTRIBS(A_LOAD),"0",
|
||||
{
|
||||
fHIDE(size8u_t tmpV;)
|
||||
fLOAD(1,1,u,EA,tmpV);
|
||||
RyyV = (((size8u_t)RyyV)>>8)|(tmpV<<56);
|
||||
},0)
|
||||
|
||||
|
||||
|
||||
|
||||
/* The set of addressing modes standard to all Store instructions */
|
||||
#define STD_ST_AMODES(TAG,DEST,OPER,DESCR,ATTRIB,SHFT,SEMANTICS,SCALE)\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue