Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: src/trusted/validator_ragel/testdata/64/bt.test

Issue 18553004: Add more instructions to text-based spec. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: only allow bt* with immediate Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/validator_ragel/testdata/64/bswap.test ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_ragel/testdata/64/bt.test
diff --git a/src/trusted/validator_ragel/testdata/64/bt.test b/src/trusted/validator_ragel/testdata/64/bt.test
index d706068f13aec701cda01ac3ff5abd2c83de90f1..cb2dce7fb88abf552ad58b80a6f8af8e84d58969 100644
--- a/src/trusted/validator_ragel/testdata/64/bt.test
+++ b/src/trusted/validator_ragel/testdata/64/bt.test
@@ -1,11 +1,14 @@
@hex:
- # Test illegal bit commands.
+ # bt* with register offset and memory as second operand is illegal,
+ # because bit offset can be arbitrarily large.
48 0F B3 00
@dis:
0: 48 0f b3 00 btr %rax,(%rax)
@rdfa_output:
0: [0] unrecognized instruction
return code: 1
+@spec:
+ 0: ('bt* is only allowed with immediate as bit offset', Instruction(0x0: 48 0f b3 00 btr %rax,(%rax)))
----------------------------------------------------------------------
@hex:
48 0F AB 00
@@ -14,6 +17,8 @@
@rdfa_output:
0: [0] unrecognized instruction
return code: 1
+@spec:
+ 0: ('bt* is only allowed with immediate as bit offset', Instruction(0x0: 48 0f ab 00 bts %rax,(%rax)))
----------------------------------------------------------------------
@hex:
48 0F BB 00
@@ -22,6 +27,8 @@
@rdfa_output:
0: [0] unrecognized instruction
return code: 1
+@spec:
+ 0: ('bt* is only allowed with immediate as bit offset', Instruction(0x0: 48 0f bb 00 btc %rax,(%rax)))
----------------------------------------------------------------------
@hex:
0F BA 30 01
@@ -30,6 +37,8 @@
@rdfa_output:
0: [0] improper memory address - bad base
return code: 1
+@spec:
+ 0: ("memory access only is allowed with base from ['%r15', '%rbp', '%rsp', '%rip']", Instruction(0x0: 0f ba 30 01 btrl $0x1,(%rax)))
----------------------------------------------------------------------
@hex:
0F BA 28 01
@@ -38,6 +47,8 @@
@rdfa_output:
0: [0] improper memory address - bad base
return code: 1
+@spec:
+ 0: ("memory access only is allowed with base from ['%r15', '%rbp', '%rsp', '%rip']", Instruction(0x0: 0f ba 28 01 btsl $0x1,(%rax)))
----------------------------------------------------------------------
@hex:
0F BA 38 01
@@ -46,20 +57,38 @@
@rdfa_output:
0: [0] improper memory address - bad base
return code: 1
+@spec:
+ 0: ("memory access only is allowed with base from ['%r15', '%rbp', '%rsp', '%rip']", Instruction(0x0: 0f ba 38 01 btcl $0x1,(%rax)))
+----------------------------------------------------------------------
+@hex:
+ 66 41 0f a3 07
+@dis:
+ 0: 66 41 0f a3 07 bt %ax,(%r15)
+@rdfa_output:
+ 0: [0] unrecognized instruction
+ return code: 1
+@spec:
+ 0: ('bt* is only allowed with immediate as bit offset', Instruction(0x0: 66 41 0f a3 07 bt %ax,(%r15)))
+----------------------------------------------------------------------
+@hex:
+ # Technically safe, but for some reason validator only allows immediate
+ # for first operand.
+ 48 0f a3 c3
+@dis:
+ 0: 48 0f a3 c3 bt %rax,%rbx
+@rdfa_output:
+ 0: [0] unrecognized instruction
+ return code: 1
+@spec:
+ 0: ('bt* is only allowed with immediate as bit offset', Instruction(0x0: 48 0f a3 c3 bt %rax,%rbx))
----------------------------------------------------------------------
@hex:
# Test legal bit commands
- # btw $0x1,(%rsp)
66 0F BA 24 24 01
- # btl $0x1,(%rsp)
0F BA 24 24 01
- # btq $0x1,(%rsp)
48 0F BA 24 24 01
- # btrl $0x1,(%rsp)
0F BA 34 24 01
- # btsl $0x1,(%rsp)
0F BA 2C 24 01
- # btcl $0x1,(%rsp)
0F BA 3C 24 01
@dis:
0: 66 0f ba 24 24 01 btw $0x1,(%rsp)
@@ -70,3 +99,16 @@
1b: 0f ba 3c 24 01 btcl $0x1,(%rsp)
@rdfa_output:
return code: 0
+@spec:
+ SAFE
+----------------------------------------------------------------------
+@hex:
+ 48 0f ba e0 01
+ 48 0f ba fb 01
+@dis:
+ 0: 48 0f ba e0 01 bt $0x1,%rax
+ 5: 48 0f ba fb 01 btc $0x1,%rbx
+@rdfa_output:
+ return code: 0
+@spec:
+ SAFE
« no previous file with comments | « src/trusted/validator_ragel/testdata/64/bswap.test ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698