Verified Commit 9449bcd4 authored by nagayama15's avatar nagayama15

add extraction script

parent 225780b3
...@@ -128,7 +128,7 @@ namespace kyut { ...@@ -128,7 +128,7 @@ namespace kyut {
std::iter_swap(it, found); std::iter_swap(it, found);
} }
assert(watermark < (std::uint64_t{1} << bit_width)); // assert(watermark < (std::uint64_t{1} << bit_width));
w.write(watermark, bit_width); w.write(watermark, bit_width);
return bit_width; return bit_width;
......
...@@ -83,3 +83,12 @@ def optimize(file, out, pass) ...@@ -83,3 +83,12 @@ def optimize(file, out, pass)
puts "optimize #{file}, #{out}, #{pass}, #{output}" puts "optimize #{file}, #{out}, #{pass}, #{output}"
end end
def extract(file, method)
out = Pathname(file).sub_ext(".txt")
output = IO.popen([PISN, "-m", method, file.to_s]).read
File.write(out, output)
puts "extract #{file}, #{method}, #{out}"
end
#!/usr/bin/env ruby
require_relative './common'
watermark = WATERMARK
METHODS.each do |method|
WASM_BINARIES.each do |id, file|
dir = Pathname(OUTPUT_DIRS[id])
out = dir + Pathname(file).basename.sub(".wasm", "-#{method[:abbr]}-#{watermark}.wasm")
extract(out, method[:name])
OPT_PASSES.each {|pass| extract(out.sub(".wasm", "-#{pass}.wasm"), method[:name])}
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment