NMSIS-Core  Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices

32-bit Packing Instructions More...

Functions

__STATIC_FORCEINLINE unsigned long __RV_PKBB32 (unsigned long a, unsigned long b)
 PKBB32 (Pack Two 32-bit Data from Both Bottom Half) More...
 
__STATIC_FORCEINLINE unsigned long __RV_PKBT32 (unsigned long a, unsigned long b)
 PKBT32 (Pack Two 32-bit Data from Bottom and Top Half) More...
 
__STATIC_FORCEINLINE unsigned long __RV_PKTT32 (unsigned long a, unsigned long b)
 PKTT32 (Pack Two 32-bit Data from Both Top Half) More...
 
__STATIC_FORCEINLINE unsigned long __RV_PKTB32 (unsigned long a, unsigned long b)
 PKTB32 (Pack Two 32-bit Data from Top and Bottom Half) More...
 

Detailed Description

32-bit Packing Instructions

There are four 32-bit packing instructions here

Function Documentation

◆ __RV_PKBB32()

__STATIC_FORCEINLINE unsigned long __RV_PKBB32 ( unsigned long  a,
unsigned long  b 
)

PKBB32 (Pack Two 32-bit Data from Both Bottom Half)

Type: DSP (RV64 Only)

Syntax:

PKBB32 Rd, Rs1, Rs2
PKBT32 Rd, Rs1, Rs2
PKTT32 Rd, Rs1, Rs2
PKTB32 Rd, Rs1, Rs2

Purpose:
Pack 32-bit data from 64-bit chunks in two registers.

  • PKBB32: bottom.bottom
  • PKBT32: bottom.top
  • PKTT32: top.top
  • PKTB32: top.bottom

Description:
(PKBB32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0]. (PKBT32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTT32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTB32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0].

Operations:

Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*0*_]); // PKBB32
Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*1*_]); // PKBT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*1*_]); // PKTT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*0*_]); // PKTB32
Parameters
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 15749 of file core_feature_dsp.h.

15750 {
15751  unsigned long result;
15752  __ASM volatile("pkbb32 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
15753  return result;
15754 }

References __ASM.

◆ __RV_PKBT32()

__STATIC_FORCEINLINE unsigned long __RV_PKBT32 ( unsigned long  a,
unsigned long  b 
)

PKBT32 (Pack Two 32-bit Data from Bottom and Top Half)

Type: DSP (RV64 Only)

Syntax:

PKBB32 Rd, Rs1, Rs2
PKBT32 Rd, Rs1, Rs2
PKTT32 Rd, Rs1, Rs2
PKTB32 Rd, Rs1, Rs2

Purpose:
Pack 32-bit data from 64-bit chunks in two registers.

  • PKBB32: bottom.bottom
  • PKBT32: bottom.top
  • PKTT32: top.top
  • PKTB32: top.bottom

Description:
(PKBB32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0]. (PKBT32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTT32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTB32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0].

Operations:

Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*0*_]); // PKBB32
Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*1*_]); // PKBT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*1*_]); // PKTT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*0*_]); // PKTB32
Parameters
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 15797 of file core_feature_dsp.h.

15798 {
15799  unsigned long result;
15800  __ASM volatile("pkbt32 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
15801  return result;
15802 }

References __ASM.

◆ __RV_PKTB32()

__STATIC_FORCEINLINE unsigned long __RV_PKTB32 ( unsigned long  a,
unsigned long  b 
)

PKTB32 (Pack Two 32-bit Data from Top and Bottom Half)

Type: DSP (RV64 Only)

Syntax:

PKBB32 Rd, Rs1, Rs2
PKBT32 Rd, Rs1, Rs2
PKTT32 Rd, Rs1, Rs2
PKTB32 Rd, Rs1, Rs2

Purpose:
Pack 32-bit data from 64-bit chunks in two registers.

  • PKBB32: bottom.bottom
  • PKBT32: bottom.top
  • PKTT32: top.top
  • PKTB32: top.bottom

Description:
(PKBB32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0]. (PKBT32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTT32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTB32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0].

Operations:

Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*0*_]); // PKBB32
Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*1*_]); // PKBT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*1*_]); // PKTT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*0*_]); // PKTB32
Parameters
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 15893 of file core_feature_dsp.h.

15894 {
15895  unsigned long result;
15896  __ASM volatile("pktb32 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
15897  return result;
15898 }

References __ASM.

◆ __RV_PKTT32()

__STATIC_FORCEINLINE unsigned long __RV_PKTT32 ( unsigned long  a,
unsigned long  b 
)

PKTT32 (Pack Two 32-bit Data from Both Top Half)

Type: DSP (RV64 Only)

Syntax:

PKBB32 Rd, Rs1, Rs2
PKBT32 Rd, Rs1, Rs2
PKTT32 Rd, Rs1, Rs2
PKTB32 Rd, Rs1, Rs2

Purpose:
Pack 32-bit data from 64-bit chunks in two registers.

  • PKBB32: bottom.bottom
  • PKBT32: bottom.top
  • PKTT32: top.top
  • PKTB32: top.bottom

Description:
(PKBB32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0]. (PKBT32) moves Rs1.W[0] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTT32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[1] to Rd.W[0]. (PKTB32) moves Rs1.W[1] to Rd.W[1] and moves Rs2.W[0] to Rd.W[0].

Operations:

Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*0*_]); // PKBB32
Rd = CONCAT(Rs1.W[_*0*_], Rs2.W[_*1*_]); // PKBT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*1*_]); // PKTT32
Rd = CONCAT(Rs1.W[_*1*_], Rs2.W[_*0*_]); // PKTB32
Parameters
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 15845 of file core_feature_dsp.h.

15846 {
15847  unsigned long result;
15848  __ASM volatile("pktt32 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
15849  return result;
15850 }

References __ASM.

__ASM
#define __ASM
Pass information from the compiler to the assembler.
Definition: nmsis_gcc.h:55