qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Using new TCG Vector infrastructure in PowerPC


From: Nikunj A Dadhania
Subject: [Qemu-devel] Using new TCG Vector infrastructure in PowerPC
Date: Wed, 07 Mar 2018 15:33:56 +0530

Hi Richard,

I was working to get TCG vector support for PowerPC[1]. Started with
converting logical operations like vector AND/OR/XOR and compare
instructions. Found some inconsistency during my testing on x86 laptop
emulating PowerPC:

zero = 0000000000000000 0000000000000000 
max = ffffffffffffffff ffffffffffffffff 

1) tcg_gen_andc_vec - vandc in PPC

New API result:
andc(zero, max) -  (zero & ~max ) = 0000000000000000 0000000000000000
andc(max, zero) -  (max & ~zero ) = ffffffffffffffff ffffffffffffffff
andc(max, max)  -  (max & ~max ) = ffffffffffffffff ffffffffffffffff    -->WRONG
andc(zero, zero)-  (zero & ~zero ) = 0000000000000000 0000000000000000 

Expected result:
andc(zero, max)  (zero & ~max ) = 0000000000000000 0000000000000000 
andc(max, zero)  (max & ~zero ) = ffffffffffffffff ffffffffffffffff 
andc(max, max)   (max & ~max ) = 0000000000000000 0000000000000000 
andc(zero, zero) (zero & ~zero ) = 0000000000000000 0000000000000000 

2) tcg_gen_or_vec - vor in PPC

New API result:
(zero | max ) = 0000000000000000 0000000000000000   -----> WRONG
(max | max ) = ffffffffffffffff ffffffffffffffff 
(zero | zero ) = 0000000000000000 0000000000000000

Expected result:
(zero | max ) = ffffffffffffffff ffffffffffffffff 
(max | max ) = ffffffffffffffff ffffffffffffffff 
(zero | zero ) = 0000000000000000 0000000000000000 

3) tcg_gen_cmp_vec(TCG_COND_EQ) - vcmpequ* in PPC

New API result(all incorrect):

vcmpequb (zero == zero ) = 0000000000000000 0000000000000000 
vcmpequh (zero == zero ) = 0000000000000000 0000000000000000 
vcmpequw (zero == zero ) = 0000000000000000 0000000000000000 
vcmpequd (zero == zero ) = 0000000000000000 0000000000000000

Expected result:
vcmpequb (zero == zero ) = ffffffffffffffff ffffffffffffffff 
vcmpequh (zero == zero ) = ffffffffffffffff ffffffffffffffff 
vcmpequw (zero == zero ) = ffffffffffffffff ffffffffffffffff 
vcmpequd (zero == zero ) = ffffffffffffffff ffffffffffffffff

Do you see something that I am missing here ?

Regards,
Nikunj

1. PowerPC TCG vector infrastructure implementation
https://github.com/nikunjad/qemu/tree/ppc_vec_0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]