Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /dev-notes/primop-list.md
ViewVC logotype

Diff of /dev-notes/primop-list.md

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5099, Sat May 4 13:31:54 2019 UTC revision 5160, Fri May 10 15:03:10 2019 UTC
# Line 527  Line 527 
527      `P.IARITH{oper=P.IMUL, sz=32}`      `P.IARITH{oper=P.IMUL, sz=32}`
528    
529    * `int32_div : int32 * int32 -> int32`<br/>    * `int32_div : int32 * int32 -> int32`<br/>
530      `P.IARITH{oper=P.IQUOT, sz=32}`      `P.INLDIV(P.INT 32)`
531    
532    * `int32_mod : int32 * int32 -> int32`<br/>    * `int32_mod : int32 * int32 -> int32`<br/>
533      `P.IARITH{oper=P.IREM, sz=32}`      `P.INLMOD(P.INT 32)`
534    
535    * `int32_quot : int32 * int32 -> int32`<br/>    * `int32_quot : int32 * int32 -> int32`<br/>
536      `P.IARITH{oper=P.IQUOT, sz=32}`      `P.INLQUOT(P.INT 32)`
537    
538    * `int32_rem : int32 * int32 -> int32`<br/>    * `int32_rem : int32 * int32 -> int32`<br/>
539      `P.IARITH{oper=P.IREM, sz=32}`      `P.INLREM(P.INT 32)`
540    
541    * `int32_neg : word32 -> word32`<br/>    * `int32_neg : word32 -> word32`<br/>
542      `P.IARITH{oper=P.INEG, sz=32}`      `P.IARITH{oper=P.INEG, sz=32}`
# Line 570  Line 570 
570    
571  #### 8-bit word operations  #### 8-bit word operations
572    
573      * `word8_add : word8 * word8 -> word8`<br/>
574        `P.PURE_ARITH{oper=P.ADD, kind=P.UINT 8}`
575    
576      * `word8_sub : word8 * word8 -> word8`<br/>
577        `P.PURE_ARITH{oper=P.SUB, kind=P.UINT 8}`
578    
579    * `word8_mul : word8 * word8 -> word8`<br/>    * `word8_mul : word8 * word8 -> word8`<br/>
580      `P.PURE_ARITH{oper=P.MUL, kind=P.UINT 8}`      `P.PURE_ARITH{oper=P.MUL, kind=P.UINT 8}`
581    
582    * `word8_div : word8 * word8 -> word8`<br/>    * `word8_div : word8 * word8 -> word8`<br/>
583      `P.PURE_ARITH{oper=P.QUOT, kind=P.UINT 8}`      `P.INLQUOT(P.UINT 8)`
584    
585    * `word8_mod : word8 * word8 -> word8`<br/>    * `word8_mod : word8 * word8 -> word8`<br/>
586      `P.PURE_ARITH{oper=P.REM, kind=P.UINT 8}`      `P.INLREM(P.UINT 8)`
   
   * `word8_add : word8 * word8 -> word8`<br/>  
     `P.PURE_ARITH{oper=P.ADD, kind=P.UINT 8}`  
   
   * `word8_sub : word8 * word8 -> word8`<br/>  
     `P.PURE_ARITH{oper=P.SUB, kind=P.UINT 8}`  
