-
Notifications
You must be signed in to change notification settings - Fork 0
target/ppc: Move {v,xx}sel and {v,xx}perm to decodetree, implement xxpermx #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7335758
cd4040c
60f567b
a9a93b2
a652a49
6e84abe
be72a1f
cffb5ee
fcaa751
a4a8160
5af7d23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1548,28 +1548,65 @@ static void gen_vmladduhm(DisasContext *ctx) | |
tcg_temp_free_ptr(rd); | ||
} | ||
|
||
static void gen_vpermr(DisasContext *ctx) | ||
static bool trans_VPERM(DisasContext *ctx, arg_VA *a) | ||
{ | ||
TCGv_ptr ra, rb, rc, rd; | ||
if (unlikely(!ctx->altivec_enabled)) { | ||
gen_exception(ctx, POWERPC_EXCP_VPU); | ||
return; | ||
} | ||
ra = gen_avr_ptr(rA(ctx->opcode)); | ||
rb = gen_avr_ptr(rB(ctx->opcode)); | ||
rc = gen_avr_ptr(rC(ctx->opcode)); | ||
rd = gen_avr_ptr(rD(ctx->opcode)); | ||
gen_helper_vpermr(cpu_env, rd, ra, rb, rc); | ||
tcg_temp_free_ptr(ra); | ||
tcg_temp_free_ptr(rb); | ||
tcg_temp_free_ptr(rc); | ||
tcg_temp_free_ptr(rd); | ||
TCGv_ptr vrt, vra, vrb, vrc; | ||
|
||
REQUIRE_INSNS_FLAGS(ctx, ALTIVEC); | ||
lffpires marked this conversation as resolved.
Show resolved
Hide resolved
|
||
REQUIRE_VECTOR(ctx); | ||
|
||
vrt = gen_avr_ptr(a->vrt); | ||
vra = gen_avr_ptr(a->vra); | ||
vrb = gen_avr_ptr(a->vrb); | ||
vrc = gen_avr_ptr(a->rc); | ||
|
||
gen_helper_VPERM(vrt, vra, vrb, vrc); | ||
|
||
tcg_temp_free_ptr(vrt); | ||
tcg_temp_free_ptr(vra); | ||
tcg_temp_free_ptr(vrb); | ||
tcg_temp_free_ptr(vrc); | ||
|
||
return true; | ||
} | ||
|
||
static bool trans_VPERMR(DisasContext *ctx, arg_VA *a) | ||
{ | ||
TCGv_ptr vrt, vra, vrb, vrc; | ||
|
||
REQUIRE_INSNS_FLAGS2(ctx, ISA300); | ||
REQUIRE_VECTOR(ctx); | ||
|
||
vrt = gen_avr_ptr(a->vrt); | ||
vra = gen_avr_ptr(a->vra); | ||
vrb = gen_avr_ptr(a->vrb); | ||
vrc = gen_avr_ptr(a->rc); | ||
|
||
gen_helper_VPERMR(vrt, vra, vrb, vrc); | ||
|
||
tcg_temp_free_ptr(vrt); | ||
tcg_temp_free_ptr(vra); | ||
tcg_temp_free_ptr(vrb); | ||
tcg_temp_free_ptr(vrc); | ||
|
||
return true; | ||
} | ||
Comment on lines
+1551
to
+1593
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about merging these two functions using |
||
|
||
static bool trans_VSEL(DisasContext *ctx, arg_VA *a) | ||
{ | ||
REQUIRE_INSNS_FLAGS(ctx, ALTIVEC); | ||
lffpires marked this conversation as resolved.
Show resolved
Hide resolved
|
||
REQUIRE_VECTOR(ctx); | ||
|
||
tcg_gen_gvec_bitsel(MO_64, avr_full_offset(a->vrt), avr_full_offset(a->rc), | ||
avr_full_offset(a->vrb), avr_full_offset(a->vra), | ||
16, 16); | ||
|
||
return true; | ||
} | ||
|
||
GEN_VAFORM_PAIRED(vmsumubm, vmsummbm, 18) | ||
GEN_VAFORM_PAIRED(vmsumuhm, vmsumuhs, 19) | ||
GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20) | ||
GEN_VAFORM_PAIRED(vsel, vperm, 21) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm since vsel and vperm are defined together, maybe merge this commit and the previous one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to keep small commits to ease the review. Would it be better if I add a comment in the previous commit telling that the helper and other vsel stuff is removed here? Or should I squash these commits anyway? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's unfortunate that they were implemented so tied together. Due to this, I would squash the 2 commits, taking into consideration that they're simple enough. To me, it causes more confusion to keep them separate than to squash them in a single one. |
||
GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23) | ||
|
||
GEN_VXFORM_NOA(vclzb, 1, 28) | ||
|
Uh oh!
There was an error while loading. Please reload this page.