Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit481890d

Browse files
dsymelatkin
authored andcommitted
teach F# 4.0 compiler about future 4.0+ native intrinsics
Merge pull requestdotnet#16 from dsyme/nativeptr-prep
1 parent0242e6d commit481890d

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

‎src/fsharp/ilxgen.fs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,6 +3137,8 @@ and GenAsmCode cenv cgbuf eenv (il,tyargs,args,returnTys,m) sequel =
31373137
| I_stobj(a,b,ILType.TypeVar_),[tyarg]-> I_stobj(a,b,tyarg)
31383138
| I_ldtoken(ILToken.ILType(ILType.TypeVar_)),[tyarg]-> I_ldtoken(ILToken.ILType(tyarg))
31393139
| I_sizeof(ILType.TypeVar_),[tyarg]-> I_sizeof(tyarg)
3140+
| I_cpobj(ILType.TypeVar_),[tyarg]-> I_cpobj(tyarg)// currently unused, added for forward compat, see https://visualfsharp.codeplex.com/SourceControl/network/forks/jackpappas/fsharpcontrib/contribution/7134
3141+
| I_initobj(ILType.TypeVar_),[tyarg]-> I_initobj(tyarg)// currently unused, added for forward compat, see https://visualfsharp.codeplex.com/SourceControl/network/forks/jackpappas/fsharpcontrib/contribution/7134
31403142
| I_ldfld(al,vol,fspec),_-> I_ldfld(al,vol,modFieldSpec fspec)
31413143
| I_ldflda(fspec),_-> I_ldflda(modFieldSpec fspec)
31423144
| I_stfld(al,vol,fspec),_-> I_stfld(al,vol,modFieldSpec fspec)

‎src/fsharp/pickle.fs‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,10 @@ let [<Literal>] itag_ldelem_any = 59
10651065
let [<Literal>]itag_stelem_any=60
10661066
let [<Literal>]itag_unbox_any=61
10671067
let [<Literal>]itag_ldlen_multi=62
1068+
let [<Literal>]itag_initobj=63// currently unused, added for forward compat, see https://visualfsharp.codeplex.com/SourceControl/network/forks/jackpappas/fsharpcontrib/contribution/7134
1069+
let [<Literal>]itag_initblk=64// currently unused, added for forward compat
1070+
let [<Literal>]itag_cpobj=65// currently unused, added for forward compat
1071+
let [<Literal>]itag_cpblk=66// currently unused, added for forward compat
10681072

10691073
letsimple_instrs=
10701074
[ itag_add, AI_add;
@@ -1099,7 +1103,11 @@ let simple_instrs =
10991103
itag_localloc, I_localloc;
11001104
itag_throw, I_throw;
11011105
itag_ldlen, I_ldlen;
1102-
itag_rethrow, I_rethrow;]
1106+
itag_rethrow, I_rethrow;
1107+
itag_rethrow, I_rethrow;
1108+
itag_initblk, I_initblk(Aligned,Nonvolatile);
1109+
itag_cpblk, I_cpblk(Aligned,Nonvolatile);
1110+
]
11031111

11041112
letencode_table= Dictionary<_,_>(300, HashIdentity.Structural)
11051113
let_= List.iter(fun(icode,i)-> encode_table.[i]<- icode) simple_instrs
@@ -1135,7 +1143,11 @@ let decoders =
11351143
itag_stobj, u_ILType>>(fun c-> I_stobj(Aligned,Nonvolatile,c));
11361144
itag_sizeof, u_ILType>> I_sizeof;
11371145
itag_ldlen_multi, u_tup2 u_int32 u_int32>>(fun(a,b)-> EI_ldlen_multi(a,b));
1138-
itag_ilzero, u_ILType>> EI_ilzero;]
1146+
itag_ilzero, u_ILType>> EI_ilzero;
1147+
itag_ilzero, u_ILType>> EI_ilzero;
1148+
itag_initobj, u_ILType>> I_initobj;
1149+
itag_cpobj, u_ILType>> I_cpobj;
1150+
]
11391151

11401152
letdecode_tab=
11411153
lettab= Array.init256(fun n->(fun st-> ufailwith st("no decoder for instruction"+string n)))
@@ -1180,6 +1192,8 @@ let p_ILInstr x st =
11801192
| I_sizeof ty-> p_byte itag_sizeof st; p_ILType ty st
11811193
| EI_ldlen_multi(n,m)-> p_byte itag_ldlen_multi st; p_tup2 p_int32 p_int32(n,m) st
11821194
| EI_ilzero a-> p_byte itag_ilzero st; p_ILType a st
1195+
| I_initobj c-> p_byte itag_initobj st; p_ILType c st
1196+
| I_cpobj c-> p_byte itag_cpobj st; p_ILType c st
11831197
| i-> pfailwith st(sprintf"the IL instruction '%+A' cannot be emitted" i)
11841198
#endif
11851199

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp