1 /* -*- mode: C; c-basic-offset: 3; -*- */
4 This file is part of MemCheck, a heavyweight Valgrind tool for
5 detecting memory errors.
7 Copyright (C) 2012-2017 Florian Krohm
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, see <http://www.gnu.org/licenses/>.
22 The GNU General Public License is contained in the file COPYING.
32 typedef uint64_t uint128_t
[2];
33 typedef uint64_t uint256_t
[4];
35 /* A type to represent V-bits */
49 /* A type large enough to hold any IRType'd value. At this point
50 we do not expect to test with specific floating point values.
51 So we don't need to represent them. */
62 void print_vbits(FILE *, vbits_t
);
63 vbits_t
undefined_vbits(unsigned num_bits
);
64 vbits_t
undefined_vbits_BxE(unsigned int bits
, unsigned int elements
,
66 vbits_t
undefined_vbits_BxE_rotate(unsigned int bits
, unsigned int elements
,
69 vbits_t
undefined_vbits_128_even_element(unsigned int bits
,
70 unsigned int elements
, vbits_t v
);
71 vbits_t
undefined_vbits_64x2_transpose(vbits_t v
);
72 vbits_t
undefined_vbits_Narrow256_AtoB(unsigned int src_num_bits
,
73 unsigned int result_num_bits
,
74 vbits_t src1_v
, value_t src1_value
,
75 vbits_t src2_v
, value_t src2_value
,
77 vbits_t
defined_vbits(unsigned num_bits
);
78 int equal_vbits(vbits_t
, vbits_t
);
79 vbits_t
truncate_vbits(vbits_t
, unsigned num_bits
);
80 vbits_t
left_vbits(vbits_t
, unsigned num_bits
);
81 vbits_t
or_vbits(vbits_t
, vbits_t
);
82 vbits_t
and_vbits(vbits_t
, vbits_t
);
83 vbits_t
concat_vbits(vbits_t
, vbits_t
);
84 vbits_t
upper_vbits(vbits_t
);
85 vbits_t
sextend_vbits(vbits_t
, unsigned num_bits
);
86 vbits_t
zextend_vbits(vbits_t
, unsigned num_bits
);
87 vbits_t
onehot_vbits(unsigned bitno
, unsigned num_bits
);
88 vbits_t
shl_vbits(vbits_t
, unsigned amount
);
89 vbits_t
shr_vbits(vbits_t
, unsigned amount
);
90 vbits_t
sar_vbits(vbits_t
, unsigned amount
);
91 int completely_defined_vbits(vbits_t
);
92 vbits_t
cmpord_vbits(unsigned v1_num_bits
, unsigned v2_num_bits
);
93 vbits_t
cmp_eq_ne_vbits(vbits_t vbits1
, vbits_t vbits2
,
94 value_t val1
, value_t val2
);
95 uint64_t min_vbits(uint64_t vbits
, uint64_t value
);
96 uint64_t max_vbits(uint64_t vbits
, uint64_t value
);
97 vbits_t
int_add_or_sub_vbits(int isAdd
,
98 vbits_t vbits1
, vbits_t vbits2
,
99 value_t val1
, value_t val2
);
100 vbits_t
cmp_gt_vbits(int is_signed
, int bits_per_element
, int element_count
,
101 vbits_t vbits1
, vbits_t vbits2
, value_t val1
, value_t val2
);