target-arm queue
Subsystems (2)
Arm queue -- I have more stuff pending but I prefer to push this first lot out and keep the pull below 50 patches. Most of this is Alex's FP16 support work.
-- PMM
The following changes since commit 6697439794f72b3501ee16bb95d16854f9981421:
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180227-pull-request' into staging (2018-02-27 17:50:46 +0000)
are available in the Git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20180301
for you to fetch changes up to c22e580c2ad1cccef582e1490e732f254d4ac064:
MAINTAINERS: Update my email address (2018-03-01 11:13:59 +0000)
----------------------------------------------------------------
target-arm queue:
* update MAINTAINERS for Alistair's new email address
* add Arm v8.2 FP16 arithmetic extension for linux-user
* implement display connector emulation for vexpress board
* xilinx_spips: Enable only two slaves when reading/writing with stripe
* xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands
* hw: register: Run post_write hook on reset
----------------------------------------------------------------
Alex Bennée (31):
include/exec/helper-head.h: support f16 in helper calls target/arm/cpu64: introduce ARM_V8_FP16 feature bit target/arm/cpu.h: update comment for half-precision values target/arm/cpu.h: add additional float_status flags target/arm/helper: pass explicit fpst to set_rmode arm/translate-a64: implement half-precision F(MIN|MAX)(V|NMV) arm/translate-a64: handle_3same_64 comment fix
arm/translate-a64: initial decode for simd_three_reg_same_fp16 arm/translate-a64: add FP16 FADD/FABD/FSUB/FMUL/FDIV to simd_three_reg_same_fp16 arm/translate-a64: add FP16 F[A]C[EQ/GE/GT] to simd_three_reg_same_fp16 arm/translate-a64: add FP16 FMULA/X/S to simd_three_reg_same_fp16 arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16 arm/translate-a64: add FP16 pairwise ops simd_three_reg_same_fp16 arm/translate-a64: add FP16 FMULX/MLS/FMLA to simd_indexed arm/translate-a64: add FP16 x2 ops for simd_indexed arm/translate-a64: initial decode for simd_two_reg_misc_fp16 arm/translate-a64: add FP16 FPRINTx to simd_two_reg_misc_fp16 arm/translate-a64: add FCVTxx to simd_two_reg_misc_fp16 arm/translate-a64: add FP16 FCMxx (zero) to simd_two_reg_misc_fp16 arm/translate-a64: add FP16 SCVTF/UCVFT to simd_two_reg_misc_fp16 arm/translate-a64: add FP16 FNEG/FABS to simd_two_reg_misc_fp16 arm/helper.c: re-factor recpe and add recepe_f16 arm/translate-a64: add FP16 FRECPE
arm/translate-a64: add FP16 FRCPX to simd_two_reg_misc_fp16 arm/translate-a64: add FP16 FSQRT to simd_two_reg_misc_fp16 arm/helper.c: re-factor rsqrte and add rsqrte_f16 arm/translate-a64: add FP16 FRSQRTE to simd_two_reg_misc_fp16 arm/translate-a64: add FP16 FMOV to simd_mod_imm arm/translate-a64: add all FP16 ops in simd_scalar_pairwise arm/translate-a64: implement simd_scalar_three_reg_same_fp16 arm/translate-a64: add all single op FP16 to handle_fp_1src_half
Alistair Francis (2):
hw: register: Run post_write hook on reset
MAINTAINERS: Update my email address
Corey Minyard (2):
i2c: Fix some brace style issues
i2c: Move the bus class to i2c.h
Francisco Iglesias (2):
xilinx_spips: Enable only two slaves when reading/writing with stripe
xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands
Linus Walleij (3):
hw/i2c-ddc: Do not fail writes
hw/sii9022: Add support for Silicon Image SII9022 arm/vexpress: Add proper display connector emulation
Peter Maydell (2):
target/arm: Enable ARM_V8_FP16 feature bit for the AArch64 "any" CPU
linux-user: Report AArch64 FP16 support via hwcap bits
hw/display/Makefile.objs | 1 + include/exec/helper-head.h | 3 + include/fpu/softfloat.h | 18 +- include/hw/i2c/i2c.h | 23 +- include/hw/register.h | 6 +- target/arm/cpu.h | 34 +- target/arm/helper-a64.h | 33 + target/arm/helper.h | 14 +- hw/arm/vexpress.c | 6 +- hw/core/register.c | 8 + hw/display/sii9022.c | 191 ++++++ hw/i2c/core.c | 18 - hw/i2c/i2c-ddc.c | 4 +- hw/ssi/xilinx_spips.c | 43 +- linux-user/elfload.c | 2 + target/arm/cpu64.c | 1 + target/arm/helper-a64.c | 269 +++++++++ target/arm/helper.c | 481 ++++++++------- target/arm/translate-a64.c | 1266 +++++++++++++++++++++++++++++++++------ target/arm/translate.c | 12 +- MAINTAINERS | 12 +- default-configs/arm-softmmu.mak | 2 + hw/display/trace-events | 5 + 23 files changed, 1981 insertions(+), 471 deletions(-) create mode 100644 hw/display/sii9022.c
[Qemu-devel] [PULL 10/42] target/arm/cpu64: introduce ARM_V8_FP16 feature bit
From: Alex Bennée <[email protected]>
Message-id: [email protected] [PMM: postpone actually enabling feature until end of the
patch series]
--- target/arm/cpu.h | 1 + 1 file changed, 1 insertion(+)
target/arm/cpu.h +1 -0
@@ -1408,6 +1408,7 @@ enum arm_features {ARM_FEATURE_V8_SHA3 ,/* implements SHA3 part of v8 Crypto Extensions */ ARM_FEATURE_V8_SM3 ,/* implements SM3 part of v8 Crypto Extensions */ ARM_FEATURE_V8_SM4 ,/* implements SM4 part of v8 Crypto Extensions */ + ARM_FEATURE_V8_FP16, /* implements v8.2 half-precision float */ };static inline int arm_feature (CPUARMState *env,int feature)
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 09/42] include/exec/helper-head.h: support f16 in helper calls
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This allows us to explicitly pass float16 to helpers rather than assuming uint32_t and dealing with the result. Of course they will be passed in i32 sized registers by default.
Message-id: [email protected]
--- include/exec/helper-head.h | 3 +++ 1 file changed, 3 insertions(+)
include/exec/helper-head.h +3 -0
@@ -26,6 +26,7 @@#define dh_alias_int i32#define dh_alias_i64 i64#define dh_alias_s64 i64 +#define dh_alias_f16 i32#define dh_alias_f32 i32#define dh_alias_f64 i64#define dh_alias_ptr ptr
@@ -38,6 +39,7 @@#define dh_ctype_int int#define dh_ctype_i64 uint64_t#define dh_ctype_s64 int64_t +#define dh_ctype_f16 float16#define dh_ctype_f32 float32#define dh_ctype_f64 float64#define dh_ctype_ptr void *
@@ -94,6 +96,7 @@#define dh_is_signed_s32 1#define dh_is_signed_i64 0#define dh_is_signed_s64 1 +#define dh_is_signed_f16 0#define dh_is_signed_f32 0#define dh_is_signed_f64 0#define dh_is_signed_tl 0
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 12/42] target/arm/cpu.h: add additional float_status flags
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Half-precision flush to zero behaviour is controlled by a separate FZ16 bit in the FPCR. To handle this we pass a pointer to fp_status_fp16 when working on half-precision operations. The value of the presented FPCR is calculated from an amalgam of the two when read.
Message-id: [email protected]
--- target/arm/cpu.h | 32 ++++++++++++++++++++++------ target/arm/helper.c | 26 ++++++++++++++++++----- target/arm/translate-a64.c | 53 +++++++++++++++++++++++++--------------------- 3 files changed, 75 insertions(+), 36 deletions(-)
target/arm/cpu.h +25 -7
@@ -538,19 +538,29 @@ typedef struct CPUARMState {/* scratch space when Tn are not sufficient. */ uint32_t scratch[8 ]; -/* fp_status is the "normal" fp status. standard_fp_status retains -* values corresponding to the ARM "Standard FPSCR Value", ie -* default-NaN, flush-to-zero, round-to-nearest and is used by -* any operations (generally Neon) which the architecture defines -* as controlled by the standard FPSCR value rather than the FPSCR. +/* There are a number of distinct float control structures: +* +* fp_status: is the "normal" fp status. +* fp_status_fp16: used for half-precision calculations +* standard_fp_status : the ARM "Standard FPSCR Value" +* +* Half-precision operations are governed by a separate +* flush-to-zero control bit in FPSCR:FZ16. We pass a separate +* status structure to control this. +* +* The "Standard FPSCR", ie default-NaN, flush-to-zero, +* round-to-nearest and is used by any operations (generally +* Neon) which the architecture defines as controlled by the +* standard FPSCR value rather than the FPSCR. * * To avoid having to transfer exception bits around, we simply * say that the FPSCR cumulative exception flags are the logical -* OR of the flags in the two fp statuses. This relies on the +* OR of the flags in the three fp statuses. This relies on the * only thing which needs to read the exception flags being * an explicit FPSCR read. */ float_status fp_status; +float_status fp_status_f16;float_status standard_fp_status;/* ZCR_EL[1-3] */
@@ -1190,12 +1200,20 @@ static inline void xpsr_write(CPUARMState *env, uint32_t val, uint32_t mask)uint32_t vfp_get_fpscr (CPUARMState *env);void vfp_set_fpscr (CPUARMState *env,uint32_t val); -/* For A64 the FPSCR is split into two logically distinct registers, +/* FPCR, Floating Point Control Register +* FPSR, Floating Poiht Status Register +* +* For A64 the FPSCR is split into two logically distinct registers, * FPCR and FPSR. However since they still use non-overlapping bits * we store the underlying state in fpscr and just mask on read/write. */ #define FPSR_MASK 0xf800009f#define FPCR_MASK 0x07f79f00 + +#define FPCR_FZ16 (1 << 19)/* ARMv8.2+, FP16 flush-to-zero */ +#define FPCR_FZ (1 << 24)/* Flush-to-zero enable bit */ +#define FPCR_DN (1 << 25)/* Default NaN enable bit */ +static inline uint32_t vfp_get_fpsr (CPUARMState *env) {return vfp_get_fpscr (env) &FPSR_MASK ;
target/arm/helper.c +21 -5
@@ -11103,6 +11103,7 @@ uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env) | (env->vfp.vec_stride << 20); i =get_float_exception_flags (&env->vfp.fp_status); i |=get_float_exception_flags (&env->vfp.standard_fp_status); + i |=get_float_exception_flags (&env->vfp.fp_status_f16); fpscr |=vfp_exceptbits_from_host (i);return fpscr; }
@@ -11160,16 +11161,31 @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val)break ; }set_float_rounding_mode (i, &env->vfp.fp_status); +set_float_rounding_mode (i, &env->vfp.fp_status_f16); } -if (changed & (1 <<24 )) { -set_flush_to_zero ((val & (1 <<24 )) !=0 , &env->vfp.fp_status); -set_flush_inputs_to_zero ((val & (1 <<24 )) !=0 , &env->vfp.fp_status); +if (changed &FPCR_FZ16 ) { +bool ftz_enabled = val &FPCR_FZ16 ; +set_flush_to_zero (ftz_enabled, &env->vfp.fp_status_f16); +set_flush_inputs_to_zero (ftz_enabled, &env->vfp.fp_status_f16); + } +if (changed &FPCR_FZ ) { +bool ftz_enabled = val &FPCR_FZ ; +set_flush_to_zero (ftz_enabled, &env->vfp.fp_status); +set_flush_inputs_to_zero (ftz_enabled, &env->vfp.fp_status); + } +if (changed &FPCR_DN ) { +bool dnan_enabled = val &FPCR_DN ; +set_default_nan_mode (dnan_enabled, &env->vfp.fp_status); +set_default_nan_mode (dnan_enabled, &env->vfp.fp_status_f16); } -if (changed & (1 <<25 )) -set_default_nan_mode ((val & (1 <<25 )) !=0 , &env->vfp.fp_status); +/* The exception flags are ORed together when we read fpscr so we +* only need to preserve the current state in one of our +* float_status values. +*/ i =vfp_exceptbits_to_host (val);set_float_exception_flags (i, &env->vfp.fp_status); +set_float_exception_flags (0 , &env->vfp.fp_status_f16);set_float_exception_flags (0 , &env->vfp.standard_fp_status); }
target/arm/translate-a64.c +29 -24
178 lines not on this page · raw message
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 15/42] arm/translate-a64: handle_3same_64 comment fix
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
We do implement all the opcodes.
Message-id: [email protected]
--- target/arm/translate-a64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
target/arm/translate-a64.c +1 -2
@@ -7278,8 +7278,7 @@ static void handle_3same_64(DisasContext *s, int opcode, bool u,/* Handle 64x64->64 opcodes which are shared between the scalar * and vector 3-same groups. We cover every opcode where size == 3 * is valid in either the three-reg-same (integer, not pairwise) -* or scalar-three-reg-same groups. (Some opcodes are not yet -* implemented.) +* or scalar-three-reg-same groups. */ TCGCond cond;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 06/42] hw/i2c-ddc: Do not fail writes
In reply to Peter MaydellFrom: Linus Walleij <[email protected]>
The tx function of the DDC I2C slave emulation was returning 1 on all writes resulting in NACK in the I2C bus. Changing it to 0 makes the DDC I2C work fine with bit-banged I2C such as the versatile I2C.
I guess it was not affecting whatever I2C controller this was used with until now, but with the Versatile I2C it surely does not work.
Message-id: [email protected]
--- hw/i2c/i2c-ddc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/i2c/i2c-ddc.c +2 -2
@@ -259,12 +259,12 @@ static int i2c_ddc_tx(I2CSlave *i2c, uint8_t data) s->reg = data; s->firstbyte = false;DPRINTF ("[EDID] Written new pointer: %u\n" , data); -return 1 ; +return 0 ; }/* Ignore all writes */ s->reg++; -return 1 ; +return 0 ; }static void i2c_ddc_init (Object *obj)
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 08/42] arm/vexpress: Add proper display connector emulation
In reply to Peter MaydellFrom: Linus Walleij <[email protected]>
This adds the SiI9022 (and implicitly EDID I2C) device to the ARM Versatile Express machine, and selects the two I2C devices necessary in the arm-softmmu.mak configuration so everything will build smoothly.
I am implementing proper handling of the graphics in the Linux kernel and adding proper emulation of SiI9022 and EDID makes the driver probe as nicely as before, retrieving the resolutions supported by the "QEMU monitor" and overall just working nice.
Message-id: [email protected]
--- hw/arm/vexpress.c | 6 +++++- default-configs/arm-softmmu.mak | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-)
hw/arm/vexpress.c +5 -1
@@ -29,6 +29,7 @@#include "hw/arm/arm.h" #include "hw/arm/primecell.h" #include "hw/devices.h" +#include "hw/i2c/i2c.h" #include "net/net.h" #include "sysemu/sysemu.h" #include "hw/boards.h"
@@ -537,6 +538,7 @@ static void vexpress_common_init(MachineState *machine)uint32_t sys_id;DriveInfo *dinfo;pflash_t *pflash0; +I2CBus *i2c;ram_addr_t vram_size, sram_size;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *vram =g_new (MemoryRegion,1 );
@@ -628,7 +630,9 @@ static void vexpress_common_init(MachineState *machine)sysbus_create_simple ("sp804" , map[VE_TIMER01 ], pic[2 ]);sysbus_create_simple ("sp804" , map[VE_TIMER23 ], pic[3 ]); -/* VE_SERIALDVI: not modelled */ + dev =sysbus_create_simple ("versatile_i2c" , map[VE_SERIALDVI ],NULL ); + i2c = (I2CBus *)qdev_get_child_bus (dev,"i2c" ); +i2c_create_slave (i2c,"sii9022" ,0x39 );sysbus_create_simple ("pl031" , map[VE_RTC ], pic[4 ]);/* RTC */
default-configs/arm-softmmu.mak +2 -0
@@ -21,6 +21,8 @@ CONFIG_STELLARIS_INPUT=y CONFIG_STELLARIS_ENET=y CONFIG_SSD0303=y CONFIG_SSD0323=y +CONFIG_DDC=y +CONFIG_SII9022=y CONFIG_ADS7846=y CONFIG_MAX111X=y CONFIG_SSI=y
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 14/42] arm/translate-a64: implement half-precision F(MIN|MAX)(V|NMV)
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This implements the half-precision variants of the across vector reduction operations. This involves a re-factor of the reduction code which more closely matches the ARM ARM order (and handles 8 element reductions).
Message-id: [email protected]
--- target/arm/helper-a64.h | 4 ++ target/arm/helper-a64.c | 18 ++++++ target/arm/translate-a64.c | 140 ++++++++++++++++++++++++++++----------------- 3 files changed, 109 insertions(+), 53 deletions(-)
target/arm/helper-a64.h +4 -0
@@ -48,3 +48,7 @@ DEF_HELPER_FLAGS_4(paired_cmpxchg64_le_parallel, TCG_CALL_NO_WG, DEF_HELPER_FLAGS_4(paired_cmpxchg64_be, TCG_CALL_NO_WG, i64, env, i64, i64, i64)DEF_HELPER_FLAGS_4 (paired_cmpxchg64_be_parallel,TCG_CALL_NO_WG , i64, env, i64, i64, i64) +DEF_HELPER_FLAGS_3(advsimd_maxh, TCG_CALL_NO_RWG, f16, f16, f16, ptr) +DEF_HELPER_FLAGS_3(advsimd_minh, TCG_CALL_NO_RWG, f16, f16, f16, ptr) +DEF_HELPER_FLAGS_3(advsimd_maxnumh, TCG_CALL_NO_RWG, f16, f16, f16, ptr) +DEF_HELPER_FLAGS_3 (advsimd_minnumh,TCG_CALL_NO_RWG , f16, f16, f16, ptr)
target/arm/helper-a64.c +18 -0
@@ -572,3 +572,21 @@ uint64_t HELPER(paired_cmpxchg64_be_parallel)(CPUARMState *env, uint64_t addr, {return do_paired_cmpxchg64_be (env, addr, new_lo, new_hi, true,GETPC ()); } + +/* +* AdvSIMD half-precision +*/ + +#define ADVSIMD_HELPER (name, suffix) HELPER(glue(glue(advsimd_, name), suffix)) + +#define ADVSIMD_HALFOP (name) \ +float16 ADVSIMD_HELPER(name, h)(float16 a, float16 b, void *fpstp) \ +{ \ + float_status *fpst = fpstp; \ + return float16_ ## name(a, b, fpst); \ +} + +ADVSIMD_HALFOP(min) +ADVSIMD_HALFOP(max) +ADVSIMD_HALFOP(minnum) +ADVSIMD_HALFOP(maxnum)
target/arm/translate-a64.c +87 -53
167 lines not on this page · raw message
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 16/42] arm/translate-a64: initial decode for simd_three_reg_same_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This is the initial decode skeleton for the Advanced SIMD three same instruction group.
The fprintf is purely to aid debugging as the additional instructions are added. It will be removed once the group is complete.
Message-id: [email protected]
--- target/arm/translate-a64.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)
target/arm/translate-a64.c +73 -0
@@ -10228,6 +10228,78 @@ static void disas_simd_three_reg_same(DisasContext *s, uint32_t insn) } } +/* +* Advanced SIMD three same (ARMv8.2 FP16 variants) +* +* 31 30 29 28 24 23 22 21 20 16 15 14 13 11 10 9 5 4 0 +* +---+---+---+-----------+---------+------+-----+--------+---+------+------+ +* | 0 | Q | U | 0 1 1 1 0 | a | 1 0 | Rm | 0 0 | opcode | 1 | Rn | Rd | +* +---+---+---+-----------+---------+------+-----+--------+---+------+------+ +* +* This includes FMULX, FCMEQ (register), FRECPS, FRSQRTS, FCMGE +* (register), FACGE, FABD, FCMGT (register) and FACGT. +* +*/ +static void disas_simd_three_reg_same_fp16 (DisasContext *s,uint32_t insn) +{ +int opcode, fpopcode; +int is_q, u, a, rm, rn, rd; +int datasize, elements; +int pass; +TCGv_ptr fpst; + +if (!arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) { +unallocated_encoding (s); +return ; + } + +if (!fp_access_check (s)) { +return ; + } + +/* For these floating point ops, the U, a and opcode bits +* together indicate the operation. +*/ + opcode =extract32 (insn,11 ,3 ); + u =extract32 (insn,29 ,1 ); + a =extract32 (insn,23 ,1 ); + is_q =extract32 (insn,30 ,1 ); + rm =extract32 (insn,16 ,5 ); + rn =extract32 (insn,5 ,5 ); + rd =extract32 (insn,0 ,5 ); + + fpopcode = opcode | (a <<3 ) | (u <<4 ); + datasize = is_q ?128 :64 ; + elements = datasize /16 ; + + fpst =get_fpstatus_ptr (true); + +for (pass =0 ; pass < elements; pass++) { +TCGv_i32 tcg_op1 =tcg_temp_new_i32 (); +TCGv_i32 tcg_op2 =tcg_temp_new_i32 (); +TCGv_i32 tcg_res =tcg_temp_new_i32 (); + +read_vec_element_i32 (s, tcg_op1, rn, pass,MO_16 ); +read_vec_element_i32 (s, tcg_op2, rm, pass,MO_16 ); + +switch (fpopcode) { +default : +fprintf (stderr,"%s: insn %#04x, fpop %#2x @ %#" PRIx64"\n" , + __func__, insn, fpopcode, s->pc); +g_assert_not_reached (); + } + +write_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); +tcg_temp_free_i32 (tcg_res); +tcg_temp_free_i32 (tcg_op1); +tcg_temp_free_i32 (tcg_op2); + } + +tcg_temp_free_ptr (fpst); + +clear_vec_high (s, is_q, rd); +} +static void handle_2misc_widening (DisasContext *s,int opcode,bool is_q,int size,int rn,int rd) {
@@ -11975,6 +12047,7 @@ static const AArch64DecodeTable data_proc_simd[] = { { 0xce000000, 0xff808000, disas_crypto_four_reg }, { 0xce800000, 0xffe00000, disas_crypto_xar }, { 0xce408000, 0xffe0c000, disas_crypto_three_reg_imm2 }, + { 0x0e400400, 0x9f60c400, disas_simd_three_reg_same_fp16 }, { 0x00000000, 0x00000000, NULL } };
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 03/42] xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands
In reply to Peter MaydellFrom: Francisco Iglesias <[email protected]>
Use 8 dummy cycles (4 dummy bytes) with the QIOR/QIOR4 commands in legacy mode for matching what is expected by Micron (Numonyx) flashes (the default target flash type of the QSPI).
Message-id: [email protected]
--- hw/ssi/xilinx_spips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ssi/xilinx_spips.c +1 -1
@@ -577,7 +577,7 @@ static int xilinx_spips_num_dummies(XilinxQSPIPS *qs, uint8_t command)return 2 ;case QIOR :case QIOR_4 : -return 5 ; +return 4 ;default :return -1 ; }
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 04/42] i2c: Fix some brace style issues
In reply to Peter MaydellFrom: Corey Minyard <[email protected]>
Message-id: [email protected]
--- include/hw/i2c/i2c.h | 6 ++---- hw/i2c/core.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-)
include/hw/i2c/i2c.h +2 -4
@@ -25,8 +25,7 @@ typedef struct I2CSlave I2CSlave;#define I2C_SLAVE_GET_CLASS (obj) \ OBJECT_GET_CLASS(I2CSlaveClass, (obj), TYPE_I2C_SLAVE) -typedef struct I2CSlaveClass -{ +typedef struct I2CSlaveClass { DeviceClass parent_class; /* Callbacks provided by the device. */
@@ -50,8 +49,7 @@ typedef struct I2CSlaveClassint (*event)(I2CSlave *s,enum i2c_event event); } I2CSlaveClass; -struct I2CSlave -{ +struct I2CSlave {DeviceState qdev;/* Remaining fields for internal use by the I2C code. */
hw/i2c/core.c +1 -2
@@ -19,8 +19,7 @@ struct I2CNode {#define I2C_BROADCAST 0x00 -struct I2CBus -{ +struct I2CBus {BusState qbus; QLIST_HEAD(, I2CNode) current_devs;uint8_t saved_address;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 05/42] i2c: Move the bus class to i2c.h
In reply to Peter MaydellFrom: Corey Minyard <[email protected]>
Some devices need access to it.
Message-id: [email protected]
--- include/hw/i2c/i2c.h | 17 +++++++++++++++++ hw/i2c/core.c | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-)
include/hw/i2c/i2c.h +17 -0
@@ -56,6 +56,23 @@ struct I2CSlave {uint8_t address; }; +#define TYPE_I2C_BUS "i2c-bus" +#define I2C_BUS (obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS) + +typedef struct I2CNode I2CNode ; + +struct I2CNode { +I2CSlave *elt; +QLIST_ENTRY (I2CNode) next; +}; + +struct I2CBus { +BusState qbus; + QLIST_HEAD(, I2CNode) current_devs; +uint8_t saved_address; +bool broadcast; +}; +I2CBus *i2c_init_bus (DeviceState *parent,const char *name);void i2c_set_slave_address (I2CSlave *dev,uint8_t address);int i2c_bus_busy (I2CBus *bus);
hw/i2c/core.c +0 -17
@@ -10,30 +10,13 @@#include "qemu/osdep.h" #include "hw/i2c/i2c.h" -typedef struct I2CNode I2CNode ; - -struct I2CNode { -I2CSlave *elt; -QLIST_ENTRY (I2CNode) next; -}; -#define I2C_BROADCAST 0x00 -struct I2CBus { -BusState qbus; - QLIST_HEAD(, I2CNode) current_devs; -uint8_t saved_address; -bool broadcast; -}; -static Property i2c_props[] = { DEFINE_PROP_UINT8("address", struct I2CSlave, address, 0),DEFINE_PROP_END_OF_LIST (), }; -#define TYPE_I2C_BUS "i2c-bus" -#define I2C_BUS (obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS) -static const TypeInfo i2c_bus_info = { .name =TYPE_I2C_BUS , .parent =TYPE_BUS ,
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 07/42] hw/sii9022: Add support for Silicon Image SII9022
In reply to Peter MaydellFrom: Linus Walleij <[email protected]>
This adds support for emulating the Silicon Image SII9022 DVI/HDMI bridge. It's not very clever right now, it just acknowledges the switch into DDC I2C mode and back. Combining this with the existing DDC I2C emulation gives the right behavior on the Versatile Express emulation passing through the QEMU EDID to the emulated platform.
Message-id: [email protected]
--- hw/display/Makefile.objs | 1 + hw/display/sii9022.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++ hw/display/trace-events | 5 ++ 3 files changed, 197 insertions(+) create mode 100644 hw/display/sii9022.c
hw/display/Makefile.objs +1 -0
@@ -3,6 +3,7 @@ common-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o common-obj-$(CONFIG_G364FB) += g364fb.o common-obj-$(CONFIG_JAZZ_LED) += jazz_led.o common-obj-$(CONFIG_PL110) += pl110.o +common-obj-$(CONFIG_SII9022) += sii9022.o common-obj-$(CONFIG_SSD0303) += ssd0303.o common-obj-$(CONFIG_SSD0323) += ssd0323.o common-obj-$(CONFIG_XEN) += xenfb.o
hw/display/sii9022.c new file +191 -0
191 lines not on this page · raw message
hw/display/trace-events +5 -0
@@ -132,3 +132,8 @@ vga_cirrus_read_io(uint32_t addr, uint32_t val) "addr 0x%x, val 0x%x" vga_cirrus_write_io(uint32_t addr, uint32_t val) "addr 0x%x, val 0x%x" vga_cirrus_read_blt(uint32_t offset, uint32_t val) "offset 0x%x, val 0x%x" vga_cirrus_write_blt(uint32_t offset, uint32_t val) "offset 0x%x, val 0x%x" + +# hw/display/sii9022.c +sii9022_read_reg(uint8_t addr, uint8_t val) "addr 0x%02x, val 0x%02x" +sii9022_write_reg(uint8_t addr, uint8_t val) "addr 0x%02x, val 0x%02x" +sii9022_switch_mode(const char *mode) "mode: %s"
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 13/42] target/arm/helper: pass explicit fpst to set_rmode
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
As the rounding mode is now split between FP16 and the rest of floating point we need to be explicit when tweaking it. Instead of passing the CPU env we now pass the appropriate fpst pointer directly.
Message-id: [email protected]
--- target/arm/helper.h | 2 +- target/arm/helper.c | 4 ++-- target/arm/translate-a64.c | 26 +++++++++++++------------- target/arm/translate.c | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-)
target/arm/helper.h +1 -1
@@ -167,7 +167,7 @@ DEF_HELPER_3(vfp_uhtod, f64, i64, i32, ptr) DEF_HELPER_3(vfp_ultod, f64, i64, i32, ptr) DEF_HELPER_3(vfp_uqtod, f64, i64, i32, ptr) -DEF_HELPER_FLAGS_2(set_rmode, TCG_CALL_NO_RWG, i32, i32, env) +DEF_HELPER_FLAGS_2(set_rmode, TCG_CALL_NO_RWG, i32, i32, ptr) DEF_HELPER_FLAGS_2(set_neon_rmode, TCG_CALL_NO_RWG, i32, i32, env)DEF_HELPER_2 (vfp_fcvt_f16_to_f32, f32, i32, env)
target/arm/helper.c +2 -2
@@ -11393,9 +11393,9 @@ VFP_CONV_FIX_A64(uq, s, 32, 64, uint64)/* Set the current fp rounding mode and return the old one. * The argument is a softfloat float_round_ value. */ -uint32_t HELPER (set_rmode )(uint32_t rmode,CPUARMState *env) +uint32_t HELPER (set_rmode )(uint32_t rmode,void *fpstp) { -float_status *fp_status = &env->vfp.fp_status; +float_status *fp_status = fpstp;uint32_t prev_rmode =get_float_rounding_mode (fp_status);set_float_rounding_mode (rmode, fp_status);
target/arm/translate-a64.c +13 -13
@@ -4628,10 +4628,10 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) {TCGv_i32 tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (opcode &7 )); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);gen_helper_rints (tcg_res, tcg_op, fpst); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);tcg_temp_free_i32 (tcg_rmode);break ; }
@@ -4687,10 +4687,10 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) {TCGv_i32 tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (opcode &7 )); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);gen_helper_rintd (tcg_res, tcg_op, fpst); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);tcg_temp_free_i32 (tcg_rmode);break ; }
@@ -5217,7 +5217,7 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode, tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (rmode)); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus);if (is_double) {TCGv_i64 tcg_double =read_fp_dreg (s, rn);
@@ -5264,7 +5264,7 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,tcg_temp_free_i32 (tcg_single); } -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus);tcg_temp_free_i32 (tcg_rmode);if (!sf) {
@@ -6984,8 +6984,8 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar,assert (!(is_scalar && is_q)); tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (FPROUNDING_ZERO )); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); tcg_fpstatus =get_fpstatus_ptr (false); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus); tcg_shift =tcg_const_i32 (fracbits);if (is_double) {
@@ -7029,7 +7029,7 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar,tcg_temp_free_ptr (tcg_fpstatus);tcg_temp_free_i32 (tcg_shift); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus);tcg_temp_free_i32 (tcg_rmode); }
@@ -8300,8 +8300,8 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn)if (is_fcvt) { tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (rmode)); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); tcg_fpstatus =get_fpstatus_ptr (false); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus); }else { tcg_rmode =NULL ; tcg_fpstatus =NULL ;
@@ -8366,7 +8366,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) }if (is_fcvt) { -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus);tcg_temp_free_i32 (tcg_rmode);tcg_temp_free_ptr (tcg_fpstatus); }
@@ -10680,14 +10680,14 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)return ; } -if (need_fpstatus) { +if (need_fpstatus || need_rmode) { tcg_fpstatus =get_fpstatus_ptr (false); }else { tcg_fpstatus =NULL ; }if (need_rmode) { tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (rmode)); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus); }else { tcg_rmode =NULL ; }
@@ -10929,7 +10929,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)clear_vec_high (s, is_q, rd);if (need_rmode) { -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, tcg_fpstatus);tcg_temp_free_i32 (tcg_rmode); }if (need_fpstatus) {
target/arm/translate.c +6 -6
@@ -3143,7 +3143,7 @@ static int handle_vrint(uint32_t insn, uint32_t rd, uint32_t rm, uint32_t dp,TCGv_i32 tcg_rmode; tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (rounding)); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);if (dp) {TCGv_i64 tcg_op;
@@ -3167,7 +3167,7 @@ static int handle_vrint(uint32_t insn, uint32_t rd, uint32_t rm, uint32_t dp,tcg_temp_free_i32 (tcg_res); } -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);tcg_temp_free_i32 (tcg_rmode);tcg_temp_free_ptr (fpst);
@@ -3184,7 +3184,7 @@ static int handle_vcvt(uint32_t insn, uint32_t rd, uint32_t rm, uint32_t dp, tcg_shift =tcg_const_i32 (0 ); tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (rounding)); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);if (dp) {TCGv_i64 tcg_double, tcg_res;
@@ -3222,7 +3222,7 @@ static int handle_vcvt(uint32_t insn, uint32_t rd, uint32_t rm, uint32_t dp,tcg_temp_free_i32 (tcg_single); } -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);tcg_temp_free_i32 (tcg_rmode);tcg_temp_free_i32 (tcg_shift);
@@ -3892,13 +3892,13 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn)TCGv_ptr fpst =get_fpstatus_ptr (0 );TCGv_i32 tcg_rmode; tcg_rmode =tcg_const_i32 (float_round_to_zero); -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);if (dp) {gen_helper_rintd (cpu_F0d, cpu_F0d, fpst); }else {gen_helper_rints (cpu_F0s, cpu_F0s, fpst); } -gen_helper_set_rmode (tcg_rmode, tcg_rmode, cpu_env); +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst);tcg_temp_free_i32 (tcg_rmode);tcg_temp_free_ptr (fpst);break ;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 17/42] arm/translate-a64: add FP16 FADD/FABD/FSUB/FMUL/FDIV to simd_three_reg_same_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
The fprintf is only there for debugging as the skeleton is added to, it will be removed once the skeleton is complete.
Message-id: [email protected]
--- target/arm/helper-a64.h | 4 ++++ target/arm/helper-a64.c | 4 ++++ target/arm/translate-a64.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+)
target/arm/helper-a64.h +4 -0
@@ -52,3 +52,7 @@ DEF_HELPER_FLAGS_3(advsimd_maxh, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(advsimd_minh, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(advsimd_maxnumh, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(advsimd_minnumh, TCG_CALL_NO_RWG, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_addh, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_subh, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_mulh, f16, f16, f16, ptr) +DEF_HELPER_3 (advsimd_divh, f16, f16, f16, ptr)
target/arm/helper-a64.c +4 -0
@@ -586,6 +586,10 @@ float16 ADVSIMD_HELPER(name, h)(float16 a, float16 b, void *fpstp) \ return float16_ ## name(a, b, fpst); \ } +ADVSIMD_HALFOP(add) +ADVSIMD_HALFOP(sub) +ADVSIMD_HALFOP(mul) +ADVSIMD_HALFOP(div) ADVSIMD_HALFOP(min) ADVSIMD_HALFOP(max) ADVSIMD_HALFOP(minnum)
target/arm/translate-a64.c +28 -0
@@ -10283,6 +10283,34 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)read_vec_element_i32 (s, tcg_op2, rm, pass,MO_16 );switch (fpopcode) { +case 0x0 :/* FMAXNM */ +gen_helper_advsimd_maxnumh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x2 :/* FADD */ +gen_helper_advsimd_addh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x6 :/* FMAX */ +gen_helper_advsimd_maxh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x8 :/* FMINNM */ +gen_helper_advsimd_minnumh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xa :/* FSUB */ +gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xe :/* FMIN */ +gen_helper_advsimd_minh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x13 :/* FMUL */ +gen_helper_advsimd_mulh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x17 :/* FDIV */ +gen_helper_advsimd_divh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x1a :/* FABD */ +gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst); +tcg_gen_andi_i32 (tcg_res, tcg_res,0x7fff ); +break ;default :fprintf (stderr,"%s: insn %#04x, fpop %#2x @ %#" PRIx64"\n" , __func__, insn, fpopcode, s->pc);
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 18/42] arm/translate-a64: add FP16 F[A]C[EQ/GE/GT] to simd_three_reg_same_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
These use the generic float16_compare functionality which in turn uses the common float_compare code from the softfloat re-factor.
Message-id: [email protected]
--- target/arm/helper-a64.h | 5 +++++ target/arm/helper-a64.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ target/arm/translate-a64.c | 15 ++++++++++++++ 3 files changed, 69 insertions(+)
target/arm/helper-a64.h +5 -0
@@ -56,3 +56,8 @@ DEF_HELPER_3(advsimd_addh, f16, f16, f16, ptr) DEF_HELPER_3(advsimd_subh, f16, f16, f16, ptr) DEF_HELPER_3(advsimd_mulh, f16, f16, f16, ptr) DEF_HELPER_3(advsimd_divh, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_ceq_f16, i32, f16, f16, ptr) +DEF_HELPER_3(advsimd_cge_f16, i32, f16, f16, ptr) +DEF_HELPER_3(advsimd_cgt_f16, i32, f16, f16, ptr) +DEF_HELPER_3(advsimd_acge_f16, i32, f16, f16, ptr) +DEF_HELPER_3 (advsimd_acgt_f16, i32, f16, f16, ptr)
target/arm/helper-a64.c +49 -0
52 lines not on this page · raw message
target/arm/translate-a64.c +15 -0
@@ -10289,6 +10289,9 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)case 0x2 :/* FADD */ gen_helper_advsimd_addh (tcg_res, tcg_op1, tcg_op2, fpst);break ; +case 0x4 :/* FCMEQ */ +gen_helper_advsimd_ceq_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ;case 0x6 :/* FMAX */ gen_helper_advsimd_maxh (tcg_res, tcg_op1, tcg_op2, fpst);break ;
@@ -10304,6 +10307,12 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)case 0x13 :/* FMUL */ gen_helper_advsimd_mulh (tcg_res, tcg_op1, tcg_op2, fpst);break ; +case 0x14 :/* FCMGE */ +gen_helper_advsimd_cge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x15 :/* FACGE */ +gen_helper_advsimd_acge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ;case 0x17 :/* FDIV */ gen_helper_advsimd_divh (tcg_res, tcg_op1, tcg_op2, fpst);break ;
@@ -10311,6 +10320,12 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst);tcg_gen_andi_i32 (tcg_res, tcg_res,0x7fff );break ; +case 0x1c :/* FCMGT */ +gen_helper_advsimd_cgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x1d :/* FACGT */ +gen_helper_advsimd_acgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ;default :fprintf (stderr,"%s: insn %#04x, fpop %#2x @ %#" PRIx64"\n" , __func__, insn, fpopcode, s->pc);
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 02/42] xilinx_spips: Enable only two slaves when reading/writing with stripe
In reply to Peter MaydellFrom: Francisco Iglesias <[email protected]>
Assert only the lower cs on bus 0 and upper cs on bus 1 when both buses and chip selects are enabled (e.g reading/writing with stripe).
Message-id: [email protected]
--- hw/ssi/xilinx_spips.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)
hw/ssi/xilinx_spips.c +37 -4
@@ -223,7 +223,7 @@ static void xilinx_spips_update_cs(XilinxSPIPS *s, int field) {int i; -for (i =0 ; i < s->num_cs; i++) { +for (i =0 ; i < s->num_cs * s->num_busses; i++) {bool old_state = s->cs_lines_state[i];bool new_state = field & (1 << i);
@@ -234,7 +234,7 @@ static void xilinx_spips_update_cs(XilinxSPIPS *s, int field) }qemu_set_irq (s->cs_lines[i], !new_state); } -if (!(field & ((1 << s->num_cs) -1 ))) { +if (!(field & ((1 << (s->num_cs * s->num_busses)) -1 ))) { s->snoop_state =SNOOP_CHECKING ; s->cmd_dummies =0 ; s->link_state =1 ;
@@ -248,7 +248,40 @@ static void xlnx_zynqmp_qspips_update_cs_lines(XlnxZynqMPQSPIPS *s) {if (s->regs[R_GQSPI_GF_SNAPSHOT ]) {int field =ARRAY_FIELD_EX32 (s->regs,GQSPI_GF_SNAPSHOT ,CHIP_SELECT ); -xilinx_spips_update_cs (XILINX_SPIPS (s), field); +bool upper_cs_sel = field & (1 <<1 ); +bool lower_cs_sel = field &1 ; +bool bus0_enabled; +bool bus1_enabled; +uint8_t buses; +int cs =0 ; + + buses =ARRAY_FIELD_EX32 (s->regs,GQSPI_GF_SNAPSHOT ,DATA_BUS_SELECT ); + bus0_enabled = buses &1 ; + bus1_enabled = buses & (1 <<1 ); + +if (bus0_enabled && bus1_enabled) { +if (lower_cs_sel) { + cs |=1 ; + } +if (upper_cs_sel) { + cs |=1 <<3 ; + } + }else if (bus0_enabled) { +if (lower_cs_sel) { + cs |=1 ; + } +if (upper_cs_sel) { + cs |=1 <<1 ; + } + }else if (bus1_enabled) { +if (lower_cs_sel) { + cs |=1 <<2 ; + } +if (upper_cs_sel) { + cs |=1 <<3 ; + } + } +xilinx_spips_update_cs (XILINX_SPIPS (s), cs); } }
@@ -260,7 +293,7 @@ static void xilinx_spips_update_cs_lines(XilinxSPIPS *s)if (num_effective_busses (s) ==2 ) {/* Single bit chip-select for qspi */ field &=0x1 ; - field |= field <<1 ; + field |= field <<3 ;/* Dual stack U-Page */ }else if (s->regs[R_LQSPI_CFG ] &LQSPI_CFG_TWO_MEM && s->regs[R_LQSPI_STS ] &LQSPI_CFG_U_PAGE ) {
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 19/42] arm/translate-a64: add FP16 FMULA/X/S to simd_three_reg_same_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Message-id: [email protected]
--- target/arm/helper-a64.h | 2 ++ target/arm/helper-a64.c | 24 ++++++++++++++++++++++++ target/arm/translate-a64.c | 15 +++++++++++++++ 3 files changed, 41 insertions(+)
target/arm/helper-a64.h +2 -0
@@ -61,3 +61,5 @@ DEF_HELPER_3(advsimd_cge_f16, i32, f16, f16, ptr) DEF_HELPER_3(advsimd_cgt_f16, i32, f16, f16, ptr) DEF_HELPER_3(advsimd_acge_f16, i32, f16, f16, ptr) DEF_HELPER_3(advsimd_acgt_f16, i32, f16, f16, ptr) +DEF_HELPER_3(advsimd_mulxh, f16, f16, f16, ptr) +DEF_HELPER_4 (advsimd_muladdh, f16, f16, f16, f16, ptr)
target/arm/helper-a64.c +24 -0
@@ -595,6 +595,30 @@ ADVSIMD_HALFOP(max)ADVSIMD_HALFOP (minnum)ADVSIMD_HALFOP (maxnum ) +/* Data processing - scalar floating-point and advanced SIMD */ +float16HELPER (advsimd_mulxh)(float16 a,float16 b,void *fpstp) +{ +float_status *fpst = fpstp; + + a =float16_squash_input_denormal (a, fpst); + b =float16_squash_input_denormal (b, fpst); + +if ((float16_is_zero (a) &&float16_is_infinity (b)) || + (float16_is_infinity (a) &&float16_is_zero (b))) { +/* 2.0 with the sign bit set to sign(A) XOR sign(B) */ +return make_float16 ((1U <<14 ) | + ((float16_val (a) ^float16_val (b)) & (1U <<15 ))); + } +return float16_mul (a, b, fpst); +} + +/* fused multiply-accumulate */ +float16 HELPER (advsimd_muladdh )(float16 a,float16 b,float16 c,void *fpstp) +{ +float_status *fpst = fpstp; +return float16_muladd (a, b, c,0 , fpst); +} +/* * Floating point comparisons produce an integer result. Softfloat * routines return float_relation types which we convert to the 0/-1
target/arm/translate-a64.c +15 -0
@@ -10286,9 +10286,17 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)case 0x0 :/* FMAXNM */ gen_helper_advsimd_maxnumh (tcg_res, tcg_op1, tcg_op2, fpst);break ; +case 0x1 :/* FMLA */ +read_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); +gen_helper_advsimd_muladdh (tcg_res, tcg_op1, tcg_op2, tcg_res, + fpst); +break ;case 0x2 :/* FADD */ gen_helper_advsimd_addh (tcg_res, tcg_op1, tcg_op2, fpst);break ; +case 0x3 :/* FMULX */ +gen_helper_advsimd_mulxh (tcg_res, tcg_op1, tcg_op2, fpst); +break ;case 0x4 :/* FCMEQ */ gen_helper_advsimd_ceq_f16 (tcg_res, tcg_op1, tcg_op2, fpst);break ;
@@ -10298,6 +10306,13 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)case 0x8 :/* FMINNM */ gen_helper_advsimd_minnumh (tcg_res, tcg_op1, tcg_op2, fpst);break ; +case 0x9 :/* FMLS */ +/* As usual for ARM, separate negation for fused multiply-add */ +tcg_gen_xori_i32 (tcg_op1, tcg_op1,0x8000 ); +read_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); +gen_helper_advsimd_muladdh (tcg_res, tcg_op1, tcg_op2, tcg_res, + fpst); +break ;case 0xa :/* FSUB */ gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst);break ;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 20/42] arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
As some of the constants here will also be needed
elsewhere (specifically for the upcoming SVE support) we move them out to softfloat.h.
Message-id: [email protected]
--- include/fpu/softfloat.h | 18 +++++++++++++----- target/arm/helper-a64.h | 2 ++ target/arm/helper-a64.c | 34 ++++++++++++++++++++++++++++++++++ target/arm/translate-a64.c | 6 ++++++ 4 files changed, 55 insertions(+), 5 deletions(-)
include/fpu/softfloat.h +13 -5
@@ -306,8 +306,11 @@ static inline float16 float16_set_sign(float16 a, int sign) }#define float16_zero make_float16(0) -#define float16_one make_float16(0x3c00)#define float16_half make_float16(0x3800) +#define float16_one make_float16(0x3c00) +#define float16_one_point_five make_float16(0x3e00) +#define float16_two make_float16(0x4000) +#define float16_three make_float16(0x4200)#define float16_infinity make_float16(0x7c00)/*----------------------------------------------------------------------------
@@ -415,11 +418,13 @@ static inline float32 float32_set_sign(float32 a, int sign) }#define float32_zero make_float32(0) -#define float32_one make_float32(0x3f800000)#define float32_half make_float32(0x3f000000) +#define float32_one make_float32(0x3f800000) +#define float32_one_point_five make_float32(0x3fc00000) +#define float32_two make_float32(0x40000000) +#define float32_three make_float32(0x40400000)#define float32_infinity make_float32(0x7f800000) -/*---------------------------------------------------------------------------- | The pattern for a default generated single-precision NaN. *----------------------------------------------------------------------------*/
@@ -526,9 +531,12 @@ static inline float64 float64_set_sign(float64 a, int sign) }#define float64_zero make_float64(0) -#define float64_one make_float64(0x3ff0000000000000LL) -#define float64_ln2 make_float64(0x3fe62e42fefa39efLL)#define float64_half make_float64(0x3fe0000000000000LL) +#define float64_one make_float64(0x3ff0000000000000LL) +#define float64_one_point_five make_float64(0x3FF8000000000000ULL) +#define float64_two make_float64(0x4000000000000000ULL) +#define float64_three make_float64(0x4008000000000000ULL) +#define float64_ln2 make_float64(0x3fe62e42fefa39efLL)#define float64_infinity make_float64(0x7ff0000000000000LL)/*----------------------------------------------------------------------------
target/arm/helper-a64.h +2 -0
@@ -29,8 +29,10 @@ DEF_HELPER_FLAGS_3(vfp_mulxd, TCG_CALL_NO_RWG, f64, f64, f64, ptr) DEF_HELPER_FLAGS_3(neon_ceq_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) DEF_HELPER_FLAGS_3(neon_cge_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) DEF_HELPER_FLAGS_3(neon_cgt_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) +DEF_HELPER_FLAGS_3(recpsf_f16, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(recpsf_f32, TCG_CALL_NO_RWG, f32, f32, f32, ptr) DEF_HELPER_FLAGS_3(recpsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr) +DEF_HELPER_FLAGS_3(rsqrtsf_f16, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f32, TCG_CALL_NO_RWG, f32, f32, f32, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr)DEF_HELPER_FLAGS_1 (neon_addlp_s8,TCG_CALL_NO_RWG_SE , i64, i64)
target/arm/helper-a64.c +34 -0
@@ -192,6 +192,10 @@ uint64_t HELPER(neon_cgt_f64)(float64 a, float64 b, void *fpstp)* versions, these do a fully fused multiply-add or * multiply-add-and-halve. */ +#define float16_two make_float16(0x4000) +#define float16_three make_float16(0x4200) +#define float16_one_point_five make_float16(0x3e00) +#define float32_two make_float32(0x40000000)#define float32_three make_float32(0x40400000)#define float32_one_point_five make_float32(0x3fc00000)
@@ -200,6 +204,21 @@ uint64_t HELPER(neon_cgt_f64)(float64 a, float64 b, void *fpstp)#define float64_three make_float64(0x4008000000000000ULL)#define float64_one_point_five make_float64(0x3FF8000000000000ULL) +float16 HELPER (recpsf_f16 )(float16 a,float16 b,void *fpstp) +{ +float_status *fpst = fpstp; + + a =float16_squash_input_denormal (a, fpst); + b =float16_squash_input_denormal (b, fpst); + + a =float16_chs (a); +if ((float16_is_infinity (a) &&float16_is_zero (b)) || + (float16_is_infinity (b) &&float16_is_zero (a))) { +return float16_two; + } +return float16_muladd (a, b, float16_two,0 , fpst); +} +float32 HELPER (recpsf_f32 )(float32 a,float32 b,void *fpstp) {float_status *fpst = fpstp;
@@ -230,6 +249,21 @@ float64 HELPER(recpsf_f64)(float64 a, float64 b, void *fpstp)return float64_muladd (a, b, float64_two,0 , fpst); } +float16 HELPER (rsqrtsf_f16 )(float16 a,float16 b,void *fpstp) +{ +float_status *fpst = fpstp; + + a =float16_squash_input_denormal (a, fpst); + b =float16_squash_input_denormal (b, fpst); + + a =float16_chs (a); +if ((float16_is_infinity (a) &&float16_is_zero (b)) || + (float16_is_infinity (b) &&float16_is_zero (a))) { +return float16_one_point_five; + } +return float16_muladd (a, b, float16_three, float_muladd_halve_result, fpst); +} +float32 HELPER (rsqrtsf_f32 )(float32 a,float32 b,void *fpstp) {float_status *fpst = fpstp;
target/arm/translate-a64.c +6 -0
@@ -10303,6 +10303,9 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)case 0x6 :/* FMAX */ gen_helper_advsimd_maxh (tcg_res, tcg_op1, tcg_op2, fpst);break ; +case 0x7 :/* FRECPS */ +gen_helper_recpsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ;case 0x8 :/* FMINNM */ gen_helper_advsimd_minnumh (tcg_res, tcg_op1, tcg_op2, fpst);break ;
@@ -10319,6 +10322,9 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)case 0xe :/* FMIN */ gen_helper_advsimd_minh (tcg_res, tcg_op1, tcg_op2, fpst);break ; +case 0xf :/* FRSQRTS */ +gen_helper_rsqrtsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ;case 0x13 :/* FMUL */ gen_helper_advsimd_mulh (tcg_res, tcg_op1, tcg_op2, fpst);break ;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 11/42] target/arm/cpu.h: update comment for half-precision values
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Message-id: [email protected]
--- target/arm/cpu.h | 1 + 1 file changed, 1 insertion(+)
target/arm/cpu.h +1 -0
@@ -168,6 +168,7 @@ typedef struct {* Qn = regs[n].d[1]:regs[n].d[0] * Dn = regs[n].d[0] * Sn = regs[n].d[0] bits 31..0 +* Hn = regs[n].d[0] bits 15..0 * * This corresponds to the architecturally defined mapping between * the two execution states, and means we do not need to explicitly
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 21/42] arm/translate-a64: add FP16 pairwise ops simd_three_reg_same_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This includes FMAXNMP, FADDP, FMAXP, FMINNMP, FMINP.
Message-id: [email protected]
--- target/arm/translate-a64.c | 208 +++++++++++++++++++++++++++++---------------- 1 file changed, 133 insertions(+), 75 deletions(-)
target/arm/translate-a64.c +133 -75
@@ -10247,6 +10247,7 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)int datasize, elements;int pass;TCGv_ptr fpst; +bool pairwise = false;if (!arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) {unallocated_encoding (s);
@@ -10272,91 +10273,148 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn) datasize = is_q ?128 :64 ; elements = datasize /16 ; +switch (fpopcode) { +case 0x10 :/* FMAXNMP */ +case 0x12 :/* FADDP */ +case 0x16 :/* FMAXP */ +case 0x18 :/* FMINNMP */ +case 0x1e :/* FMINP */ + pairwise = true; +break ; + } + fpst =get_fpstatus_ptr (true); -for (pass =0 ; pass < elements; pass++) { +if (pairwise) { +int maxpass = is_q ?8 :4 ;TCGv_i32 tcg_op1 =tcg_temp_new_i32 ();TCGv_i32 tcg_op2 =tcg_temp_new_i32 (); -TCGv_i32 tcg_res =tcg_temp_new_i32 (); +TCGv_i32 tcg_res[8 ]; -read_vec_element_i32 (s, tcg_op1, rn, pass,MO_16 ); -read_vec_element_i32 (s, tcg_op2, rm, pass,MO_16 ); +for (pass =0 ; pass < maxpass; pass++) { +int passreg = pass < (maxpass /2 ) ? rn : rm; +int passelt = (pass <<1 ) & (maxpass -1 ); -switch (fpopcode) { -case 0x0 :/* FMAXNM */ -gen_helper_advsimd_maxnumh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x1 :/* FMLA */ -read_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); -gen_helper_advsimd_muladdh (tcg_res, tcg_op1, tcg_op2, tcg_res, - fpst); -break ; -case 0x2 :/* FADD */ -gen_helper_advsimd_addh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x3 :/* FMULX */ -gen_helper_advsimd_mulxh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x4 :/* FCMEQ */ -gen_helper_advsimd_ceq_f16 (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x6 :/* FMAX */ -gen_helper_advsimd_maxh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x7 :/* FRECPS */ -gen_helper_recpsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x8 :/* FMINNM */ -gen_helper_advsimd_minnumh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x9 :/* FMLS */ -/* As usual for ARM, separate negation for fused multiply-add */ -tcg_gen_xori_i32 (tcg_op1, tcg_op1,0x8000 ); -read_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); -gen_helper_advsimd_muladdh (tcg_res, tcg_op1, tcg_op2, tcg_res, - fpst); -break ; -case 0xa :/* FSUB */ -gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0xe :/* FMIN */ -gen_helper_advsimd_minh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0xf :/* FRSQRTS */ -gen_helper_rsqrtsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x13 :/* FMUL */ -gen_helper_advsimd_mulh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x14 :/* FCMGE */ -gen_helper_advsimd_cge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x15 :/* FACGE */ -gen_helper_advsimd_acge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x17 :/* FDIV */ -gen_helper_advsimd_divh (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x1a :/* FABD */ -gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst); -tcg_gen_andi_i32 (tcg_res, tcg_res,0x7fff ); -break ; -case 0x1c :/* FCMGT */ -gen_helper_advsimd_cgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x1d :/* FACGT */ -gen_helper_advsimd_acgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -default : -fprintf (stderr,"%s: insn %#04x, fpop %#2x @ %#" PRIx64"\n" , - __func__, insn, fpopcode, s->pc); -g_assert_not_reached (); +read_vec_element_i32 (s, tcg_op1, passreg, passelt,MO_16 ); +read_vec_element_i32 (s, tcg_op2, passreg, passelt +1 ,MO_16 ); + tcg_res[pass] =tcg_temp_new_i32 (); + +switch (fpopcode) { +case 0x10 :/* FMAXNMP */ +gen_helper_advsimd_maxnumh (tcg_res[pass], tcg_op1, tcg_op2, + fpst); +break ; +case 0x12 :/* FADDP */ +gen_helper_advsimd_addh (tcg_res[pass], tcg_op1, tcg_op2, fpst); +break ; +case 0x16 :/* FMAXP */ +gen_helper_advsimd_maxh (tcg_res[pass], tcg_op1, tcg_op2, fpst); +break ; +case 0x18 :/* FMINNMP */ +gen_helper_advsimd_minnumh (tcg_res[pass], tcg_op1, tcg_op2, + fpst); +break ; +case 0x1e :/* FMINP */ +gen_helper_advsimd_minh (tcg_res[pass], tcg_op1, tcg_op2, fpst); +break ; +default : +g_assert_not_reached (); + } + } + +for (pass =0 ; pass < maxpass; pass++) { +write_vec_element_i32 (s, tcg_res[pass], rd, pass,MO_16 ); +tcg_temp_free_i32 (tcg_res[pass]); } -write_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); -tcg_temp_free_i32 (tcg_res);tcg_temp_free_i32 (tcg_op1);tcg_temp_free_i32 (tcg_op2); + + }else { +for (pass =0 ; pass < elements; pass++) { +TCGv_i32 tcg_op1 =tcg_temp_new_i32 (); +TCGv_i32 tcg_op2 =tcg_temp_new_i32 (); +TCGv_i32 tcg_res =tcg_temp_new_i32 (); + +read_vec_element_i32 (s, tcg_op1, rn, pass,MO_16 ); +read_vec_element_i32 (s, tcg_op2, rm, pass,MO_16 ); + +switch (fpopcode) { +case 0x0 :/* FMAXNM */ +gen_helper_advsimd_maxnumh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x1 :/* FMLA */ +read_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); +gen_helper_advsimd_muladdh (tcg_res, tcg_op1, tcg_op2, tcg_res, + fpst); +break ; +case 0x2 :/* FADD */ +gen_helper_advsimd_addh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x3 :/* FMULX */ +gen_helper_advsimd_mulxh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x4 :/* FCMEQ */ +gen_helper_advsimd_ceq_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x6 :/* FMAX */ +gen_helper_advsimd_maxh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x7 :/* FRECPS */ +gen_helper_recpsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x8 :/* FMINNM */ +gen_helper_advsimd_minnumh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x9 :/* FMLS */ +/* As usual for ARM, separate negation for fused multiply-add */ +tcg_gen_xori_i32 (tcg_op1, tcg_op1,0x8000 ); +read_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); +gen_helper_advsimd_muladdh (tcg_res, tcg_op1, tcg_op2, tcg_res, + fpst); +break ; +case 0xa :/* FSUB */ +gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xe :/* FMIN */ +gen_helper_advsimd_minh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xf :/* FRSQRTS */ +gen_helper_rsqrtsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x13 :/* FMUL */ +gen_helper_advsimd_mulh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x14 :/* FCMGE */ +gen_helper_advsimd_cge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x15 :/* FACGE */ +gen_helper_advsimd_acge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x17 :/* FDIV */ +gen_helper_advsimd_divh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x1a :/* FABD */ +gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst); +tcg_gen_andi_i32 (tcg_res, tcg_res,0x7fff ); +break ; +case 0x1c :/* FCMGT */ +gen_helper_advsimd_cgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x1d :/* FACGT */ +gen_helper_advsimd_acgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +default : +fprintf (stderr,"%s: insn %#04x, fpop %#2x @ %#" PRIx64"\n" , + __func__, insn, fpopcode, s->pc); +g_assert_not_reached (); + } + +write_vec_element_i32 (s, tcg_res, rd, pass,MO_16 ); +tcg_temp_free_i32 (tcg_res); +tcg_temp_free_i32 (tcg_op1); +tcg_temp_free_i32 (tcg_op2); + } }tcg_temp_free_ptr (fpst);
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 22/42] arm/translate-a64: add FP16 FMULX/MLS/FMLA to simd_indexed
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
The helpers use the new re-factored muladd support in SoftFloat for the float16 work.
Message-id: [email protected]
--- target/arm/translate-a64.c | 82 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 16 deletions(-)
target/arm/translate-a64.c +66 -16
@@ -11198,6 +11198,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)int rd =extract32 (insn,0 ,5 );bool is_long = false;bool is_fp = false; +bool is_fp16 = false;int index;TCGv_ptr fpst;
@@ -11244,7 +11245,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) }/* fall through */ case 0x9 :/* FMUL, FMULX */ -if (!extract32 (size,1 ,1 )) { +if (size ==1 ) {unallocated_encoding (s);return ; }
@@ -11256,18 +11257,34 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) }if (is_fp) { -/* low bit of size indicates single/double */ - size =extract32 (size,0 ,1 ) ?3 :2 ; -if (size ==2 ) { +/* convert insn encoded size to TCGMemOp size */ +switch (size) { +case 2 :/* single precision */ + size =MO_32 ; index = h <<1 | l; - }else { + rm |= (m <<4 ); +break ; +case 3 :/* double precision */ + size =MO_64 ;if (l || !is_q) {unallocated_encoding (s);return ; } index = h; + rm |= (m <<4 ); +break ; +case 0 :/* half precision */ + size =MO_16 ; + index = h <<2 | l <<1 | m; + is_fp16 = true; +if (arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) { +break ; + } +/* fallthru */ +default :/* unallocated */ +unallocated_encoding (s); +return ; } - rm |= (m <<4 ); }else {switch (size) {case 1 :
@@ -11288,7 +11305,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) }if (is_fp) { - fpst =get_fpstatus_ptr (false); + fpst =get_fpstatus_ptr (is_fp16); }else { fpst =NULL ; }
@@ -11390,18 +11407,51 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)break ; }case 0x5 :/* FMLS */ -/* As usual for ARM, separate negation for fused multiply-add */ -gen_helper_vfp_negs (tcg_op, tcg_op); -/* fall through */ case 0x1 :/* FMLA */ -read_vec_element_i32 (s, tcg_res, rd, pass,MO_32 ); -gen_helper_vfp_muladds (tcg_res, tcg_op, tcg_idx, tcg_res, fpst); +read_vec_element_i32 (s, tcg_res, rd, pass, + is_scalar ? size :MO_32 ); +switch (size) { +case 1 : +if (opcode ==0x5 ) { +/* As usual for ARM, separate negation for fused +* multiply-add */ +tcg_gen_xori_i32 (tcg_op, tcg_op,0x80008000 ); + } +gen_helper_advsimd_muladdh (tcg_res, tcg_op, tcg_idx, + tcg_res, fpst); +break ; +case 2 : +if (opcode ==0x5 ) { +/* As usual for ARM, separate negation for +* fused multiply-add */ +tcg_gen_xori_i32 (tcg_op, tcg_op,0x80000000 ); + } +gen_helper_vfp_muladds (tcg_res, tcg_op, tcg_idx, + tcg_res, fpst); +break ; +default : +g_assert_not_reached (); + }break ;case 0x9 :/* FMUL, FMULX */ -if (u) { -gen_helper_vfp_mulxs (tcg_res, tcg_op, tcg_idx, fpst); - }else { -gen_helper_vfp_muls (tcg_res, tcg_op, tcg_idx, fpst); +switch (size) { +case 1 : +if (u) { +gen_helper_advsimd_mulxh (tcg_res, tcg_op, tcg_idx, + fpst); + }else { +g_assert_not_reached (); + } +break ; +case 2 : +if (u) { +gen_helper_vfp_mulxs (tcg_res, tcg_op, tcg_idx, fpst); + }else { +gen_helper_vfp_muls (tcg_res, tcg_op, tcg_idx, fpst); + } +break ; +default : +g_assert_not_reached (); }break ;case 0xc :/* SQDMULH */
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 23/42] arm/translate-a64: add FP16 x2 ops for simd_indexed
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
A bunch of the vectorised bitwise operations just operate on larger chunks at a time. We can do the same for the new half-precision operations by introducing some TWOHALFOP helpers which work on each half of a pair of half-precision operations at once.
Hopefully all this hoop jumping will get simpler once we have generically vectorised helpers here.
Message-id: [email protected]
--- target/arm/helper-a64.h | 10 ++++++++++ target/arm/helper-a64.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- target/arm/translate-a64.c | 26 +++++++++++++++++++++----- 3 files changed, 76 insertions(+), 6 deletions(-)
target/arm/helper-a64.h +10 -0
@@ -65,3 +65,13 @@ DEF_HELPER_3(advsimd_acge_f16, i32, f16, f16, ptr) DEF_HELPER_3(advsimd_acgt_f16, i32, f16, f16, ptr) DEF_HELPER_3(advsimd_mulxh, f16, f16, f16, ptr) DEF_HELPER_4(advsimd_muladdh, f16, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_add2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_sub2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_mul2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_div2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_max2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_min2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_maxnum2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_minnum2h, i32, i32, i32, ptr) +DEF_HELPER_3(advsimd_mulx2h, i32, i32, i32, ptr) +DEF_HELPER_4 (advsimd_muladd2h, i32, i32, i32, i32, ptr)
target/arm/helper-a64.c +45 -1
65 lines not on this page · raw message
target/arm/translate-a64.c +21 -5
@@ -11417,8 +11417,13 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)* multiply-add */ tcg_gen_xori_i32 (tcg_op, tcg_op,0x80008000 ); } -gen_helper_advsimd_muladdh (tcg_res, tcg_op, tcg_idx, - tcg_res, fpst); +if (is_scalar) { +gen_helper_advsimd_muladdh (tcg_res, tcg_op, tcg_idx, + tcg_res, fpst); + }else { +gen_helper_advsimd_muladd2h (tcg_res, tcg_op, tcg_idx, + tcg_res, fpst); + }break ;case 2 :if (opcode ==0x5 ) {
@@ -11437,10 +11442,21 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)switch (size) {case 1 :if (u) { -gen_helper_advsimd_mulxh (tcg_res, tcg_op, tcg_idx, - fpst); +if (is_scalar) { +gen_helper_advsimd_mulxh (tcg_res, tcg_op, + tcg_idx, fpst); + }else { +gen_helper_advsimd_mulx2h (tcg_res, tcg_op, + tcg_idx, fpst); + } }else { -g_assert_not_reached (); +if (is_scalar) { +gen_helper_advsimd_mulh (tcg_res, tcg_op, + tcg_idx, fpst); + }else { +gen_helper_advsimd_mul2h (tcg_res, tcg_op, + tcg_idx, fpst); + } }break ;case 2 :
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 24/42] arm/translate-a64: initial decode for simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This actually covers two different sections of the encoding table:
Advanced SIMD scalar two-register miscellaneous FP16 Advanced SIMD two-register miscellaneous (FP16)
The difference between the two is covered by a combination of Q (bit
30) and S (bit 28). Notably the FRINTx instructions are only available in the vector form.
This is just the decode skeleton which will be filled out by later patches.
Message-id: [email protected]
--- target/arm/translate-a64.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
target/arm/translate-a64.c +40 -0
@@ -11164,6 +11164,45 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } } +/* AdvSIMD [scalar] two register miscellaneous (FP16) +* +* 31 30 29 28 27 24 23 22 21 17 16 12 11 10 9 5 4 0 +* +---+---+---+---+---------+---+-------------+--------+-----+------+------+ +* | 0 | Q | U | S | 1 1 1 0 | a | 1 1 1 1 0 0 | opcode | 1 0 | Rn | Rd | +* +---+---+---+---+---------+---+-------------+--------+-----+------+------+ +* mask: 1000 1111 0111 1110 0000 1100 0000 0000 0x8f7e 0c00 +* val: 0000 1110 0111 1000 0000 1000 0000 0000 0x0e78 0800 +* +* This actually covers two groups where scalar access is governed by +* bit 28. A bunch of the instructions (float to integral) only exist +* in the vector form and are un-allocated for the scalar decode. Also +* in the scalar decode Q is always 1. +*/ +static void disas_simd_two_reg_misc_fp16 (DisasContext *s,uint32_t insn) +{ +int fpop, opcode, a; + +if (!arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) { +unallocated_encoding (s); +return ; + } + +if (!fp_access_check (s)) { +return ; + } + + opcode =extract32 (insn,12 ,4 ); + a =extract32 (insn,23 ,1 ); + fpop =deposit32 (opcode,5 ,1 , a); + +switch (fpop) { +default : +fprintf (stderr,"%s: insn %#04x fpop %#2x\n" , __func__, insn, fpop); +g_assert_not_reached (); + } + +} +/* AdvSIMD scalar x indexed element * 31 30 29 28 24 23 22 21 20 19 16 15 12 11 10 9 5 4 0 * +-----+---+-----------+------+---+---+------+-----+---+---+------+------+
@@ -12236,6 +12275,7 @@ static const AArch64DecodeTable data_proc_simd[] = { { 0xce800000, 0xffe00000, disas_crypto_xar }, { 0xce408000, 0xffe0c000, disas_crypto_three_reg_imm2 }, { 0x0e400400, 0x9f60c400, disas_simd_three_reg_same_fp16 }, + { 0x0e780800, 0x8f7e0c00, disas_simd_two_reg_misc_fp16 }, { 0x00000000, 0x00000000, NULL } };
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 01/42] hw: register: Run post_write hook on reset
In reply to Peter MaydellFrom: Alistair Francis <[email protected]>
Ensure that the post write hook is called during reset. This allows us to rely on the post write functions instead of having to call them from the reset() function.
Message-id: d131e24b911653a945e46ca2d8f90f572469e1dd.1517856214.git.alistair.francis@xilinx.com
--- include/hw/register.h | 6 +++--- hw/core/register.c | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-)
include/hw/register.h +3 -3
@@ -34,7 +34,7 @@ typedef struct RegisterInfoArray RegisterInfoArray;* immediately before the actual write. The returned value is what is written, * giving the handler a chance to modify the written value. * @post_write: Post write callback. Passed the written value. Most write side -* effects should be implemented here. +* effects should be implemented here. This is called during device reset. * * @post_read: Post read callback. Passes the value that is about to be returned * for a read. The return value from this function is what is ultimately read,
@@ -135,8 +135,8 @@ uint64_t register_read(RegisterInfo *reg, uint64_t re, const char* prefix, bool debug);/** -* reset a register -* @reg: register to reset +* Resets a register. This will also call the post_write hook if it exists. +* @reg: The register to reset. */ void register_reset (RegisterInfo *reg);
hw/core/register.c +8 -0
@@ -159,13 +159,21 @@ uint64_t register_read(RegisterInfo *reg, uint64_t re, const char* prefix,void register_reset (RegisterInfo *reg) { +const RegisterAccessInfo *ac; +g_assert (reg);if (!reg->data || !reg->access) {return ; } + ac = reg->access; +register_write_val (reg, reg->access->reset); + +if (ac->post_write) { + ac->post_write (reg, reg->access->reset); + } }void register_init (RegisterInfo *reg)
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 25/42] arm/translate-a64: add FP16 FPRINTx to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This adds the full range of half-precision floating point to integral instructions.
Message-id: [email protected]
--- target/arm/helper-a64.h | 2 + target/arm/helper-a64.c | 22 ++++++++ target/arm/translate-a64.c | 123 +++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 142 insertions(+), 5 deletions(-)
target/arm/helper-a64.h +2 -0
@@ -75,3 +75,5 @@ DEF_HELPER_3(advsimd_maxnum2h, i32, i32, i32, ptr) DEF_HELPER_3(advsimd_minnum2h, i32, i32, i32, ptr) DEF_HELPER_3(advsimd_mulx2h, i32, i32, i32, ptr) DEF_HELPER_4(advsimd_muladd2h, i32, i32, i32, i32, ptr) +DEF_HELPER_2(advsimd_rinth_exact, f16, f16, ptr) +DEF_HELPER_2 (advsimd_rinth, f16, f16, ptr)
target/arm/helper-a64.c +22 -0
@@ -745,3 +745,25 @@ uint32_t HELPER(advsimd_acgt_f16)(float16 a, float16 b, void *fpstp)int compare =float16_compare (f0, f1, fpst);return ADVSIMD_CMPRES (compare == float_relation_greater); } + +/* round to integral */ +float16 HELPER (advsimd_rinth_exact )(float16 x,void *fp_status) +{ +return float16_round_to_int (x, fp_status); +} + +float16 HELPER (advsimd_rinth )(float16 x,void *fp_status) +{ +int old_flags =get_float_exception_flags (fp_status), new_flags; +float16 ret; + + ret =float16_round_to_int (x, fp_status); + +/* Suppress any inexact exceptions the conversion produced */ +if (!(old_flags & float_flag_inexact)) { + new_flags =get_float_exception_flags (fp_status); +set_float_exception_flags (new_flags & ~float_flag_inexact, fp_status); + } + +return ret; +}
target/arm/translate-a64.c +118 -5
145 lines not on this page · raw message
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 26/42] arm/translate-a64: add FCVTxx to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This covers all the floating point convert operations.
Message-id: [email protected]
--- target/arm/helper-a64.h | 2 ++ target/arm/helper-a64.c | 32 +++++++++++++++++ target/arm/translate-a64.c | 85 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 118 insertions(+), 1 deletion(-)
target/arm/helper-a64.h +2 -0
@@ -77,3 +77,5 @@ DEF_HELPER_3(advsimd_mulx2h, i32, i32, i32, ptr) DEF_HELPER_4(advsimd_muladd2h, i32, i32, i32, i32, ptr) DEF_HELPER_2(advsimd_rinth_exact, f16, f16, ptr) DEF_HELPER_2(advsimd_rinth, f16, f16, ptr) +DEF_HELPER_2(advsimd_f16tosinth, i32, f16, ptr) +DEF_HELPER_2 (advsimd_f16touinth, i32, f16, ptr)
target/arm/helper-a64.c +32 -0
@@ -767,3 +767,35 @@ float16 HELPER(advsimd_rinth)(float16 x, void *fp_status)return ret; } + +/* +* Half-precision floating point conversion functions +* +* There are a multitude of conversion functions with various +* different rounding modes. This is dealt with by the calling code +* setting the mode appropriately before calling the helper. +*/ + +uint32_t HELPER (advsimd_f16tosinth )(float16 a,void *fpstp) +{ +float_status *fpst = fpstp; + +/* Invalid if we are passed a NaN */ +if (float16_is_any_nan (a)) { +float_raise (float_flag_invalid, fpst); +return 0 ; + } +return float16_to_int16 (a, fpst); +} + +uint32_t HELPER (advsimd_f16touinth )(float16 a,void *fpstp) +{ +float_status *fpst = fpstp; + +/* Invalid if we are passed a NaN */ +if (float16_is_any_nan (a)) { +float_raise (float_flag_invalid, fpst); +return 0 ; + } +return float16_to_uint16 (a, fpst); +}
target/arm/translate-a64.c +84 -1
103 lines not on this page · raw message
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 27/42] arm/translate-a64: add FP16 FCMxx (zero) to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
I re-use the existing handle_2misc_fcmp_zero handler and tweak it slightly to deal with the half-precision case.
Message-id: [email protected]
--- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 23 deletions(-)
target/arm/translate-a64.c +57 -23
@@ -7821,14 +7821,14 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode, bool is_scalar, bool is_u, bool is_q, int size, int rn, int rd) { - bool is_double = (size == 3); + bool is_double = (size == MO_64);TCGv_ptr fpst;if (!fp_access_check (s)) {return ; } - fpst =get_fpstatus_ptr (false); + fpst =get_fpstatus_ptr (size ==MO_16 );if (is_double) {TCGv_i64 tcg_op =tcg_temp_new_i64 ();
@@ -7880,34 +7880,57 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,bool swap = false;int pass, maxpasses; -switch (opcode) { -case 0x2e :/* FCMLT (zero) */ - swap = true; -/* fall through */ -case 0x2c :/* FCMGT (zero) */ - genfn = gen_helper_neon_cgt_f32; -break ; -case 0x2d :/* FCMEQ (zero) */ - genfn = gen_helper_neon_ceq_f32; -break ; -case 0x6d :/* FCMLE (zero) */ - swap = true; -/* fall through */ -case 0x6c :/* FCMGE (zero) */ - genfn = gen_helper_neon_cge_f32; -break ; -default : -g_assert_not_reached (); +if (size ==MO_16 ) { +switch (opcode) { +case 0x2e :/* FCMLT (zero) */ + swap = true; +/* fall through */ +case 0x2c :/* FCMGT (zero) */ + genfn = gen_helper_advsimd_cgt_f16; +break ; +case 0x2d :/* FCMEQ (zero) */ + genfn = gen_helper_advsimd_ceq_f16; +break ; +case 0x6d :/* FCMLE (zero) */ + swap = true; +/* fall through */ +case 0x6c :/* FCMGE (zero) */ + genfn = gen_helper_advsimd_cge_f16; +break ; +default : +g_assert_not_reached (); + } + }else { +switch (opcode) { +case 0x2e :/* FCMLT (zero) */ + swap = true; +/* fall through */ +case 0x2c :/* FCMGT (zero) */ + genfn = gen_helper_neon_cgt_f32; +break ; +case 0x2d :/* FCMEQ (zero) */ + genfn = gen_helper_neon_ceq_f32; +break ; +case 0x6d :/* FCMLE (zero) */ + swap = true; +/* fall through */ +case 0x6c :/* FCMGE (zero) */ + genfn = gen_helper_neon_cge_f32; +break ; +default : +g_assert_not_reached (); + } }if (is_scalar) { maxpasses =1 ; }else { - maxpasses = is_q ?4 :2 ; +int vector_size =8 << is_q; + maxpasses = vector_size >> size; }for (pass =0 ; pass < maxpasses; pass++) { -read_vec_element_i32 (s, tcg_op, rn, pass,MO_32 ); +read_vec_element_i32 (s, tcg_op, rn, pass, size);if (swap) {genfn (tcg_res, tcg_zero, tcg_op, fpst); }else {
@@ -7916,7 +7939,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,if (is_scalar) {write_fp_sreg (s, rd, tcg_res); }else { -write_vec_element_i32 (s, tcg_res, rd, pass,MO_32 ); +write_vec_element_i32 (s, tcg_res, rd, pass, size); } }tcg_temp_free_i32 (tcg_res);
@@ -11209,7 +11232,18 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) fpop =deposit32 (opcode,5 ,1 , a); fpop =deposit32 (fpop,6 ,1 , u); + rd =extract32 (insn,0 ,5 ); + rn =extract32 (insn,5 ,5 ); +switch (fpop) { +break ; +case 0x2c :/* FCMGT (zero) */ +case 0x2d :/* FCMEQ (zero) */ +case 0x2e :/* FCMLT (zero) */ +case 0x6c :/* FCMGE (zero) */ +case 0x6d :/* FCMLE (zero) */ +handle_2misc_fcmp_zero (s, fpop, is_scalar,0 , is_q,MO_16 , rn, rd); +return ;case 0x18 :/* FRINTN */ need_rmode = true; only_in_vector = true;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 29/42] arm/translate-a64: add FP16 FNEG/FABS to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Neither of these operations alter the floating point status registers so we can do a pure bitwise operation, either squashing any sign bit (ABS) or inverting it (NEG).
Message-id: [email protected]
--- target/arm/translate-a64.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
target/arm/translate-a64.c +15 -1
@@ -11262,6 +11262,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)TCGv_i32 tcg_rmode =NULL ;TCGv_ptr tcg_fpstatus =NULL ;bool need_rmode = false; +bool need_fpst = true;int rmode;if (!arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) {
@@ -11380,6 +11381,10 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) need_rmode = true; rmode =FPROUNDING_ZERO ;break ; +case 0x2f :/* FABS */ +case 0x6f :/* FNEG */ + need_fpst = false; +break ;default :fprintf (stderr,"%s: insn %#04x fpop %#2x\n" , __func__, insn, fpop);g_assert_not_reached ();
@@ -11403,7 +11408,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)return ; } -if (need_rmode) { +if (need_rmode || need_fpst) { tcg_fpstatus =get_fpstatus_ptr (true); }
@@ -11433,6 +11438,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x7b :/* FCVTZU */ gen_helper_advsimd_f16touinth (tcg_res, tcg_op, tcg_fpstatus);break ; +case 0x6f :/* FNEG */ +tcg_gen_xori_i32 (tcg_res, tcg_op,0x8000 ); +break ;default :g_assert_not_reached (); }
@@ -11476,6 +11484,12 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x59 :/* FRINTX */ gen_helper_advsimd_rinth_exact (tcg_res, tcg_op, tcg_fpstatus);break ; +case 0x2f :/* FABS */ +tcg_gen_andi_i32 (tcg_res, tcg_op,0x7fff ); +break ; +case 0x6f :/* FNEG */ +tcg_gen_xori_i32 (tcg_res, tcg_op,0x8000 ); +break ;default :g_assert_not_reached (); }
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 31/42] arm/translate-a64: add FP16 FRECPE
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Now we have added f16 during the re-factoring we can simply call the helper.
Message-id: [email protected]
--- target/arm/translate-a64.c | 8 ++++++++ 1 file changed, 8 insertions(+)
target/arm/translate-a64.c +8 -0
@@ -11311,6 +11311,8 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x6d :/* FCMLE (zero) */ handle_2misc_fcmp_zero (s, fpop, is_scalar,0 , is_q,MO_16 , rn, rd);return ; +case 0x3d :/* FRECPE */ +break ;case 0x18 :/* FRINTN */ need_rmode = true; only_in_vector = true;
@@ -11431,6 +11433,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x3b :/* FCVTZS */ gen_helper_advsimd_f16tosinth (tcg_res, tcg_op, tcg_fpstatus);break ; +case 0x3d :/* FRECPE */ +gen_helper_recpe_f16 (tcg_res, tcg_op, tcg_fpstatus); +break ;case 0x5a :/* FCVTNU */ case 0x5b :/* FCVTMU */ case 0x5c :/* FCVTAU */
@@ -11466,6 +11471,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x3b :/* FCVTZS */ gen_helper_advsimd_f16tosinth (tcg_res, tcg_op, tcg_fpstatus);break ; +case 0x3d :/* FRECPE */ +gen_helper_recpe_f16 (tcg_res, tcg_op, tcg_fpstatus); +break ;case 0x5a :/* FCVTNU */ case 0x5b :/* FCVTMU */ case 0x5c :/* FCVTAU */
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 32/42] arm/translate-a64: add FP16 FRCPX to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
We go with the localised helper.
Message-id: [email protected]
--- target/arm/helper-a64.h | 1 + target/arm/helper-a64.c | 29 +++++++++++++++++++++++++++++ target/arm/translate-a64.c | 4 ++++ 3 files changed, 34 insertions(+)
target/arm/helper-a64.h +1 -0
@@ -41,6 +41,7 @@ DEF_HELPER_FLAGS_1(neon_addlp_s16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_u16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_2(frecpx_f64, TCG_CALL_NO_RWG, f64, f64, ptr) DEF_HELPER_FLAGS_2(frecpx_f32, TCG_CALL_NO_RWG, f32, f32, ptr) +DEF_HELPER_FLAGS_2(frecpx_f16, TCG_CALL_NO_RWG, f16, f16, ptr) DEF_HELPER_FLAGS_2(fcvtx_f64_to_f32, TCG_CALL_NO_RWG, f32, f64, env) DEF_HELPER_FLAGS_3(crc32_64, TCG_CALL_NO_RWG_SE, i64, i64, i64, i32)DEF_HELPER_FLAGS_3 (crc32c_64,TCG_CALL_NO_RWG_SE , i64, i64, i64, i32)
target/arm/helper-a64.c +29 -0
@@ -356,6 +356,35 @@ uint64_t HELPER(neon_addlp_u16)(uint64_t a) }/* Floating-point reciprocal exponent - see FPRecpX in ARM ARM */ +float16 HELPER (frecpx_f16 )(float16 a,void *fpstp) +{ +float_status *fpst = fpstp; +uint16_t val16, sbit; +int16_t exp; + +if (float16_is_any_nan (a)) { +float16 nan = a; +if (float16_is_signaling_nan (a, fpst)) { +float_raise (float_flag_invalid, fpst); + nan =float16_maybe_silence_nan (a, fpst); + } +if (fpst->default_nan_mode) { + nan =float16_default_nan (fpst); + } +return nan; + } + + val16 =float16_val (a); + sbit =0x8000 & val16; + exp =extract32 (val16,10 ,5 ); + +if (exp ==0 ) { +return make_float16 (deposit32 (sbit,10 ,5 ,0x1e )); + }else { +return make_float16 (deposit32 (sbit,10 ,5 , ~exp)); + } +} +float32 HELPER (frecpx_f32 )(float32 a,void *fpstp) {float_status *fpst = fpstp;
target/arm/translate-a64.c +4 -0
@@ -11312,6 +11312,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)handle_2misc_fcmp_zero (s, fpop, is_scalar,0 , is_q,MO_16 , rn, rd);return ;case 0x3d :/* FRECPE */ +case 0x3f :/* FRECPX */ break ;case 0x18 :/* FRINTN */ need_rmode = true;
@@ -11436,6 +11437,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x3d :/* FRECPE */ gen_helper_recpe_f16 (tcg_res, tcg_op, tcg_fpstatus);break ; +case 0x3f :/* FRECPX */ +gen_helper_frecpx_f16 (tcg_res, tcg_op, tcg_fpstatus); +break ;case 0x5a :/* FCVTNU */ case 0x5b :/* FCVTMU */ case 0x5c :/* FCVTAU */
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 30/42] arm/helper.c: re-factor recpe and add recepe_f16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
It looks like the ARM ARM has simplified the pseudo code for the calculation which is done on a fixed point 9 bit integer maths. So while adding f16 we can also clean this up to be a little less heavy on the floating point and just return the fractional part and leave the calle's to do the final packing of the result.
Message-id: [email protected]
--- target/arm/helper.h | 1 + target/arm/helper.c | 226 +++++++++++++++++++++++++++++----------------------- 2 files changed, 129 insertions(+), 98 deletions(-)
target/arm/helper.h +1 -0
@@ -192,6 +192,7 @@ DEF_HELPER_4(vfp_muladds, f32, f32, f32, f32, ptr) DEF_HELPER_3(recps_f32, f32, f32, f32, env) DEF_HELPER_3(rsqrts_f32, f32, f32, f32, env) +DEF_HELPER_FLAGS_2(recpe_f16, TCG_CALL_NO_RWG, f16, f16, ptr) DEF_HELPER_FLAGS_2(recpe_f32, TCG_CALL_NO_RWG, f32, f32, ptr) DEF_HELPER_FLAGS_2(recpe_f64, TCG_CALL_NO_RWG, f64, f64, ptr)DEF_HELPER_FLAGS_2 (rsqrte_f32,TCG_CALL_NO_RWG , f32, f32, ptr)
target/arm/helper.c +128 -98
312 lines not on this page · raw message
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 33/42] arm/translate-a64: add FP16 FSQRT to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Message-id: [email protected]
--- target/arm/helper-a64.h | 1 + target/arm/helper-a64.c | 13 +++++++++++++ target/arm/translate-a64.c | 5 +++++ 3 files changed, 19 insertions(+)
target/arm/helper-a64.h +1 -0
@@ -80,3 +80,4 @@ DEF_HELPER_2(advsimd_rinth_exact, f16, f16, ptr) DEF_HELPER_2(advsimd_rinth, f16, f16, ptr) DEF_HELPER_2(advsimd_f16tosinth, i32, f16, ptr) DEF_HELPER_2(advsimd_f16touinth, i32, f16, ptr) +DEF_HELPER_2 (sqrt_f16, f16, f16, ptr)
target/arm/helper-a64.c +13 -0
@@ -828,3 +828,16 @@ uint32_t HELPER(advsimd_f16touinth)(float16 a, void *fpstp) }return float16_to_uint16 (a, fpst); } + +/* +* Square Root and Reciprocal square root +*/ + +float16 HELPER (sqrt_f16 )(float16 a,void *fpstp) +{ +float_status *s = fpstp; + +return float16_sqrt (a, s); +} + +
target/arm/translate-a64.c +5 -0
@@ -11388,6 +11388,8 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x6f :/* FNEG */ need_fpst = false;break ; +case 0x7f :/* FSQRT (vector) */ +break ;default :fprintf (stderr,"%s: insn %#04x fpop %#2x\n" , __func__, insn, fpop);g_assert_not_reached ();
@@ -11502,6 +11504,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x6f :/* FNEG */ tcg_gen_xori_i32 (tcg_res, tcg_op,0x8000 );break ; +case 0x7f :/* FSQRT */ +gen_helper_sqrt_f16 (tcg_res, tcg_op, tcg_fpstatus); +break ;default :g_assert_not_reached (); }
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 35/42] arm/translate-a64: add FP16 FRSQRTE to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Message-id: [email protected]
--- target/arm/translate-a64.c | 7 +++++++ 1 file changed, 7 insertions(+)
target/arm/translate-a64.c +7 -0
@@ -11388,6 +11388,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x6f :/* FNEG */ need_fpst = false;break ; +case 0x7d :/* FRSQRTE */ case 0x7f :/* FSQRT (vector) */ break ;default :
@@ -11452,6 +11453,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x6f :/* FNEG */ tcg_gen_xori_i32 (tcg_res, tcg_op,0x8000 );break ; +case 0x7d :/* FRSQRTE */ +gen_helper_rsqrte_f16 (tcg_res, tcg_op, tcg_fpstatus); +break ;default :g_assert_not_reached (); }
@@ -11504,6 +11508,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)case 0x6f :/* FNEG */ tcg_gen_xori_i32 (tcg_res, tcg_op,0x8000 );break ; +case 0x7d :/* FRSQRTE */ +gen_helper_rsqrte_f16 (tcg_res, tcg_op, tcg_fpstatus); +break ;case 0x7f :/* FSQRT */ gen_helper_sqrt_f16 (tcg_res, tcg_op, tcg_fpstatus);break ;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 28/42] arm/translate-a64: add FP16 SCVTF/UCVFT to simd_two_reg_misc_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
I've re-factored the handle_simd_intfp_conv helper to properly handle half-precision as well as call plain conversion helpers when we are not doing fixed point conversion.
Message-id: [email protected]
--- target/arm/helper.h | 10 ++++ target/arm/helper.c | 4 ++ target/arm/translate-a64.c | 122 ++++++++++++++++++++++++++++++++++----------- 3 files changed, 108 insertions(+), 28 deletions(-)
target/arm/helper.h +10 -0
@@ -120,17 +120,23 @@ DEF_HELPER_3(vfp_cmped, void, f64, f64, env) DEF_HELPER_2(vfp_fcvtds, f64, f32, env) DEF_HELPER_2(vfp_fcvtsd, f32, f64, env) +DEF_HELPER_2(vfp_uitoh, f16, i32, ptr) DEF_HELPER_2(vfp_uitos, f32, i32, ptr) DEF_HELPER_2(vfp_uitod, f64, i32, ptr) +DEF_HELPER_2(vfp_sitoh, f16, i32, ptr) DEF_HELPER_2(vfp_sitos, f32, i32, ptr) DEF_HELPER_2(vfp_sitod, f64, i32, ptr) +DEF_HELPER_2(vfp_touih, i32, f16, ptr) DEF_HELPER_2(vfp_touis, i32, f32, ptr) DEF_HELPER_2(vfp_touid, i32, f64, ptr) +DEF_HELPER_2(vfp_touizh, i32, f16, ptr) DEF_HELPER_2(vfp_touizs, i32, f32, ptr) DEF_HELPER_2(vfp_touizd, i32, f64, ptr) +DEF_HELPER_2(vfp_tosih, i32, f16, ptr) DEF_HELPER_2(vfp_tosis, i32, f32, ptr) DEF_HELPER_2(vfp_tosid, i32, f64, ptr) +DEF_HELPER_2(vfp_tosizh, i32, f16, ptr) DEF_HELPER_2(vfp_tosizs, i32, f32, ptr)DEF_HELPER_2 (vfp_tosizd, i32, f64, ptr)
@@ -142,6 +148,8 @@ DEF_HELPER_3(vfp_toshd_round_to_zero, i64, f64, i32, ptr) DEF_HELPER_3(vfp_tosld_round_to_zero, i64, f64, i32, ptr) DEF_HELPER_3(vfp_touhd_round_to_zero, i64, f64, i32, ptr) DEF_HELPER_3(vfp_tould_round_to_zero, i64, f64, i32, ptr) +DEF_HELPER_3(vfp_toulh, i32, f16, i32, ptr) +DEF_HELPER_3(vfp_toslh, i32, f16, i32, ptr) DEF_HELPER_3(vfp_toshs, i32, f32, i32, ptr) DEF_HELPER_3(vfp_tosls, i32, f32, i32, ptr)DEF_HELPER_3 (vfp_tosqs, i64, f32, i32, ptr)
@@ -166,6 +174,8 @@ DEF_HELPER_3(vfp_sqtod, f64, i64, i32, ptr) DEF_HELPER_3(vfp_uhtod, f64, i64, i32, ptr) DEF_HELPER_3(vfp_ultod, f64, i64, i32, ptr) DEF_HELPER_3(vfp_uqtod, f64, i64, i32, ptr) +DEF_HELPER_3(vfp_sltoh, f16, i32, i32, ptr) +DEF_HELPER_3(vfp_ultoh, f16, i32, i32, ptr) DEF_HELPER_FLAGS_2(set_rmode, TCG_CALL_NO_RWG, i32, i32, ptr)DEF_HELPER_FLAGS_2 (set_neon_rmode,TCG_CALL_NO_RWG , i32, i32, env)
target/arm/helper.c +4 -0
@@ -11302,8 +11302,10 @@ CONV_ITOF(vfp_##name##to##p, fsz, sign) \ CONV_FTOI(vfp_to##name##p, fsz, sign, ) \ CONV_FTOI(vfp_to##name##z##p, fsz, sign, _round_to_zero) +FLOAT_CONVS(si, h, 16, ) FLOAT_CONVS(si, s, 32, ) FLOAT_CONVS(si, d, 64, ) +FLOAT_CONVS(ui, h, 16, u) FLOAT_CONVS(ui, s, 32, u) FLOAT_CONVS(ui, d, 64, u)
@@ -11386,6 +11388,8 @@ VFP_CONV_FIX_A64(sq, s, 32, 64, int64) VFP_CONV_FIX(uh, s, 32, 32, uint16) VFP_CONV_FIX(ul, s, 32, 32, uint32) VFP_CONV_FIX_A64(uq, s, 32, 64, uint64) +VFP_CONV_FIX_A64(sl, h, 16, 32, int32) +VFP_CONV_FIX_A64(ul, h, 16, 32, uint32)#undef VFP_CONV_FIX#undef VFP_CONV_FIX_FLOAT#undef VFP_CONV_FLOAT_FIX_ROUND
target/arm/translate-a64.c +94 -28
151 lines not on this page · raw message
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 34/42] arm/helper.c: re-factor rsqrte and add rsqrte_f16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Much like recpe the ARM ARM has simplified the pseudo code for the calculation which is done on a fixed point 9 bit integer maths. So while adding f16 we can also clean this up to be a little less heavy on the floating point and just return the fractional part and leave the calle's to do the final packing of the result.
Message-id: [email protected]
--- target/arm/helper.h | 1 + target/arm/helper.c | 221 ++++++++++++++++++++++++---------------------------- 2 files changed, 104 insertions(+), 118 deletions(-)
target/arm/helper.h +1 -0
@@ -195,6 +195,7 @@ DEF_HELPER_3(rsqrts_f32, f32, f32, f32, env) DEF_HELPER_FLAGS_2(recpe_f16, TCG_CALL_NO_RWG, f16, f16, ptr) DEF_HELPER_FLAGS_2(recpe_f32, TCG_CALL_NO_RWG, f32, f32, ptr) DEF_HELPER_FLAGS_2(recpe_f64, TCG_CALL_NO_RWG, f64, f64, ptr) +DEF_HELPER_FLAGS_2(rsqrte_f16, TCG_CALL_NO_RWG, f16, f16, ptr) DEF_HELPER_FLAGS_2(rsqrte_f32, TCG_CALL_NO_RWG, f32, f32, ptr) DEF_HELPER_FLAGS_2(rsqrte_f64, TCG_CALL_NO_RWG, f64, f64, ptr)DEF_HELPER_2 (recpe_u32, i32, i32, ptr)
target/arm/helper.c +103 -118
275 lines not on this page · raw message
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 36/42] arm/translate-a64: add FP16 FMOV to simd_mod_imm
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Only one half-precision instruction has been added to this group.
Message-id: [email protected]
--- target/arm/translate-a64.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-)
target/arm/translate-a64.c +25 -10
@@ -6234,6 +6234,8 @@ static void disas_simd_copy(DisasContext *s, uint32_t insn)* MVNI - move inverted (shifted) imm into register * ORR - bitwise OR of (shifted) imm with register * BIC - bitwise clear of (shifted) imm with register +* With ARMv8.2 we also have: +* FMOV half-precision */ static void disas_simd_mod_imm (DisasContext *s,uint32_t insn) {
@@ -6248,8 +6250,11 @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn)uint64_t imm =0 ;if (o2 !=0 || ((cmode ==0xf ) && is_neg && !is_q)) { -unallocated_encoding (s); -return ; +/* Check for FMOV (vector, immediate) - half-precision */ +if (!(arm_dc_feature (s,ARM_FEATURE_V8_FP16 ) && o2 && cmode ==0xf )) { +unallocated_encoding (s); +return ; + } }if (!fp_access_check (s)) {
@@ -6307,19 +6312,29 @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn) imm |=0x4000000000000000ULL ; } }else { - imm = (abcdefgh &0x3f ) <<19 ; -if (abcdefgh &0x80 ) { - imm |=0x80000000 ; - } -if (abcdefgh &0x40 ) { - imm |=0x3e000000 ; +if (o2) { +/* FMOV (vector, immediate) - half-precision */ + imm =vfp_expand_imm (MO_16 , abcdefgh); +/* now duplicate across the lanes */ + imm =bitfield_replicate (imm,16 ); }else { - imm |=0x40000000 ; + imm = (abcdefgh &0x3f ) <<19 ; +if (abcdefgh &0x80 ) { + imm |=0x80000000 ; + } +if (abcdefgh &0x40 ) { + imm |=0x3e000000 ; + }else { + imm |=0x40000000 ; + } + imm |= (imm <<32 ); } - imm |= (imm <<32 ); } }break ; +default : +fprintf (stderr,"%s: cmode_3_1: %x\n" , __func__, cmode_3_1); +g_assert_not_reached (); }if (cmode_3_1 !=7 && is_neg) {
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 37/42] arm/translate-a64: add all FP16 ops in simd_scalar_pairwise
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
I only needed to do a little light re-factoring to support the half-precision helpers.
Message-id: [email protected]
--- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 26 deletions(-)
target/arm/translate-a64.c +54 -26
@@ -6416,24 +6416,30 @@ static void disas_simd_scalar_pairwise(DisasContext *s, uint32_t insn)case 0xf :/* FMAXP */ case 0x2c :/* FMINNMP */ case 0x2f :/* FMINP */ -/* FP op, size[0] is 32 or 64 bit */ +/* FP op, size[0] is 32 or 64 bit*/ if (!u) { -unallocated_encoding (s); -return ; +if (!arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) { +unallocated_encoding (s); +return ; + }else { + size =MO_16 ; + } + }else { + size =extract32 (size,0 ,1 ) ?MO_64 :MO_32 ; } +if (!fp_access_check (s)) {return ; } - size =extract32 (size,0 ,1 ) ?3 :2 ; - fpst =get_fpstatus_ptr (false); + fpst =get_fpstatus_ptr (size ==MO_16 );break ;default :unallocated_encoding (s);return ; } -if (size ==3 ) { +if (size ==MO_64 ) {TCGv_i64 tcg_op1 =tcg_temp_new_i64 ();TCGv_i64 tcg_op2 =tcg_temp_new_i64 ();TCGv_i64 tcg_res =tcg_temp_new_i64 ();
@@ -6474,27 +6480,49 @@ static void disas_simd_scalar_pairwise(DisasContext *s, uint32_t insn)TCGv_i32 tcg_op2 =tcg_temp_new_i32 ();TCGv_i32 tcg_res =tcg_temp_new_i32 (); -read_vec_element_i32 (s, tcg_op1, rn,0 ,MO_32 ); -read_vec_element_i32 (s, tcg_op2, rn,1 ,MO_32 ); +read_vec_element_i32 (s, tcg_op1, rn,0 , size); +read_vec_element_i32 (s, tcg_op2, rn,1 , size); -switch (opcode) { -case 0xc :/* FMAXNMP */ -gen_helper_vfp_maxnums (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0xd :/* FADDP */ -gen_helper_vfp_adds (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0xf :/* FMAXP */ -gen_helper_vfp_maxs (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x2c :/* FMINNMP */ -gen_helper_vfp_minnums (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -case 0x2f :/* FMINP */ -gen_helper_vfp_mins (tcg_res, tcg_op1, tcg_op2, fpst); -break ; -default : -g_assert_not_reached (); +if (size ==MO_16 ) { +switch (opcode) { +case 0xc :/* FMAXNMP */ +gen_helper_advsimd_maxnumh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xd :/* FADDP */ +gen_helper_advsimd_addh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xf :/* FMAXP */ +gen_helper_advsimd_maxh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x2c :/* FMINNMP */ +gen_helper_advsimd_minnumh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x2f :/* FMINP */ +gen_helper_advsimd_minh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +default : +g_assert_not_reached (); + } + }else { +switch (opcode) { +case 0xc :/* FMAXNMP */ +gen_helper_vfp_maxnums (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xd :/* FADDP */ +gen_helper_vfp_adds (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0xf :/* FMAXP */ +gen_helper_vfp_maxs (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x2c :/* FMINNMP */ +gen_helper_vfp_minnums (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x2f :/* FMINP */ +gen_helper_vfp_mins (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +default : +g_assert_not_reached (); + } }write_fp_sreg (s, rd, tcg_res);
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 38/42] arm/translate-a64: implement simd_scalar_three_reg_same_fp16
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This covers the encoding group:
Advanced SIMD scalar three same FP16
As all the helpers are already there it is simply a case of calling the existing helpers in the scalar context.
Message-id: [email protected]
--- target/arm/translate-a64.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+)
target/arm/translate-a64.c +99 -0
@@ -7802,6 +7802,104 @@ static void disas_simd_scalar_three_reg_same(DisasContext *s, uint32_t insn)tcg_temp_free_i64 (tcg_rd); } +/* AdvSIMD scalar three same FP16 +* 31 30 29 28 24 23 22 21 20 16 15 14 13 11 10 9 5 4 0 +* +-----+---+-----------+---+-----+------+-----+--------+---+----+----+ +* | 0 1 | U | 1 1 1 1 0 | a | 1 0 | Rm | 0 0 | opcode | 1 | Rn | Rd | +* +-----+---+-----------+---+-----+------+-----+--------+---+----+----+ +* v: 0101 1110 0100 0000 0000 0100 0000 0000 => 5e400400 +* m: 1101 1111 0110 0000 1100 0100 0000 0000 => df60c400 +*/ +static void disas_simd_scalar_three_reg_same_fp16 (DisasContext *s, +uint32_t insn) +{ +int rd =extract32 (insn,0 ,5 ); +int rn =extract32 (insn,5 ,5 ); +int opcode =extract32 (insn,11 ,3 ); +int rm =extract32 (insn,16 ,5 ); +bool u =extract32 (insn,29 ,1 ); +bool a =extract32 (insn,23 ,1 ); +int fpopcode = opcode | (a <<3 ) | (u <<4 ); +TCGv_ptr fpst; +TCGv_i32 tcg_op1; +TCGv_i32 tcg_op2; +TCGv_i32 tcg_res; + +switch (fpopcode) { +case 0x03 :/* FMULX */ +case 0x04 :/* FCMEQ (reg) */ +case 0x07 :/* FRECPS */ +case 0x0f :/* FRSQRTS */ +case 0x14 :/* FCMGE (reg) */ +case 0x15 :/* FACGE */ +case 0x1a :/* FABD */ +case 0x1c :/* FCMGT (reg) */ +case 0x1d :/* FACGT */ +break ; +default : +unallocated_encoding (s); +return ; + } + +if (!arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) { +unallocated_encoding (s); + } + +if (!fp_access_check (s)) { +return ; + } + + fpst =get_fpstatus_ptr (true); + + tcg_op1 =tcg_temp_new_i32 (); + tcg_op2 =tcg_temp_new_i32 (); + tcg_res =tcg_temp_new_i32 (); + +read_vec_element_i32 (s, tcg_op1, rn,0 ,MO_16 ); +read_vec_element_i32 (s, tcg_op2, rm,0 ,MO_16 ); + +switch (fpopcode) { +case 0x03 :/* FMULX */ +gen_helper_advsimd_mulxh (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x04 :/* FCMEQ (reg) */ +gen_helper_advsimd_ceq_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x07 :/* FRECPS */ +gen_helper_recpsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x0f :/* FRSQRTS */ +gen_helper_rsqrtsf_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x14 :/* FCMGE (reg) */ +gen_helper_advsimd_cge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x15 :/* FACGE */ +gen_helper_advsimd_acge_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x1a :/* FABD */ +gen_helper_advsimd_subh (tcg_res, tcg_op1, tcg_op2, fpst); +tcg_gen_andi_i32 (tcg_res, tcg_res,0x7fff ); +break ; +case 0x1c :/* FCMGT (reg) */ +gen_helper_advsimd_cgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +case 0x1d :/* FACGT */ +gen_helper_advsimd_acgt_f16 (tcg_res, tcg_op1, tcg_op2, fpst); +break ; +default : +g_assert_not_reached (); + } + +write_fp_sreg (s, rd, tcg_res); + + +tcg_temp_free_i32 (tcg_res); +tcg_temp_free_i32 (tcg_op1); +tcg_temp_free_i32 (tcg_op2); +tcg_temp_free_ptr (fpst); +} +static void handle_2misc_64 (DisasContext *s,int opcode,bool u,TCGv_i64 tcg_rd,TCGv_i64 tcg_rn,TCGv_i32 tcg_rmode,TCGv_ptr tcg_fpstatus)
@@ -12653,6 +12751,7 @@ static const AArch64DecodeTable data_proc_simd[] = { { 0xce408000, 0xffe0c000, disas_crypto_three_reg_imm2 }, { 0x0e400400, 0x9f60c400, disas_simd_three_reg_same_fp16 }, { 0x0e780800, 0x8f7e0c00, disas_simd_two_reg_misc_fp16 }, + { 0x5e400400, 0xdf60c400, disas_simd_scalar_three_reg_same_fp16 }, { 0x00000000, 0x00000000, NULL } };
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 39/42] arm/translate-a64: add all single op FP16 to handle_fp_1src_half
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
This includes FMOV, FABS, FNEG, FSQRT and FRINT[NPMZAXI]. We re-use existing helpers to achieve this.
Message-id: [email protected]
--- target/arm/translate-a64.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+)
target/arm/translate-a64.c +71 -0
@@ -4596,6 +4596,65 @@ static void disas_fp_csel(DisasContext *s, uint32_t insn)tcg_temp_free_i64 (t_true); } +/* Floating-point data-processing (1 source) - half precision */ +static void handle_fp_1src_half (DisasContext *s,int opcode,int rd,int rn) +{ +TCGv_ptr fpst =NULL ; +TCGv_i32 tcg_op =tcg_temp_new_i32 (); +TCGv_i32 tcg_res =tcg_temp_new_i32 (); + +read_vec_element_i32 (s, tcg_op, rn,0 ,MO_16 ); + +switch (opcode) { +case 0x0 :/* FMOV */ +tcg_gen_mov_i32 (tcg_res, tcg_op); +break ; +case 0x1 :/* FABS */ +tcg_gen_andi_i32 (tcg_res, tcg_op,0x7fff ); +break ; +case 0x2 :/* FNEG */ +tcg_gen_xori_i32 (tcg_res, tcg_op,0x8000 ); +break ; +case 0x3 :/* FSQRT */ +gen_helper_sqrt_f16 (tcg_res, tcg_op, cpu_env); +break ; +case 0x8 :/* FRINTN */ +case 0x9 :/* FRINTP */ +case 0xa :/* FRINTM */ +case 0xb :/* FRINTZ */ +case 0xc :/* FRINTA */ + { +TCGv_i32 tcg_rmode =tcg_const_i32 (arm_rmode_to_sf (opcode &7 )); + fpst =get_fpstatus_ptr (true); + +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst); +gen_helper_advsimd_rinth (tcg_res, tcg_op, fpst); + +gen_helper_set_rmode (tcg_rmode, tcg_rmode, fpst); +tcg_temp_free_i32 (tcg_rmode); +break ; + } +case 0xe :/* FRINTX */ + fpst =get_fpstatus_ptr (true); +gen_helper_advsimd_rinth_exact (tcg_res, tcg_op, fpst); +break ; +case 0xf :/* FRINTI */ + fpst =get_fpstatus_ptr (true); +gen_helper_advsimd_rinth (tcg_res, tcg_op, fpst); +break ; +default : +abort (); + } + +write_fp_sreg (s, rd, tcg_res); + +if (fpst) { +tcg_temp_free_ptr (fpst); + } +tcg_temp_free_i32 (tcg_op); +tcg_temp_free_i32 (tcg_res); +} +/* Floating-point data-processing (1 source) - single precision */ static void handle_fp_1src_single (DisasContext *s,int opcode,int rd,int rn) {
@@ -4825,6 +4884,18 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn)handle_fp_1src_double (s, opcode, rd, rn);break ; +case 3 : +if (!arm_dc_feature (s,ARM_FEATURE_V8_FP16 )) { +unallocated_encoding (s); +return ; + } + +if (!fp_access_check (s)) { +return ; + } + +handle_fp_1src_half (s, opcode, rd, rn); +break ;default :unallocated_encoding (s); }
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 40/42] target/arm: Enable ARM_V8_FP16 feature bit for the AArch64 "any" CPU
In reply to Peter MaydellNow we have implemented FP16 we can enable it for the "any" CPU.
--- target/arm/cpu64.c | 1 + 1 file changed, 1 insertion(+)
target/arm/cpu64.c +1 -0
@@ -230,6 +230,7 @@ static void aarch64_any_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_V8_SM4 );set_feature (&cpu->env,ARM_FEATURE_V8_PMULL );set_feature (&cpu->env,ARM_FEATURE_CRC ); +set_feature (&cpu->env,ARM_FEATURE_V8_FP16 ); cpu->ctr =0x80038003 ;/* 32 byte I and D cacheline size, VIPT icache */ cpu->dcz_blocksize =7 ;/* 512 bytes */ }
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 41/42] linux-user: Report AArch64 FP16 support via hwcap bits
In reply to Peter MaydellSet the appropriate Linux hwcap bits to tell the guest binary if we have implemented half-precision floating point support.
--- linux-user/elfload.c | 2 ++ 1 file changed, 2 insertions(+)
linux-user/elfload.c +2 -0
@@ -551,6 +551,8 @@ static uint32_t get_elf_hwcap(void)GET_FEATURE (ARM_FEATURE_V8_SM3 ,ARM_HWCAP_A64_SM3 );GET_FEATURE (ARM_FEATURE_V8_SM4 ,ARM_HWCAP_A64_SM4 );GET_FEATURE (ARM_FEATURE_V8_SHA512 ,ARM_HWCAP_A64_SHA512 ); +GET_FEATURE (ARM_FEATURE_V8_FP16 , +ARM_HWCAP_A64_FPHP |ARM_HWCAP_A64_ASIMDHP );#undef GET_FEATUREreturn hwcaps;
Signature · 1 line
2.16.2
[Qemu-devel] [PULL 42/42] MAINTAINERS: Update my email address
In reply to Peter MaydellFrom: Alistair Francis <[email protected]>
I am leaving Xilinx, so to avoid having an email address that bounces update my maintainer address to point to my personal email address.
Message-id: 7bb690382e3370aa1c1e047a84e36603c787ec0e.1519749987.git.alistair.francis@xilinx.com
--- MAINTAINERS | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
MAINTAINERS +6 -6
@@ -556,7 +556,7 @@ F: hw/misc/arm_sysctl.c Xilinx Zynq M: Edgar E. Iglesias <[email protected]> -M: Alistair Francis <[email protected]> +M: Alistair Francis <[email protected]> L: [email protected] S: Maintained F: hw/*/xilinx_*
@@ -566,7 +566,7 @@ F: include/hw/misc/zynq* X: hw/ssi/xilinx_* Xilinx ZynqMP -M: Alistair Francis <[email protected]> +M: Alistair Francis <[email protected]> M: Edgar E. Iglesias <[email protected]> L: [email protected] S: Maintained
@@ -1075,7 +1075,7 @@ T: git git://github.com/bonzini/qemu.git scsi-next SSI M: Peter Crosthwaite <[email protected]> -M: Alistair Francis <[email protected]> +M: Alistair Francis <[email protected]> S: Maintained F: hw/ssi/* F: hw/block/m25p80.c
@@ -1084,7 +1084,7 @@ X: hw/ssi/xilinx_* F: tests/m25p80-test.c Xilinx SPI -M: Alistair Francis <[email protected]> +M: Alistair Francis <[email protected]> M: Peter Crosthwaite <[email protected]> S: Maintained F: hw/ssi/xilinx_*
@@ -1254,7 +1254,7 @@ S: Maintained F: hw/net/eepro100.c Generic Loader -M: Alistair Francis <[email protected]> +M: Alistair Francis <[email protected]> S: Maintained F: hw/core/generic-loader.c F: include/hw/core/generic-loader.h
@@ -1600,7 +1600,7 @@ F: tests/qmp-test.c T: git git://repo.or.cz/qemu/armbru.git qapi-next Register API -M: Alistair Francis <[email protected]> +M: Alistair Francis <[email protected]> S: Maintained F: hw/core/register.c F: include/hw/register.h
Signature · 1 line
2.16.2
This series seems to have some coding style problems. See output below for more information:
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 00/42] target-arm queue
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
5116c331c6..2963d78204 master -> master
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'b8d820da8e MAINTAINERS: Update my email addressfafefeede8 linux-user: Report AArch64 FP16 support via hwcap bits1e47f0c8d0 target/arm: Enable ARM_V8_FP16 feature bit for the AArch64 "any" CPU a1d78601d3 arm/translate-a64: add all single op FP16 to handle_fp_1src_half ef1aeecd4b arm/translate-a64: implement simd_scalar_three_reg_same_fp16 6f2836d485 arm/translate-a64: add all FP16 ops in simd_scalar_pairwise a35291f349 arm/translate-a64: add FP16 FMOV to simd_mod_imm0a27cbb4ed arm/translate-a64: add FP16 FRSQRTE to simd_two_reg_misc_fp16 0a441b7da4 arm/helper.c: re-factor rsqrte and add rsqrte_f16da2e0fc44a arm/translate-a64: add FP16 FSQRT to simd_two_reg_misc_fp16 4cef2369d2 arm/translate-a64: add FP16 FRCPX to simd_two_reg_misc_fp16 1b4f1ab980 arm/translate-a64: add FP16 FRECPE73a9e97036 arm/helper.c: re-factor recpe and add recepe_f1690ba4bd8c2 arm/translate-a64: add FP16 FNEG/FABS to simd_two_reg_misc_fp16 73fd85ed2b arm/translate-a64: add FP16 SCVTF/UCVFT to simd_two_reg_misc_fp16 f19cc5a183 arm/translate-a64: add FP16 FCMxx (zero) to simd_two_reg_misc_fp16 65f396e589 arm/translate-a64: add FCVTxx to simd_two_reg_misc_fp16 0e24214ab5 arm/translate-a64: add FP16 FPRINTx to simd_two_reg_misc_fp16 f196ce6fe6 arm/translate-a64: initial decode for simd_two_reg_misc_fp16 34d06595e7 arm/translate-a64: add FP16 x2 ops for simd_indexed1cbb0530d6 arm/translate-a64: add FP16 FMULX/MLS/FMLA to simd_indexed 2784d82ed6 arm/translate-a64: add FP16 pairwise ops simd_three_reg_same_fp16 d384cdd281 arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16 8f8a6ce448 arm/translate-a64: add FP16 FMULA/X/S to simd_three_reg_same_fp16 126916bc89 arm/translate-a64: add FP16 F[A]C[EQ/GE/GT] to simd_three_reg_same_fp16 4173362d9a arm/translate-a64: add FP16 FADD/FABD/FSUB/FMUL/FDIV to simd_three_reg_same_fp16 933cd48012 arm/translate-a64: initial decode for simd_three_reg_same_fp16 b990db46a4 arm/translate-a64: handle_3same_64 comment fixd35bfc6ddd arm/translate-a64: implement half-precision F(MIN|MAX)(V|NMV) f7b5043d8e target/arm/helper: pass explicit fpst to set_rmodef4942cc7c8 target/arm/cpu.h: add additional float_status flags8f2a0f5575 target/arm/cpu.h: update comment for half-precision values 3059f5906d target/arm/cpu64: introduce ARM_V8_FP16 feature bitaac25f27be include/exec/helper-head.h: support f16 in helper calls 5998ce1e24 arm/vexpress: Add proper display connector emulationcd734131b2 hw/sii9022: Add support for Silicon Image SII902294b945c24d hw/i2c-ddc: Do not fail writesfb66477d35 i2c: Move the bus class to i2c.h96b6d99806 i2c: Fix some brace style issues6fdd76003e xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands 0a63d14eaa xilinx_spips: Enable only two slaves when reading/writing with stripe 3a5412277e hw: register: Run post_write hook on reset
=== OUTPUT BEGIN ===
Checking PATCH 1/42: hw: register: Run post_write hook on reset...
Checking PATCH 2/42: xilinx_spips: Enable only two slaves when reading/writing with stripe... Checking PATCH 3/42: xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands... Checking PATCH 4/42: i2c: Fix some brace style issues...
Checking PATCH 5/42: i2c: Move the bus class to i2c.h...
Checking PATCH 6/42: hw/i2c-ddc: Do not fail writes...
Checking PATCH 7/42: hw/sii9022: Add support for Silicon Image SII9022...
Checking PATCH 8/42: arm/vexpress: Add proper display connector emulation...
Checking PATCH 9/42: include/exec/helper-head.h: support f16 in helper calls...
Checking PATCH 10/42: target/arm/cpu64: introduce ARM_V8_FP16 feature bit...
Checking PATCH 11/42: target/arm/cpu.h: update comment for half-precision values... Checking PATCH 12/42: target/arm/cpu.h: add additional float_status flags...
Checking PATCH 13/42: target/arm/helper: pass explicit fpst to set_rmode...
Checking PATCH 14/42: arm/translate-a64: implement half-precision F(MIN|MAX)(V|NMV)... Checking PATCH 15/42: arm/translate-a64: handle_3same_64 comment fix...
Checking PATCH 16/42: arm/translate-a64: initial decode for simd_three_reg_same_fp16... Checking PATCH 17/42: arm/translate-a64: add FP16 FADD/FABD/FSUB/FMUL/FDIV to simd_three_reg_same_fp16... Checking PATCH 18/42: arm/translate-a64: add FP16 F[A]C[EQ/GE/GT] to simd_three_reg_same_fp16... Checking PATCH 19/42: arm/translate-a64: add FP16 FMULA/X/S to simd_three_reg_same_fp16... Checking PATCH 20/42: arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16... Checking PATCH 21/42: arm/translate-a64: add FP16 pairwise ops simd_three_reg_same_fp16... Checking PATCH 22/42: arm/translate-a64: add FP16 FMULX/MLS/FMLA to simd_indexed... Checking PATCH 23/42: arm/translate-a64: add FP16 x2 ops for simd_indexed...
Checking PATCH 24/42: arm/translate-a64: initial decode for simd_two_reg_misc_fp16... Checking PATCH 25/42: arm/translate-a64: add FP16 FPRINTx to simd_two_reg_misc_fp16... Checking PATCH 26/42: arm/translate-a64: add FCVTxx to simd_two_reg_misc_fp16... Checking PATCH 27/42: arm/translate-a64: add FP16 FCMxx (zero) to simd_two_reg_misc_fp16... Checking PATCH 28/42: arm/translate-a64: add FP16 SCVTF/UCVFT to simd_two_reg_misc_fp16...
ERROR: space prohibited before that close parenthesis ')'
#28: FILE: target/arm/helper.c:11305:
+FLOAT_CONVS(si, h, 16, )
total: 1 errors, 0 warnings, 208 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 29/42: arm/translate-a64: add FP16 FNEG/FABS to simd_two_reg_misc_fp16... Checking PATCH 30/42: arm/helper.c: re-factor recpe and add recepe_f16... Checking PATCH 31/42: arm/translate-a64: add FP16 FRECPE...
Checking PATCH 32/42: arm/translate-a64: add FP16 FRCPX to simd_two_reg_misc_fp16... Checking PATCH 33/42: arm/translate-a64: add FP16 FSQRT to simd_two_reg_misc_fp16... Checking PATCH 34/42: arm/helper.c: re-factor rsqrte and add rsqrte_f16... Checking PATCH 35/42: arm/translate-a64: add FP16 FRSQRTE to simd_two_reg_misc_fp16... Checking PATCH 36/42: arm/translate-a64: add FP16 FMOV to simd_mod_imm... Checking PATCH 37/42: arm/translate-a64: add all FP16 ops in simd_scalar_pairwise... Checking PATCH 38/42: arm/translate-a64: implement simd_scalar_three_reg_same_fp16... Checking PATCH 39/42: arm/translate-a64: add all single op FP16 to handle_fp_1src_half... Checking PATCH 40/42: target/arm: Enable ARM_V8_FP16 feature bit for the AArch64 "any" CPU... Checking PATCH 41/42: linux-user: Report AArch64 FP16 support via hwcap bits... Checking PATCH 42/42: MAINTAINERS: Update my email address...
=== OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
This series seems to have some coding style problems. See output below for more information:
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 00/42] target-arm queue
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
5116c331c6..2963d78204 master -> master
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'b8d820da8e MAINTAINERS: Update my email addressfafefeede8 linux-user: Report AArch64 FP16 support via hwcap bits1e47f0c8d0 target/arm: Enable ARM_V8_FP16 feature bit for the AArch64 "any" CPU a1d78601d3 arm/translate-a64: add all single op FP16 to handle_fp_1src_half ef1aeecd4b arm/translate-a64: implement simd_scalar_three_reg_same_fp16 6f2836d485 arm/translate-a64: add all FP16 ops in simd_scalar_pairwise a35291f349 arm/translate-a64: add FP16 FMOV to simd_mod_imm0a27cbb4ed arm/translate-a64: add FP16 FRSQRTE to simd_two_reg_misc_fp16 0a441b7da4 arm/helper.c: re-factor rsqrte and add rsqrte_f16da2e0fc44a arm/translate-a64: add FP16 FSQRT to simd_two_reg_misc_fp16 4cef2369d2 arm/translate-a64: add FP16 FRCPX to simd_two_reg_misc_fp16 1b4f1ab980 arm/translate-a64: add FP16 FRECPE73a9e97036 arm/helper.c: re-factor recpe and add recepe_f1690ba4bd8c2 arm/translate-a64: add FP16 FNEG/FABS to simd_two_reg_misc_fp16 73fd85ed2b arm/translate-a64: add FP16 SCVTF/UCVFT to simd_two_reg_misc_fp16 f19cc5a183 arm/translate-a64: add FP16 FCMxx (zero) to simd_two_reg_misc_fp16 65f396e589 arm/translate-a64: add FCVTxx to simd_two_reg_misc_fp16 0e24214ab5 arm/translate-a64: add FP16 FPRINTx to simd_two_reg_misc_fp16 f196ce6fe6 arm/translate-a64: initial decode for simd_two_reg_misc_fp16 34d06595e7 arm/translate-a64: add FP16 x2 ops for simd_indexed1cbb0530d6 arm/translate-a64: add FP16 FMULX/MLS/FMLA to simd_indexed 2784d82ed6 arm/translate-a64: add FP16 pairwise ops simd_three_reg_same_fp16 d384cdd281 arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16 8f8a6ce448 arm/translate-a64: add FP16 FMULA/X/S to simd_three_reg_same_fp16 126916bc89 arm/translate-a64: add FP16 F[A]C[EQ/GE/GT] to simd_three_reg_same_fp16 4173362d9a arm/translate-a64: add FP16 FADD/FABD/FSUB/FMUL/FDIV to simd_three_reg_same_fp16 933cd48012 arm/translate-a64: initial decode for simd_three_reg_same_fp16 b990db46a4 arm/translate-a64: handle_3same_64 comment fixd35bfc6ddd arm/translate-a64: implement half-precision F(MIN|MAX)(V|NMV) f7b5043d8e target/arm/helper: pass explicit fpst to set_rmodef4942cc7c8 target/arm/cpu.h: add additional float_status flags8f2a0f5575 target/arm/cpu.h: update comment for half-precision values 3059f5906d target/arm/cpu64: introduce ARM_V8_FP16 feature bitaac25f27be include/exec/helper-head.h: support f16 in helper calls 5998ce1e24 arm/vexpress: Add proper display connector emulationcd734131b2 hw/sii9022: Add support for Silicon Image SII902294b945c24d hw/i2c-ddc: Do not fail writesfb66477d35 i2c: Move the bus class to i2c.h96b6d99806 i2c: Fix some brace style issues6fdd76003e xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands 0a63d14eaa xilinx_spips: Enable only two slaves when reading/writing with stripe 3a5412277e hw: register: Run post_write hook on reset
=== OUTPUT BEGIN ===
Checking PATCH 1/42: hw: register: Run post_write hook on reset...
Checking PATCH 2/42: xilinx_spips: Enable only two slaves when reading/writing with stripe... Checking PATCH 3/42: xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands... Checking PATCH 4/42: i2c: Fix some brace style issues...
Checking PATCH 5/42: i2c: Move the bus class to i2c.h...
Checking PATCH 6/42: hw/i2c-ddc: Do not fail writes...
Checking PATCH 7/42: hw/sii9022: Add support for Silicon Image SII9022...
Checking PATCH 8/42: arm/vexpress: Add proper display connector emulation...
Checking PATCH 9/42: include/exec/helper-head.h: support f16 in helper calls...
Checking PATCH 10/42: target/arm/cpu64: introduce ARM_V8_FP16 feature bit...
Checking PATCH 11/42: target/arm/cpu.h: update comment for half-precision values... Checking PATCH 12/42: target/arm/cpu.h: add additional float_status flags...
Checking PATCH 13/42: target/arm/helper: pass explicit fpst to set_rmode...
Checking PATCH 14/42: arm/translate-a64: implement half-precision F(MIN|MAX)(V|NMV)... Checking PATCH 15/42: arm/translate-a64: handle_3same_64 comment fix...
Checking PATCH 16/42: arm/translate-a64: initial decode for simd_three_reg_same_fp16... Checking PATCH 17/42: arm/translate-a64: add FP16 FADD/FABD/FSUB/FMUL/FDIV to simd_three_reg_same_fp16... Checking PATCH 18/42: arm/translate-a64: add FP16 F[A]C[EQ/GE/GT] to simd_three_reg_same_fp16... Checking PATCH 19/42: arm/translate-a64: add FP16 FMULA/X/S to simd_three_reg_same_fp16... Checking PATCH 20/42: arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16... Checking PATCH 21/42: arm/translate-a64: add FP16 pairwise ops simd_three_reg_same_fp16... Checking PATCH 22/42: arm/translate-a64: add FP16 FMULX/MLS/FMLA to simd_indexed... Checking PATCH 23/42: arm/translate-a64: add FP16 x2 ops for simd_indexed...
Checking PATCH 24/42: arm/translate-a64: initial decode for simd_two_reg_misc_fp16... Checking PATCH 25/42: arm/translate-a64: add FP16 FPRINTx to simd_two_reg_misc_fp16... Checking PATCH 26/42: arm/translate-a64: add FCVTxx to simd_two_reg_misc_fp16... Checking PATCH 27/42: arm/translate-a64: add FP16 FCMxx (zero) to simd_two_reg_misc_fp16... Checking PATCH 28/42: arm/translate-a64: add FP16 SCVTF/UCVFT to simd_two_reg_misc_fp16...
ERROR: space prohibited before that close parenthesis ')'
#28: FILE: target/arm/helper.c:11305:
+FLOAT_CONVS(si, h, 16, )
total: 1 errors, 0 warnings, 208 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 29/42: arm/translate-a64: add FP16 FNEG/FABS to simd_two_reg_misc_fp16... Checking PATCH 30/42: arm/helper.c: re-factor recpe and add recepe_f16... Checking PATCH 31/42: arm/translate-a64: add FP16 FRECPE...
Checking PATCH 32/42: arm/translate-a64: add FP16 FRCPX to simd_two_reg_misc_fp16... Checking PATCH 33/42: arm/translate-a64: add FP16 FSQRT to simd_two_reg_misc_fp16... Checking PATCH 34/42: arm/helper.c: re-factor rsqrte and add rsqrte_f16... Checking PATCH 35/42: arm/translate-a64: add FP16 FRSQRTE to simd_two_reg_misc_fp16... Checking PATCH 36/42: arm/translate-a64: add FP16 FMOV to simd_mod_imm... Checking PATCH 37/42: arm/translate-a64: add all FP16 ops in simd_scalar_pairwise... Checking PATCH 38/42: arm/translate-a64: implement simd_scalar_three_reg_same_fp16... Checking PATCH 39/42: arm/translate-a64: add all single op FP16 to handle_fp_1src_half... Checking PATCH 40/42: target/arm: Enable ARM_V8_FP16 feature bit for the AArch64 "any" CPU... Checking PATCH 41/42: linux-user: Report AArch64 FP16 support via hwcap bits... Checking PATCH 42/42: MAINTAINERS: Update my email address...
=== OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Quoted 8 lines · On 1 March 2018 at 13:00, <[email protected]> wrote:
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 00/42] target-arm queue
Fam -- any idea why patchew sent two checkpatch-issues emails for this patchset ? The Message-IDs are:
<151990924540.1290.18181910407458585370@bdbb90650ae5> <151990926291.1290.9842237231347453757@bdbb90650ae5>
thanks
-- PMM
Quoted 6 lines · Peter Maydell
Quoted 5 lines · On 1 March 2018 at 13:00, <[email protected]> wrote:
Hi,
This series seems to have some coding style problems. See output below for more information:
Quoted 8 lines
Quoted 3 lines
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 00/42] target-arm queueFam -- any idea why patchew sent two checkpatch-issues emails for this patchset ? The Message-IDs are:
<151990924540.1290.18181910407458585370@bdbb90650ae5> <151990926291.1290.9842237231347453757@bdbb90650ae5>
A bug in patchew. The server dispatched the checkpatch task to two testers when they asked for more work to do. One of them shouldn't happen. I've worked around this in the config
(filtering the task into only one tester) now.
I created an issue.
https://github.com/patchew-project/patchew/issues/63
Fam
Peter Maydell
AppliedQuoted 28 lines · Peter Maydell
Arm queue -- I have more stuff pending but I prefer to push this first lot out and keep the pull below 50 patches. Most of this is Alex's FP16 support work.
-- PMM
The following changes since commit
6697439794f72b3501ee16bb95d16854f9981421:Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180227-pull-request' into staging (2018-02-27 17:50:46 +0000)
are available in the Git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.gittags/pull-target-arm-20180301for you to fetch changes up to
c22e580c2ad1cccef582e1490e732f254d4ac064:
MAINTAINERS: Update my email address (2018-03-01 11:13:59 +0000)----------------------------------------------------------------
target-arm queue:
* updateMAINTAINERSfor Alistair's new email address
* add Arm v8.2 FP16 arithmetic extension for linux-user
* implement display connector emulation for vexpress board
*xilinx_spips: Enable only two slaves when reading/writing with stripe
*xilinx_spips: Use 8 dummy cycles with the QIOR/QIOR4 commands
* hw: register: Runpost_writehook on reset
Quoted 1 line
----------------------------------------------------------------
Applied, thanks.
-- PMM