Changeset 1872 for src/common/Values.ma
- Timestamp:
- Apr 4, 2012, 6:48:23 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/common/Values.ma
r1545 r1872 470 470 should we be able to extract bytes? *) 471 471 472 let rec load_result (chunk: memory_chunk) (v: val) ≝472 let rec load_result (chunk: typ) (v: val) ≝ 473 473 match v with 474 474 [ Vint sz n ⇒ 475 475 match chunk with 476 [ Mint8signed ⇒ match sz with [ I8 ⇒ v | _ ⇒ Vundef ] 477 | Mint8unsigned ⇒ match sz with [ I8 ⇒ v | _ ⇒ Vundef ] 478 | Mint16signed ⇒ match sz with [ I16 ⇒ v | _ ⇒ Vundef ] 479 | Mint16unsigned ⇒ match sz with [ I16 ⇒ v | _ ⇒ Vundef ] 480 | Mint32 ⇒ match sz with [ I32 ⇒ v | _ ⇒ Vundef ] 476 [ ASTint sz' sg ⇒ if eq_intsize sz sz' then v else Vundef 481 477 | _ ⇒ Vundef 482 478 ] 483 479 | Vptr ptr ⇒ 484 480 match chunk with 485 [ Mpointer r ⇒ if eq_region (ptype ptr) r then Vptr ptr else Vundef481 [ ASTptr r ⇒ if eq_region (ptype ptr) r then Vptr ptr else Vundef 486 482 | _ ⇒ Vundef 487 483 ] 488 484 | Vnull r ⇒ 489 485 match chunk with 490 [ Mpointer r' ⇒ if eq_region r r' then Vnull r else Vundef486 [ ASTptr r' ⇒ if eq_region r r' then Vnull r else Vundef 491 487 | _ ⇒ Vundef 492 488 ] 493 489 | Vfloat f ⇒ 494 490 match chunk with 495 [ Mfloat32 ⇒ Vfloat(singleoffloat f) 496 | Mfloat64 ⇒ Vfloat f 491 [ ASTfloat sz ⇒ match sz with [ F32 ⇒ Vfloat(singleoffloat f) | F64 ⇒ Vfloat f ] 497 492 | _ ⇒ Vundef 498 493 ] … … 1085 1080 Val_lessdef v1 v2 → Val_lessdef (load_result chunk v1) (load_result chunk v2). 1086 1081 #chunk #v1 #v2 #H inversion H; //; #v #e1 #e2 #e3 cases chunk 1087 [ 8: #r] whd in ⊢ (?%?); //;1082 [ #sz #sg | #r | #sz ] whd in ⊢ (?%?); //; 1088 1083 qed. 1089 1084
Note: See TracChangeset
for help on using the changeset viewer.