mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 16:29:24 +02:00
+ Risc-V: make use of zext.h if available
This commit is contained in:
parent
5186044e81
commit
a53eb8b230
@ -129,6 +129,10 @@ unit cgcpu;
|
|||||||
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
||||||
else if (tosize=OS_8) and (fromsize<>OS_8) then
|
else if (tosize=OS_8) and (fromsize<>OS_8) then
|
||||||
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
||||||
|
else if (CPURV_HAS_ZBB in cpu_capabilities[current_settings.cputype]) and (tcgsize2unsigned[tosize]=OS_64) and (fromsize=OS_16) then
|
||||||
|
list.Concat(taicpu.op_reg_reg(A_ZEXT_H,reg2,reg1))
|
||||||
|
else if (CPURV_HAS_ZBB in cpu_capabilities[current_settings.cputype]) and (tosize=OS_16) and (fromsize<>OS_16) then
|
||||||
|
list.Concat(taicpu.op_reg_reg(A_ZEXT_H,reg2,reg1))
|
||||||
else if (tcgsize2size[fromsize] > tcgsize2size[tosize]) or
|
else if (tcgsize2size[fromsize] > tcgsize2size[tosize]) or
|
||||||
((tcgsize2size[fromsize] = tcgsize2size[tosize]) and (fromsize <> tosize)) or
|
((tcgsize2size[fromsize] = tcgsize2size[tosize]) and (fromsize <> tosize)) or
|
||||||
{ do we need to mask out the sign when loading from smaller signed to larger unsigned type? }
|
{ do we need to mask out the sign when loading from smaller signed to larger unsigned type? }
|
||||||
|
@ -206,7 +206,7 @@ Const
|
|||||||
CPURV_HAS_COMPACT,
|
CPURV_HAS_COMPACT,
|
||||||
CPURV_HAS_16REGISTERS,
|
CPURV_HAS_16REGISTERS,
|
||||||
CPURV_HAS_ZBA,
|
CPURV_HAS_ZBA,
|
||||||
CPURV_HAS_ZBb,
|
CPURV_HAS_ZBB,
|
||||||
CPURV_HAS_ZBC,
|
CPURV_HAS_ZBC,
|
||||||
CPURV_HAS_ZBS,
|
CPURV_HAS_ZBS,
|
||||||
CPURV_HAS_CSR_INSTRUCTIONS, { extension Zicsr }
|
CPURV_HAS_CSR_INSTRUCTIONS, { extension Zicsr }
|
||||||
|
@ -108,6 +108,10 @@ implementation
|
|||||||
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
||||||
else if (tosize=OS_8) and (fromsize<>OS_8) then
|
else if (tosize=OS_8) and (fromsize<>OS_8) then
|
||||||
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
list.Concat(taicpu.op_reg_reg_const(A_ANDI,reg2,reg1,$FF))
|
||||||
|
else if (CPURV_HAS_ZBB in cpu_capabilities[current_settings.cputype]) and (tcgsize2unsigned[tosize]=OS_64) and (fromsize=OS_16) then
|
||||||
|
list.Concat(taicpu.op_reg_reg(A_ZEXT_H,reg2,reg1))
|
||||||
|
else if (CPURV_HAS_ZBB in cpu_capabilities[current_settings.cputype]) and (tosize=OS_16) and (fromsize<>OS_16) then
|
||||||
|
list.Concat(taicpu.op_reg_reg(A_ZEXT_H,reg2,reg1))
|
||||||
else if (tcgsize2size[fromsize] > tcgsize2size[tosize]) or
|
else if (tcgsize2size[fromsize] > tcgsize2size[tosize]) or
|
||||||
((tcgsize2size[fromsize] = tcgsize2size[tosize]) and (fromsize <> tosize)) or
|
((tcgsize2size[fromsize] = tcgsize2size[tosize]) and (fromsize <> tosize)) or
|
||||||
{ do we need to mask out the sign when loading from smaller signed to larger unsigned type? }
|
{ do we need to mask out the sign when loading from smaller signed to larger unsigned type? }
|
||||||
|
@ -124,7 +124,7 @@ Const
|
|||||||
CPURV_HAS_ATOMIC,
|
CPURV_HAS_ATOMIC,
|
||||||
CPURV_HAS_COMPACT,
|
CPURV_HAS_COMPACT,
|
||||||
CPURV_HAS_ZBA,
|
CPURV_HAS_ZBA,
|
||||||
CPURV_HAS_ZBb,
|
CPURV_HAS_ZBB,
|
||||||
CPURV_HAS_ZBC,
|
CPURV_HAS_ZBC,
|
||||||
CPURV_HAS_ZBS,
|
CPURV_HAS_ZBS,
|
||||||
CPURV_HAS_CSR_INSTRUCTIONS, { extension Zicsr }
|
CPURV_HAS_CSR_INSTRUCTIONS, { extension Zicsr }
|
||||||
|
Loading…
Reference in New Issue
Block a user