]> git.cryptolib.org Git - arm-crypto-lib.git/blob - host/bitslice2asm.rb
further optimized bmw_c_speed
[arm-crypto-lib.git] / host / bitslice2asm.rb
1 #!/usr/bin/ruby
2 #
3 #
4
5 while(!$stdin.eof) do
6 line = $stdin.readline
7
8 if match = /[\s]*((T|IN|OUT)[0-9]{1,2})[\s]*=[\s]*((T|IN|OUT)[0-9]{1,2})[\s]*([|^&])[\s]*((T|IN|OUT)[0-9]{1,2})[\s]*;/.match(line)
9         puts("    mov "+match[1]+", "+match[3])
10         case match[5]
11                 when '|'
12                         conductor = "or  "
13                 when '^'
14                         conductor = "eor "
15                 when '&'
16                         conductor = "and "
17                 else
18                         fprintf($stderr,"ERROR")
19         end
20         puts("    "+conductor+match[1]+", "+match[6])
21
22 else
23         puts(line)
24 end
25
26 end