ARM: More intrinsics
pcpa at mandriva.com.br
pcpa at mandriva.com.br
Thu Mar 15 12:06:25 PDT 2012
> On 03/15/2012 04:09 AM, pcpa at mandriva.com.br wrote:
>>> Xerxes noticed an inconsistency in my patch. I've removed the unused
>>> masks, and redefined the condition in the atomic operations to use ETT
>>> (else, true, true) rather than the confused encoding I used before.
>>>
>>> So, it's now
>>>
>>> + it(codebuf, COND_EQ, IT_MASK_ETT);
>>>
>>> instead of
>>>
>>> - it(codebuf, COND_NE, IT_MASK_TEE);
>>
>> I feel there is something bogus here, because the first condition
>> should be 'T' always, and the mask is based on bit 0 of the test
>> condition. Talking this because I wrote support for arm thumb jit
>> recently.
>
> I've now got this:
>
> int it(CodeBuf *codebuf, unsigned cond, unsigned mask)
> {
> if (cond & 1) {
> // If this is a negated condition, flip all the bits above the
> // least significant bit that is 1. Note that at least one bit is
> // always 1 in mask
> switch (mask & (-mask)) {
> case 8:
> break;
> case 4:
> mask ^= 8;
> break;
> case 2:
> mask ^= 0x0c;
> break;
> case 1:
> mask ^= 0x0e;
> break;
> default:
> // Impossible unless someone specified an incorrect mask
> longjmp(compiler_error_env, COMPILER_RESULT_FAILED);
> }
> }
>
> return out_16(codebuf, T_IT(cond, mask));
> }
>
> Which does the right thing per the spec and is simpler.
>
> Thanks for the idea,
No problems :-)
I just made the attached simple test program, that may be useful
for adapting it to the logic you use, and validate it.
Sorry for the long cut&paste... The output I see is:
$ ./a.out
eq:
it eq
moveq.w r0, r1
itt eq
moveq.w r0, r1
moveq.w r1, r2
ite eq
moveq.w r0, r1
movne.w r1, r2
ittt eq
moveq.w r0, r1
moveq.w r1, r2
moveq.w r2, r3
itte eq
moveq.w r0, r1
moveq.w r1, r2
movne.w r2, r3
itet eq
moveq.w r0, r1
movne.w r1, r2
moveq.w r2, r3
itee eq
moveq.w r0, r1
movne.w r1, r2
movne.w r2, r3
itttt eq
moveq.w r0, r1
moveq.w r1, r2
moveq.w r2, r3
moveq.w r3, r4
itett eq
moveq.w r0, r1
movne.w r1, r2
moveq.w r2, r3
moveq.w r3, r4
ittet eq
moveq.w r0, r1
moveq.w r1, r2
movne.w r2, r3
moveq.w r3, r4
iteet eq
moveq.w r0, r1
movne.w r1, r2
movne.w r2, r3
moveq.w r3, r4
ittte eq
moveq.w r0, r1
moveq.w r1, r2
moveq.w r2, r3
movne.w r3, r4
itete eq
moveq.w r0, r1
movne.w r1, r2
moveq.w r2, r3
movne.w r3, r4
ittee eq
moveq.w r0, r1
moveq.w r1, r2
movne.w r2, r3
movne.w r3, r4
iteee eq
moveq.w r0, r1
movne.w r1, r2
movne.w r2, r3
movne.w r3, r4
ne:
it ne
movne.w r0, r1
itt ne
movne.w r0, r1
movne.w r1, r2
ite ne
movne.w r0, r1
moveq.w r1, r2
ittt ne
movne.w r0, r1
movne.w r1, r2
movne.w r2, r3
itte ne
movne.w r0, r1
movne.w r1, r2
moveq.w r2, r3
itet ne
movne.w r0, r1
moveq.w r1, r2
movne.w r2, r3
itee ne
movne.w r0, r1
moveq.w r1, r2
moveq.w r2, r3
itttt ne
movne.w r0, r1
movne.w r1, r2
movne.w r2, r3
movne.w r3, r4
itett ne
movne.w r0, r1
moveq.w r1, r2
movne.w r2, r3
movne.w r3, r4
ittet ne
movne.w r0, r1
movne.w r1, r2
moveq.w r2, r3
movne.w r3, r4
iteet ne
movne.w r0, r1
moveq.w r1, r2
moveq.w r2, r3
movne.w r3, r4
ittte ne
movne.w r0, r1
movne.w r1, r2
movne.w r2, r3
moveq.w r3, r4
itete ne
movne.w r0, r1
moveq.w r1, r2
movne.w r2, r3
moveq.w r3, r4
ittee ne
movne.w r0, r1
movne.w r1, r2
moveq.w r2, r3
moveq.w r3, r4
iteee ne
movne.w r0, r1
moveq.w r1, r2
moveq.w r2, r3
moveq.w r3, r4
cs:
it cs
movcs.w r0, r1
itt cs
movcs.w r0, r1
movcs.w r1, r2
ite cs
movcs.w r0, r1
movcc.w r1, r2
ittt cs
movcs.w r0, r1
movcs.w r1, r2
movcs.w r2, r3
itte cs
movcs.w r0, r1
movcs.w r1, r2
movcc.w r2, r3
itet cs
movcs.w r0, r1
movcc.w r1, r2
movcs.w r2, r3
itee cs
movcs.w r0, r1
movcc.w r1, r2
movcc.w r2, r3
itttt cs
movcs.w r0, r1
movcs.w r1, r2
movcs.w r2, r3
movcs.w r3, r4
itett cs
movcs.w r0, r1
movcc.w r1, r2
movcs.w r2, r3
movcs.w r3, r4
ittet cs
movcs.w r0, r1
movcs.w r1, r2
movcc.w r2, r3
movcs.w r3, r4
iteet cs
movcs.w r0, r1
movcc.w r1, r2
movcc.w r2, r3
movcs.w r3, r4
ittte cs
movcs.w r0, r1
movcs.w r1, r2
movcs.w r2, r3
movcc.w r3, r4
itete cs
movcs.w r0, r1
movcc.w r1, r2
movcs.w r2, r3
movcc.w r3, r4
ittee cs
movcs.w r0, r1
movcs.w r1, r2
movcc.w r2, r3
movcc.w r3, r4
iteee cs
movcs.w r0, r1
movcc.w r1, r2
movcc.w r2, r3
movcc.w r3, r4
cc:
it cc
movcc.w r0, r1
itt cc
movcc.w r0, r1
movcc.w r1, r2
ite cc
movcc.w r0, r1
movcs.w r1, r2
ittt cc
movcc.w r0, r1
movcc.w r1, r2
movcc.w r2, r3
itte cc
movcc.w r0, r1
movcc.w r1, r2
movcs.w r2, r3
itet cc
movcc.w r0, r1
movcs.w r1, r2
movcc.w r2, r3
itee cc
movcc.w r0, r1
movcs.w r1, r2
movcs.w r2, r3
itttt cc
movcc.w r0, r1
movcc.w r1, r2
movcc.w r2, r3
movcc.w r3, r4
itett cc
movcc.w r0, r1
movcs.w r1, r2
movcc.w r2, r3
movcc.w r3, r4
ittet cc
movcc.w r0, r1
movcc.w r1, r2
movcs.w r2, r3
movcc.w r3, r4
iteet cc
movcc.w r0, r1
movcs.w r1, r2
movcs.w r2, r3
movcc.w r3, r4
ittte cc
movcc.w r0, r1
movcc.w r1, r2
movcc.w r2, r3
movcs.w r3, r4
itete cc
movcc.w r0, r1
movcs.w r1, r2
movcc.w r2, r3
movcs.w r3, r4
ittee cc
movcc.w r0, r1
movcc.w r1, r2
movcs.w r2, r3
movcs.w r3, r4
iteee cc
movcc.w r0, r1
movcs.w r1, r2
movcs.w r2, r3
movcs.w r3, r4
mi:
it mi
movmi.w r0, r1
itt mi
movmi.w r0, r1
movmi.w r1, r2
ite mi
movmi.w r0, r1
movpl.w r1, r2
ittt mi
movmi.w r0, r1
movmi.w r1, r2
movmi.w r2, r3
itte mi
movmi.w r0, r1
movmi.w r1, r2
movpl.w r2, r3
itet mi
movmi.w r0, r1
movpl.w r1, r2
movmi.w r2, r3
itee mi
movmi.w r0, r1
movpl.w r1, r2
movpl.w r2, r3
itttt mi
movmi.w r0, r1
movmi.w r1, r2
movmi.w r2, r3
movmi.w r3, r4
itett mi
movmi.w r0, r1
movpl.w r1, r2
movmi.w r2, r3
movmi.w r3, r4
ittet mi
movmi.w r0, r1
movmi.w r1, r2
movpl.w r2, r3
movmi.w r3, r4
iteet mi
movmi.w r0, r1
movpl.w r1, r2
movpl.w r2, r3
movmi.w r3, r4
ittte mi
movmi.w r0, r1
movmi.w r1, r2
movmi.w r2, r3
movpl.w r3, r4
itete mi
movmi.w r0, r1
movpl.w r1, r2
movmi.w r2, r3
movpl.w r3, r4
ittee mi
movmi.w r0, r1
movmi.w r1, r2
movpl.w r2, r3
movpl.w r3, r4
iteee mi
movmi.w r0, r1
movpl.w r1, r2
movpl.w r2, r3
movpl.w r3, r4
pl:
it pl
movpl.w r0, r1
itt pl
movpl.w r0, r1
movpl.w r1, r2
ite pl
movpl.w r0, r1
movmi.w r1, r2
ittt pl
movpl.w r0, r1
movpl.w r1, r2
movpl.w r2, r3
itte pl
movpl.w r0, r1
movpl.w r1, r2
movmi.w r2, r3
itet pl
movpl.w r0, r1
movmi.w r1, r2
movpl.w r2, r3
itee pl
movpl.w r0, r1
movmi.w r1, r2
movmi.w r2, r3
itttt pl
movpl.w r0, r1
movpl.w r1, r2
movpl.w r2, r3
movpl.w r3, r4
itett pl
movpl.w r0, r1
movmi.w r1, r2
movpl.w r2, r3
movpl.w r3, r4
ittet pl
movpl.w r0, r1
movpl.w r1, r2
movmi.w r2, r3
movpl.w r3, r4
iteet pl
movpl.w r0, r1
movmi.w r1, r2
movmi.w r2, r3
movpl.w r3, r4
ittte pl
movpl.w r0, r1
movpl.w r1, r2
movpl.w r2, r3
movmi.w r3, r4
itete pl
movpl.w r0, r1
movmi.w r1, r2
movpl.w r2, r3
movmi.w r3, r4
ittee pl
movpl.w r0, r1
movpl.w r1, r2
movmi.w r2, r3
movmi.w r3, r4
iteee pl
movpl.w r0, r1
movmi.w r1, r2
movmi.w r2, r3
movmi.w r3, r4
vs:
it vs
movvs.w r0, r1
itt vs
movvs.w r0, r1
movvs.w r1, r2
ite vs
movvs.w r0, r1
movvc.w r1, r2
ittt vs
movvs.w r0, r1
movvs.w r1, r2
movvs.w r2, r3
itte vs
movvs.w r0, r1
movvs.w r1, r2
movvc.w r2, r3
itet vs
movvs.w r0, r1
movvc.w r1, r2
movvs.w r2, r3
itee vs
movvs.w r0, r1
movvc.w r1, r2
movvc.w r2, r3
itttt vs
movvs.w r0, r1
movvs.w r1, r2
movvs.w r2, r3
movvs.w r3, r4
itett vs
movvs.w r0, r1
movvc.w r1, r2
movvs.w r2, r3
movvs.w r3, r4
ittet vs
movvs.w r0, r1
movvs.w r1, r2
movvc.w r2, r3
movvs.w r3, r4
iteet vs
movvs.w r0, r1
movvc.w r1, r2
movvc.w r2, r3
movvs.w r3, r4
ittte vs
movvs.w r0, r1
movvs.w r1, r2
movvs.w r2, r3
movvc.w r3, r4
itete vs
movvs.w r0, r1
movvc.w r1, r2
movvs.w r2, r3
movvc.w r3, r4
ittee vs
movvs.w r0, r1
movvs.w r1, r2
movvc.w r2, r3
movvc.w r3, r4
iteee vs
movvs.w r0, r1
movvc.w r1, r2
movvc.w r2, r3
movvc.w r3, r4
vc:
it vc
movvc.w r0, r1
itt vc
movvc.w r0, r1
movvc.w r1, r2
ite vc
movvc.w r0, r1
movvs.w r1, r2
ittt vc
movvc.w r0, r1
movvc.w r1, r2
movvc.w r2, r3
itte vc
movvc.w r0, r1
movvc.w r1, r2
movvs.w r2, r3
itet vc
movvc.w r0, r1
movvs.w r1, r2
movvc.w r2, r3
itee vc
movvc.w r0, r1
movvs.w r1, r2
movvs.w r2, r3
itttt vc
movvc.w r0, r1
movvc.w r1, r2
movvc.w r2, r3
movvc.w r3, r4
itett vc
movvc.w r0, r1
movvs.w r1, r2
movvc.w r2, r3
movvc.w r3, r4
ittet vc
movvc.w r0, r1
movvc.w r1, r2
movvs.w r2, r3
movvc.w r3, r4
iteet vc
movvc.w r0, r1
movvs.w r1, r2
movvs.w r2, r3
movvc.w r3, r4
ittte vc
movvc.w r0, r1
movvc.w r1, r2
movvc.w r2, r3
movvs.w r3, r4
itete vc
movvc.w r0, r1
movvs.w r1, r2
movvc.w r2, r3
movvs.w r3, r4
ittee vc
movvc.w r0, r1
movvc.w r1, r2
movvs.w r2, r3
movvs.w r3, r4
iteee vc
movvc.w r0, r1
movvs.w r1, r2
movvs.w r2, r3
movvs.w r3, r4
hi:
it hi
movhi.w r0, r1
itt hi
movhi.w r0, r1
movhi.w r1, r2
ite hi
movhi.w r0, r1
movls.w r1, r2
ittt hi
movhi.w r0, r1
movhi.w r1, r2
movhi.w r2, r3
itte hi
movhi.w r0, r1
movhi.w r1, r2
movls.w r2, r3
itet hi
movhi.w r0, r1
movls.w r1, r2
movhi.w r2, r3
itee hi
movhi.w r0, r1
movls.w r1, r2
movls.w r2, r3
itttt hi
movhi.w r0, r1
movhi.w r1, r2
movhi.w r2, r3
movhi.w r3, r4
itett hi
movhi.w r0, r1
movls.w r1, r2
movhi.w r2, r3
movhi.w r3, r4
ittet hi
movhi.w r0, r1
movhi.w r1, r2
movls.w r2, r3
movhi.w r3, r4
iteet hi
movhi.w r0, r1
movls.w r1, r2
movls.w r2, r3
movhi.w r3, r4
ittte hi
movhi.w r0, r1
movhi.w r1, r2
movhi.w r2, r3
movls.w r3, r4
itete hi
movhi.w r0, r1
movls.w r1, r2
movhi.w r2, r3
movls.w r3, r4
ittee hi
movhi.w r0, r1
movhi.w r1, r2
movls.w r2, r3
movls.w r3, r4
iteee hi
movhi.w r0, r1
movls.w r1, r2
movls.w r2, r3
movls.w r3, r4
ls:
it ls
movls.w r0, r1
itt ls
movls.w r0, r1
movls.w r1, r2
ite ls
movls.w r0, r1
movhi.w r1, r2
ittt ls
movls.w r0, r1
movls.w r1, r2
movls.w r2, r3
itte ls
movls.w r0, r1
movls.w r1, r2
movhi.w r2, r3
itet ls
movls.w r0, r1
movhi.w r1, r2
movls.w r2, r3
itee ls
movls.w r0, r1
movhi.w r1, r2
movhi.w r2, r3
itttt ls
movls.w r0, r1
movls.w r1, r2
movls.w r2, r3
movls.w r3, r4
itett ls
movls.w r0, r1
movhi.w r1, r2
movls.w r2, r3
movls.w r3, r4
ittet ls
movls.w r0, r1
movls.w r1, r2
movhi.w r2, r3
movls.w r3, r4
iteet ls
movls.w r0, r1
movhi.w r1, r2
movhi.w r2, r3
movls.w r3, r4
ittte ls
movls.w r0, r1
movls.w r1, r2
movls.w r2, r3
movhi.w r3, r4
itete ls
movls.w r0, r1
movhi.w r1, r2
movls.w r2, r3
movhi.w r3, r4
ittee ls
movls.w r0, r1
movls.w r1, r2
movhi.w r2, r3
movhi.w r3, r4
iteee ls
movls.w r0, r1
movhi.w r1, r2
movhi.w r2, r3
movhi.w r3, r4
ge:
it ge
movge.w r0, r1
itt ge
movge.w r0, r1
movge.w r1, r2
ite ge
movge.w r0, r1
movlt.w r1, r2
ittt ge
movge.w r0, r1
movge.w r1, r2
movge.w r2, r3
itte ge
movge.w r0, r1
movge.w r1, r2
movlt.w r2, r3
itet ge
movge.w r0, r1
movlt.w r1, r2
movge.w r2, r3
itee ge
movge.w r0, r1
movlt.w r1, r2
movlt.w r2, r3
itttt ge
movge.w r0, r1
movge.w r1, r2
movge.w r2, r3
movge.w r3, r4
itett ge
movge.w r0, r1
movlt.w r1, r2
movge.w r2, r3
movge.w r3, r4
ittet ge
movge.w r0, r1
movge.w r1, r2
movlt.w r2, r3
movge.w r3, r4
iteet ge
movge.w r0, r1
movlt.w r1, r2
movlt.w r2, r3
movge.w r3, r4
ittte ge
movge.w r0, r1
movge.w r1, r2
movge.w r2, r3
movlt.w r3, r4
itete ge
movge.w r0, r1
movlt.w r1, r2
movge.w r2, r3
movlt.w r3, r4
ittee ge
movge.w r0, r1
movge.w r1, r2
movlt.w r2, r3
movlt.w r3, r4
iteee ge
movge.w r0, r1
movlt.w r1, r2
movlt.w r2, r3
movlt.w r3, r4
lt:
it lt
movlt.w r0, r1
itt lt
movlt.w r0, r1
movlt.w r1, r2
ite lt
movlt.w r0, r1
movge.w r1, r2
ittt lt
movlt.w r0, r1
movlt.w r1, r2
movlt.w r2, r3
itte lt
movlt.w r0, r1
movlt.w r1, r2
movge.w r2, r3
itet lt
movlt.w r0, r1
movge.w r1, r2
movlt.w r2, r3
itee lt
movlt.w r0, r1
movge.w r1, r2
movge.w r2, r3
itttt lt
movlt.w r0, r1
movlt.w r1, r2
movlt.w r2, r3
movlt.w r3, r4
itett lt
movlt.w r0, r1
movge.w r1, r2
movlt.w r2, r3
movlt.w r3, r4
ittet lt
movlt.w r0, r1
movlt.w r1, r2
movge.w r2, r3
movlt.w r3, r4
iteet lt
movlt.w r0, r1
movge.w r1, r2
movge.w r2, r3
movlt.w r3, r4
ittte lt
movlt.w r0, r1
movlt.w r1, r2
movlt.w r2, r3
movge.w r3, r4
itete lt
movlt.w r0, r1
movge.w r1, r2
movlt.w r2, r3
movge.w r3, r4
ittee lt
movlt.w r0, r1
movlt.w r1, r2
movge.w r2, r3
movge.w r3, r4
iteee lt
movlt.w r0, r1
movge.w r1, r2
movge.w r2, r3
movge.w r3, r4
gt:
it gt
movgt.w r0, r1
itt gt
movgt.w r0, r1
movgt.w r1, r2
ite gt
movgt.w r0, r1
movle.w r1, r2
ittt gt
movgt.w r0, r1
movgt.w r1, r2
movgt.w r2, r3
itte gt
movgt.w r0, r1
movgt.w r1, r2
movle.w r2, r3
itet gt
movgt.w r0, r1
movle.w r1, r2
movgt.w r2, r3
itee gt
movgt.w r0, r1
movle.w r1, r2
movle.w r2, r3
itttt gt
movgt.w r0, r1
movgt.w r1, r2
movgt.w r2, r3
movgt.w r3, r4
itett gt
movgt.w r0, r1
movle.w r1, r2
movgt.w r2, r3
movgt.w r3, r4
ittet gt
movgt.w r0, r1
movgt.w r1, r2
movle.w r2, r3
movgt.w r3, r4
iteet gt
movgt.w r0, r1
movle.w r1, r2
movle.w r2, r3
movgt.w r3, r4
ittte gt
movgt.w r0, r1
movgt.w r1, r2
movgt.w r2, r3
movle.w r3, r4
itete gt
movgt.w r0, r1
movle.w r1, r2
movgt.w r2, r3
movle.w r3, r4
ittee gt
movgt.w r0, r1
movgt.w r1, r2
movle.w r2, r3
movle.w r3, r4
iteee gt
movgt.w r0, r1
movle.w r1, r2
movle.w r2, r3
movle.w r3, r4
le:
it le
movle.w r0, r1
itt le
movle.w r0, r1
movle.w r1, r2
ite le
movle.w r0, r1
movgt.w r1, r2
ittt le
movle.w r0, r1
movle.w r1, r2
movle.w r2, r3
itte le
movle.w r0, r1
movle.w r1, r2
movgt.w r2, r3
itet le
movle.w r0, r1
movgt.w r1, r2
movle.w r2, r3
itee le
movle.w r0, r1
movgt.w r1, r2
movgt.w r2, r3
itttt le
movle.w r0, r1
movle.w r1, r2
movle.w r2, r3
movle.w r3, r4
itett le
movle.w r0, r1
movgt.w r1, r2
movle.w r2, r3
movle.w r3, r4
ittet le
movle.w r0, r1
movle.w r1, r2
movgt.w r2, r3
movle.w r3, r4
iteet le
movle.w r0, r1
movgt.w r1, r2
movgt.w r2, r3
movle.w r3, r4
ittte le
movle.w r0, r1
movle.w r1, r2
movle.w r2, r3
movgt.w r3, r4
itete le
movle.w r0, r1
movgt.w r1, r2
movle.w r2, r3
movgt.w r3, r4
ittee le
movle.w r0, r1
movle.w r1, r2
movgt.w r2, r3
movgt.w r3, r4
iteee le
movle.w r0, r1
movgt.w r1, r2
movgt.w r2, r3
movgt.w r3, r4
> Andrew.
Paulo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm.c
Type: text/x-csrc
Size: 5983 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120315/06a80f6e/arm.c
More information about the distro-pkg-dev
mailing list