587    
588    * `word8_orb : word8 * word8 -> word8`<br/>    * `word8_orb : word8 * word8 -> word8`<br/>
589      `P.PURE_ARITH{oper=P.ORB, kind=P.UINT 8}`      `P.PURE_ARITH{oper=P.ORB, kind=P.UINT 8}`
# Line 647  Line 647 
647  machines and are just wrappers for 63-bit tagged word operations  machines and are just wrappers for 63-bit tagged word operations
648  on 64-bit machines.  on 64-bit machines.
649    
650      * `word32_add : word32 * word32 -> word32`<br/>
651        `P.PURE_ARITH{oper=P.ADD, kind=P.UINT 32}`
652    
653      * `word32_sub : word32 * word32 -> word32`<br/>
654        `P.PURE_ARITH{oper=P.SUB, kind=P.UINT 32}`
655    
656    * `word32_mul : word32 * word32 -> word32`<br/>    * `word32_mul : word32 * word32 -> word32`<br/>
657      `P.PURE_ARITH{oper=P.MUL, kind=P.UINT 32}`      `P.PURE_ARITH{oper=P.MUL, kind=P.UINT 32}`
658    
659    * `word32_div : word32 * word32 -> word32`<br/>    * `word32_div : word32 * word32 -> word32`<br/>
660      `P.PURE_ARITH{oper=P.QUOT, kind=P.UINT 32}`      `P.INLQUOT(P.UINT 32)`
661    
662    * `word32_mod : word32 * word32 -> word32`<br/>    * `word32_mod : word32 * word32 -> word32`<br/>
663      `P.PURE_ARITH{oper=P.REM, kind=P.UINT 32}`      `P.INLREM(P.UINT 32)`
   
   * `word32_add : word32 * word32 -> word32`<br/>  
     `P.PURE_ARITH{oper=P.ADD, kind=P.UINT 32}`  
   
   * `word32_sub : word32 * word32 -> word32`<br/>  
     `P.PURE_ARITH{oper=P.SUB, kind=P.UINT 32}`  
664    
665    * `word32_orb : word32 * word32 -> word32`<br/>    * `word32_orb : word32 * word32 -> word32`<br/>
666      `P.PURE_ARITH{oper=P.ORB, kind=P.UINT 32}`      `P.PURE_ARITH{oper=P.ORB, kind=P.UINT 32}`
# Line 733  Line 733 
733      `P.IARITH{oper=P.IMUL, sz=64}`      `P.IARITH{oper=P.IMUL, sz=64}`
734    
735    * `int64_div : int64 * int64 -> int64`<br/>    * `int64_div : int64 * int64 -> int64`<br/>
736      `P.IARITH{oper=P.IQUOT, sz=64}`      `P.INLDIV(P.INT 64)`
737    
738    * `int64_mod : int64 * int64 -> int64`<br/>    * `int64_mod : int64 * int64 -> int64`<br/>
739      `P.IARITH{oper=P.IREM, sz=64}`      `P.INLMOD(P.INT 64)`
740    
741    * `int64_quot : int64 * int64 -> int64`<br/>    * `int64_quot : int64 * int64 -> int64`<br/>
742      `P.IARITH{oper=P.IQUOT, sz=64}`      `P.INLQUOT(P.INT 64)`
743    
744    * `int64_rem : int64 * int64 -> int64`<br/>    * `int64_rem : int64 * int64 -> int64`<br/>
745      `P.IARITH{oper=P.IREM, sz=64}`      `P.INLREM(P.INT 64)`
746    
747    * `int64_neg : word32 -> word32`<br/>    * `int64_neg : word32 -> word32`<br/>
748      `P.IARITH{oper=P.INEG, sz=64}`      `P.IARITH{oper=P.INEG, sz=64}`
# Line 778  Line 778 
778  **Note:** 64-bit word operations are currently not supported in the compiler,  **Note:** 64-bit word operations are currently not supported in the compiler,
779  but we expect to add them in 110.88.  but we expect to add them in 110.88.
780    
781      * `word64_add : word64 * word64 -> word64`<br/>
782        `P.PURE_ARITH{oper=P.ADD, kind=P.UINT 64}`
783    
784      * `word64_sub : word64 * word64 -> word64`<br/>
785        `P.PURE_ARITH{oper=P.SUB, kind=P.UINT 64}`
786    
787    * `word64_mul : word64 * word64 -> word64`<br/>    * `word64_mul : word64 * word64 -> word64`<br/>
788      `P.PURE_ARITH{oper=P.MUL, kind=P.UINT 64}`      `P.PURE_ARITH{oper=P.MUL, kind=P.UINT 64}`
789    
790    * `word64_div : word64 * word64 -> word64`<br/>    * `word64_div : word64 * word64 -> word64`<br/>
791      `P.PURE_ARITH{oper=P.QUOT, kind=P.UINT 64}`      `P.INLQUOT(P.UINT 32)`
792    
793    * `word64_mod : word64 * word64 -> word64`<br/>    * `word64_mod : word64 * word64 -> word64`<br/>
794      `P.PURE_ARITH{oper=P.REM, kind=P.UINT 64}`      `P.INLREM(P.UINT 32)`
   
   * `word64_add : word64 * word64 -> word64`<br/>  
     `P.PURE_ARITH{oper=P.ADD, kind=P.UINT 64}`  
   
   * `word64_sub : word64 * word64 -> word64`<br/>  
     `P.PURE_ARITH{oper=P.SUB, kind=P.UINT 64}`  
