Hi, Alex, On 06/29/2021 08:26 PM, Alex Bennée wrote: > > Song Gao <gaos...@loongson.cn> writes: > >> Hi, Philippe, >> >> On 06/29/2021 02:46 AM, Philippe Mathieu-Daudé wrote: >>> On 6/28/21 2:04 PM, Song Gao wrote: >>>> This patch add main translation routines and >>>> basic functions for translation. >>>> >>>> Signed-off-by: Song Gao <gaos...@loongson.cn> >>>> --- >>>> target/loongarch/helper.h | 10 + >>>> target/loongarch/op_helper.c | 28 +++ >>>> target/loongarch/translate.c | 537 >>>> +++++++++++++++++++++++++++++++++++++++++++ >>>> target/loongarch/translate.h | 58 +++++ >>>> 4 files changed, 633 insertions(+) >>>> create mode 100644 target/loongarch/helper.h >>>> create mode 100644 target/loongarch/op_helper.c >>>> create mode 100644 target/loongarch/translate.c >>>> create mode 100644 target/loongarch/translate.h >>> >>>> +/* 128 and 256 msa vector instructions are not supported yet */ >>>> +static bool decode_lsx(uint32_t opcode) >>>> +{ >>>> + uint32_t value = (opcode & 0xff000000); >>>> + >>>> + if ((opcode & 0xf0000000) == 0x70000000) { >>>> + return true; >>>> + } else if ((opcode & 0xfff00000) == 0x38400000) { >>>> + return true; >>>> + } else { >>>> + switch (value) { >>>> + case 0x09000000: >>>> + case 0x0a000000: >>>> + case 0x0e000000: >>>> + case 0x0f000000: >>>> + case 0x2c000000: >>>> + case 0x30000000: >>>> + case 0x31000000: >>>> + case 0x32000000: >>>> + case 0x33000000: >>>> + return true; >>>> + } >>>> + } >>>> + return false; >>>> +} >>> >>> Why not generate that with the decodetree script? >>> >> These instructions are privileged instructions, user mode does not need >> these instructions. >> I'll delete these codes. > > Are you intending to include system emulation in due course? > Yes, After the loongarch kernel is submitted to the mainline, we will add system emulation support. You can see the lastest loongarch kernel at:
https://github.com/loongson/linux/tree/loongarch-next thanks