Sha256: 96c261cfcc9b06ccc8479e856187b09050d26d80e3aa711cf76ed1adebb4bd5c
Contents?: true
Size: 648 Bytes
Versions: 6
Compression:
Stored size: 648 Bytes
Contents
# A benchmark for the logic operations. system :logic_bench do [3].inner :x,:y [3].inner :s_not, :s_and, :s_or, :s_xor, :s_nxor signed[16].inner :a,:b,:shl,:shr timed do 8.times do |i| 8.times do |j| x <= i y <= j s_not <= ~x s_and <= x & y s_or <= x | y s_xor <= x ^ y s_nxor <= (x == y) !10.ns a <= i b <= j shl <= (a << b) shr <= (a >> b) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems