aboutsummaryrefslogtreecommitdiff
path: root/isa/rv64uzbb/cpopw.S
blob: 7b73882d76b06f60af6fc6aeddea0ffe6561cfee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# See LICENSE for license details.

#*****************************************************************************
# cpopw.S
#-----------------------------------------------------------------------------
#
# Test cpopw instruction.
#

#include "riscv_test.h"
#include "test_macros.h"

RVTEST_RV64U
RVTEST_CODE_BEGIN

  #-------------------------------------------------------------
  # Arithmetic tests
  #-------------------------------------------------------------

  TEST_R_OP( 2,  cpopw, 0, 0x00000000);
  TEST_R_OP( 3,  cpopw, 1, 0x00000001);
  TEST_R_OP( 4,  cpopw, 2, 0x00000003);

  TEST_R_OP( 5,  cpopw, 17, 0xffff8000 );
  TEST_R_OP( 6,  cpopw, 1, 0x00800000 );
  TEST_R_OP( 7,  cpopw, 18, 0xffff6000 );

  TEST_R_OP( 8,  cpopw, 15, 0x00007fff);
  TEST_R_OP( 9,  cpopw, 31, 0x7fffffff);
  TEST_R_OP( 10, cpopw, 19, 0x0007ffff );

  TEST_R_OP( 11, cpopw, 1, 0x80000000);
  TEST_R_OP( 12, cpopw, 9, 0x121f5000);

  TEST_R_OP( 13, cpopw, 0, 0x00000000);
  TEST_R_OP( 14, cpopw, 3, 0x0000000e);
  TEST_R_OP( 15, cpopw, 7, 0x20401341);

  #-------------------------------------------------------------
  # Source/Destination tests
  #-------------------------------------------------------------

  TEST_R_SRC1_EQ_DEST( 16, cpopw, 3, 13);
  TEST_R_SRC1_EQ_DEST( 17, cpopw, 3, 11);

  #-------------------------------------------------------------
  # Bypassing tests
  #-------------------------------------------------------------

  TEST_R_DEST_BYPASS( 18, 0, cpopw, 3, 13);
  TEST_R_DEST_BYPASS( 29, 1, cpopw, 3, 19);
  TEST_R_DEST_BYPASS( 20, 2, cpopw, 2, 34);

  #-------------------------------------------------------------
  # Other tests
  #-------------------------------------------------------------

  TEST_R_OP( 21,  cpopw, 8, 0x007f8000 );
  TEST_R_OP( 22,  cpopw, 2, 0x00808000 );
  TEST_R_OP( 23,  cpopw, 3, 0x01808000 );

  TEST_R_OP( 24,  cpopw, 17, 0x30007fff);
  TEST_R_OP( 25,  cpopw, 30, 0x77ffffff);
  TEST_R_OP( 26,  cpopw, 19, 0x0007ffff);

  TEST_PASSFAIL

RVTEST_CODE_END

  .data
RVTEST_DATA_BEGIN

  TEST_DATA

RVTEST_DATA_END