795    
796    * `word64_orb : word64 * word64 -> word64`<br/>    * `word64_orb : word64 * word64 -> word64`<br/>
797      `P.PURE_ARITH{oper=P.ORB, kind=P.UINT 64}`      `P.PURE_ARITH{oper=P.ORB, kind=P.UINT 64}`
# Line 1066  Line 1066 
1066      `P.TEST_INF 64`      `P.TEST_INF 64`
1067    
1068    * `int_to_word64 : int -> word64`<br/>    * `int_to_word64 : int -> word64`<br/>
1069      `P.EXTEND(31, 64)` (64-bit target) or      `P.EXTEND(31, 64)` (32-bit target) or
1070      `P.TRUNC(63, 64)` (64-bit target).      `P.TRUNC(63, 64)` (64-bit target).
1071    
1072    * `unsigned_word64_to_int : word64 -> int`<br/>    * `unsigned_word64_to_int : word64 -> int`<br/>
1073      `P.TESTU(64, 31)` (64-bit target) or      `P.TESTU(64, 31)` (32-bit target) or
1074      `P.COPY(64, 63)` (64-bit target).      `P.COPY(64, 63)` (64-bit target).
1075    
1076    * `signed_word64_to_int : word64 -> int`<br/>    * `signed_word64_to_int : word64 -> int`<br/>
1077      `P.TEST(64, 31)` (64-bit target) or      `P.TEST(64, 31)` (32-bit target) or
1078      `P.EXTEND(64, 63)` (64-bit target).      `P.EXTEND(64, 63)` (64-bit target).
1079    
1080    * `unsigned_word64_to_intinf : word64 -> intinf`<br/>    * `unsigned_word64_to_intinf : word64 -> intinf`<br/>
# Line 1124  Line 1124 
1124  `system/smlnj/init/core-int64.sml`, and `system/smlnj/init/core-word64.sml`.  `system/smlnj/init/core-int64.sml`, and `system/smlnj/init/core-word64.sml`.
1125    
1126    * `trunc_int32_to_word : int32 -> word`<br/>    * `trunc_int32_to_word : int32 -> word`<br/>
1127      `P.TRUNC(32, intSz)`      `P.TRUNC(32, 31)`
1128    
1129      * `trunc_word32_to_int : word32 -> int`<br/>
1130        `P.TRUNC(32, 31)`
1131    
1132    * `copy_int32_to_word32 : int32 -> word32`<br/>    * `copy_int32_to_word32 : int32 -> word32`<br/>
1133      `P.COPY(32, 32)`      `P.COPY(32, 32)`
# Line 1334  Line 1337 
1337    
1338    * `raw_update_float64 : 'a * raw_ptr * real -> unit`<br />    * `raw_update_float64 : 'a * raw_ptr * real -> unit`<br />
1339      `P.RAW_STORE(P.FLOAT 64)`      `P.RAW_STORE(P.FLOAT 64)`
1340    
1341    
1342    ## Changes to support 64-bit targets
1343    
1344    While most of the 32-bit dependencies have been eliminated in Version 110.87,
1345    there are still a few cases where the primop names for 32-bit and 64-bit
1346    targets will be different.  To address this issue, we should introduce two
1347    type aliases:
1348    
1349      * `type lint` -- this should be the `FixedInt.int` type.
1350    
1351      * `type lword` -- this should be the `LargeWord.word` type.
1352    
1353    Then we can replace uses of `int32` and `word32` with these where it makes sense.

Legend:
Removed from v.5099  
changed lines
  Added in v.5160

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0