| 1 | 
         2 | 
         alfik | 
         /*
  | 
      
      
         | 2 | 
          | 
          | 
          * Copyright (c) 2014, Aleksander Osman
  | 
      
      
         | 3 | 
          | 
          | 
          * All rights reserved.
  | 
      
      
         | 4 | 
          | 
          | 
          *
  | 
      
      
         | 5 | 
          | 
          | 
          * Redistribution and use in source and binary forms, with or without
  | 
      
      
         | 6 | 
          | 
          | 
          * modification, are permitted provided that the following conditions are met:
  | 
      
      
         | 7 | 
          | 
          | 
          *
  | 
      
      
         | 8 | 
          | 
          | 
          * * Redistributions of source code must retain the above copyright notice, this
  | 
      
      
         | 9 | 
          | 
          | 
          *   list of conditions and the following disclaimer.
  | 
      
      
         | 10 | 
          | 
          | 
          *
  | 
      
      
         | 11 | 
          | 
          | 
          * * Redistributions in binary form must reproduce the above copyright notice,
  | 
      
      
         | 12 | 
          | 
          | 
          *   this list of conditions and the following disclaimer in the documentation
  | 
      
      
         | 13 | 
          | 
          | 
          *   and/or other materials provided with the distribution.
  | 
      
      
         | 14 | 
          | 
          | 
          *
  | 
      
      
         | 15 | 
          | 
          | 
          * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  | 
      
      
         | 16 | 
          | 
          | 
          * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  | 
      
      
         | 17 | 
          | 
          | 
          * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  | 
      
      
         | 18 | 
          | 
          | 
          * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  | 
      
      
         | 19 | 
          | 
          | 
          * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  | 
      
      
         | 20 | 
          | 
          | 
          * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  | 
      
      
         | 21 | 
          | 
          | 
          * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  | 
      
      
         | 22 | 
          | 
          | 
          * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  | 
      
      
         | 23 | 
          | 
          | 
          * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  | 
      
      
         | 24 | 
          | 
          | 
          * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  | 
      
      
         | 25 | 
          | 
          | 
          */
  | 
      
      
         | 26 | 
          | 
          | 
          
  | 
      
      
         | 27 | 
          | 
          | 
         package ao486.test.layers;
  | 
      
      
         | 28 | 
          | 
          | 
          
  | 
      
      
         | 29 | 
          | 
          | 
         import java.util.Random;
  | 
      
      
         | 30 | 
          | 
          | 
          
  | 
      
      
         | 31 | 
          | 
          | 
         public class SegmentLayer extends Layer {
  | 
      
      
         | 32 | 
          | 
          | 
             public SegmentLayer(Random random) {
  | 
      
      
         | 33 | 
          | 
          | 
                 this.random = random;
  | 
      
      
         | 34 | 
          | 
          | 
             }
  | 
      
      
         | 35 | 
          | 
          | 
          
  | 
      
      
         | 36 | 
          | 
          | 
             public long es_cache_valid()   { return 1; }
  | 
      
      
         | 37 | 
          | 
          | 
             public long cs_cache_valid()   { return 1; }
  | 
      
      
         | 38 | 
          | 
          | 
             public long ds_cache_valid()   { return 1; }
  | 
      
      
         | 39 | 
          | 
          | 
             public long ss_cache_valid()   { return 1; }
  | 
      
      
         | 40 | 
          | 
          | 
             public long fs_cache_valid()   { return 1; }
  | 
      
      
         | 41 | 
          | 
          | 
             public long gs_cache_valid()   { return 1; }
  | 
      
      
         | 42 | 
          | 
          | 
             public long ldtr_cache_valid() { return 1; }
  | 
      
      
         | 43 | 
          | 
          | 
             public long tr_cache_valid()   { return 1; }
  | 
      
      
         | 44 | 
          | 
          | 
          
  | 
      
      
         | 45 | 
          | 
          | 
             public long es()        { return 0; }
  | 
      
      
         | 46 | 
          | 
          | 
             public long cs()        { return 0; }
  | 
      
      
         | 47 | 
          | 
          | 
             public long ss()        { return 0; }
  | 
      
      
         | 48 | 
          | 
          | 
             public long ds()        { return 0; }
  | 
      
      
         | 49 | 
          | 
          | 
             public long fs()        { return 0; }
  | 
      
      
         | 50 | 
          | 
          | 
             public long gs()        { return 0; }
  | 
      
      
         | 51 | 
          | 
          | 
             public long ldtr()      { return 0; }
  | 
      
      
         | 52 | 
          | 
          | 
             public long tr()        { return 0; }
  | 
      
      
         | 53 | 
          | 
          | 
          
  | 
      
      
         | 54 | 
          | 
          | 
             public long es_base()   { return 0; }
  | 
      
      
         | 55 | 
          | 
          | 
             public long cs_base()   { return 0; }
  | 
      
      
         | 56 | 
          | 
          | 
             public long ss_base()   { return 0; }
  | 
      
      
         | 57 | 
          | 
          | 
             public long ds_base()   { return 0; }
  | 
      
      
         | 58 | 
          | 
          | 
             public long fs_base()   { return 0; }
  | 
      
      
         | 59 | 
          | 
          | 
             public long gs_base()   { return 0; }
  | 
      
      
         | 60 | 
          | 
          | 
             public long ldtr_base() { return 0; }
  | 
      
      
         | 61 | 
          | 
          | 
             public long tr_base()   { return 0; }
  | 
      
      
         | 62 | 
          | 
          | 
          
  | 
      
      
         | 63 | 
          | 
          | 
             public long es_limit()   { return 0x000FFFFF; }
  | 
      
      
         | 64 | 
          | 
          | 
             public long cs_limit()   { return 0x000FFFFF; }
  | 
      
      
         | 65 | 
          | 
          | 
             public long ss_limit()   { return 0x000FFFFF; }
  | 
      
      
         | 66 | 
          | 
          | 
             public long ds_limit()   { return 0x000FFFFF; }
  | 
      
      
         | 67 | 
          | 
          | 
             public long fs_limit()   { return 0x000FFFFF; }
  | 
      
      
         | 68 | 
          | 
          | 
             public long gs_limit()   { return 0x000FFFFF; }
  | 
      
      
         | 69 | 
          | 
          | 
             public long ldtr_limit() { return 0x000FFFFF; }
  | 
      
      
         | 70 | 
          | 
          | 
             public long tr_limit()   { return 0x000FFFFF; }
  | 
      
      
         | 71 | 
          | 
          | 
          
  | 
      
      
         | 72 | 
          | 
          | 
             public long es_valid()   { return 1; }
  | 
      
      
         | 73 | 
          | 
          | 
             public long cs_valid()   { return 1; }
  | 
      
      
         | 74 | 
          | 
          | 
             public long ss_valid()   { return 1; }
  | 
      
      
         | 75 | 
          | 
          | 
             public long ds_valid()   { return 1; }
  | 
      
      
         | 76 | 
          | 
          | 
             public long fs_valid()   { return 1; }
  | 
      
      
         | 77 | 
          | 
          | 
             public long gs_valid()   { return 1; }
  | 
      
      
         | 78 | 
          | 
          | 
             public long ldtr_valid() { return 1; }
  | 
      
      
         | 79 | 
          | 
          | 
             public long tr_valid()   { return 1; }
  | 
      
      
         | 80 | 
          | 
          | 
          
  | 
      
      
         | 81 | 
          | 
          | 
             public long es_selector()   { return 0; }
  | 
      
      
         | 82 | 
          | 
          | 
             public long cs_selector()   { return 0; }
  | 
      
      
         | 83 | 
          | 
          | 
             public long ss_selector()   { return 0; }
  | 
      
      
         | 84 | 
          | 
          | 
             public long ds_selector()   { return 0; }
  | 
      
      
         | 85 | 
          | 
          | 
             public long fs_selector()   { return 0; }
  | 
      
      
         | 86 | 
          | 
          | 
             public long gs_selector()   { return 0; }
  | 
      
      
         | 87 | 
          | 
          | 
             public long ldtr_selector() { return 0; }
  | 
      
      
         | 88 | 
          | 
          | 
             public long tr_selector()   { return 0; }
  | 
      
      
         | 89 | 
          | 
          | 
          
  | 
      
      
         | 90 | 
          | 
          | 
             public long es_rpl()   { return 0; }
  | 
      
      
         | 91 | 
          | 
          | 
             public long cs_rpl()   { return 0; }
  | 
      
      
         | 92 | 
          | 
          | 
             public long ss_rpl()   { return 0; }
  | 
      
      
         | 93 | 
          | 
          | 
             public long ds_rpl()   { return 0; }
  | 
      
      
         | 94 | 
          | 
          | 
             public long fs_rpl()   { return 0; }
  | 
      
      
         | 95 | 
          | 
          | 
             public long gs_rpl()   { return 0; }
  | 
      
      
         | 96 | 
          | 
          | 
             public long ldtr_rpl() { return 0; }
  | 
      
      
         | 97 | 
          | 
          | 
             public long tr_rpl()   { return 0; }
  | 
      
      
         | 98 | 
          | 
          | 
          
  | 
      
      
         | 99 | 
          | 
          | 
             public long es_g()   { return 0; }
  | 
      
      
         | 100 | 
          | 
          | 
             public long cs_g()   { return 0; }
  | 
      
      
         | 101 | 
          | 
          | 
             public long ss_g()   { return 0; }
  | 
      
      
         | 102 | 
          | 
          | 
             public long ds_g()   { return 0; }
  | 
      
      
         | 103 | 
          | 
          | 
             public long fs_g()   { return 0; }
  | 
      
      
         | 104 | 
          | 
          | 
             public long gs_g()   { return 0; }
  | 
      
      
         | 105 | 
          | 
          | 
             public long ldtr_g() { return 0; }
  | 
      
      
         | 106 | 
          | 
          | 
             public long tr_g()   { return 0; }
  | 
      
      
         | 107 | 
          | 
          | 
          
  | 
      
      
         | 108 | 
          | 
          | 
             public long es_d_b()   { return 0; }
  | 
      
      
         | 109 | 
          | 
          | 
             public long cs_d_b()   { return 0; }
  | 
      
      
         | 110 | 
          | 
          | 
             public long ss_d_b()   { return 0; }
  | 
      
      
         | 111 | 
          | 
          | 
             public long ds_d_b()   { return 0; }
  | 
      
      
         | 112 | 
          | 
          | 
             public long fs_d_b()   { return 0; }
  | 
      
      
         | 113 | 
          | 
          | 
             public long gs_d_b()   { return 0; }
  | 
      
      
         | 114 | 
          | 
          | 
             public long ldtr_d_b() { return 0; }
  | 
      
      
         | 115 | 
          | 
          | 
             public long tr_d_b()   { return 0; }
  | 
      
      
         | 116 | 
          | 
          | 
          
  | 
      
      
         | 117 | 
          | 
          | 
             public long es_avl()   { return 0; }
  | 
      
      
         | 118 | 
          | 
          | 
             public long cs_avl()   { return 0; }
  | 
      
      
         | 119 | 
          | 
          | 
             public long ss_avl()   { return 0; }
  | 
      
      
         | 120 | 
          | 
          | 
             public long ds_avl()   { return 0; }
  | 
      
      
         | 121 | 
          | 
          | 
             public long fs_avl()   { return 0; }
  | 
      
      
         | 122 | 
          | 
          | 
             public long gs_avl()   { return 0; }
  | 
      
      
         | 123 | 
          | 
          | 
             public long ldtr_avl() { return 0; }
  | 
      
      
         | 124 | 
          | 
          | 
             public long tr_avl()   { return 0; }
  | 
      
      
         | 125 | 
          | 
          | 
          
  | 
      
      
         | 126 | 
          | 
          | 
             public long es_p()   { return 1; }
  | 
      
      
         | 127 | 
          | 
          | 
             public long cs_p()   { return 1; }
  | 
      
      
         | 128 | 
          | 
          | 
             public long ss_p()   { return 1; }
  | 
      
      
         | 129 | 
          | 
          | 
             public long ds_p()   { return 1; }
  | 
      
      
         | 130 | 
          | 
          | 
             public long fs_p()   { return 1; }
  | 
      
      
         | 131 | 
          | 
          | 
             public long gs_p()   { return 1; }
  | 
      
      
         | 132 | 
          | 
          | 
             public long ldtr_p() { return 1; }
  | 
      
      
         | 133 | 
          | 
          | 
             public long tr_p()   { return 1; }
  | 
      
      
         | 134 | 
          | 
          | 
          
  | 
      
      
         | 135 | 
          | 
          | 
             public long es_dpl()   { return 0; }
  | 
      
      
         | 136 | 
          | 
          | 
             public long cs_dpl()   { return 0; }
  | 
      
      
         | 137 | 
          | 
          | 
             public long ss_dpl()   { return 0; }
  | 
      
      
         | 138 | 
          | 
          | 
             public long ds_dpl()   { return 0; }
  | 
      
      
         | 139 | 
          | 
          | 
             public long fs_dpl()   { return 0; }
  | 
      
      
         | 140 | 
          | 
          | 
             public long gs_dpl()   { return 0; }
  | 
      
      
         | 141 | 
          | 
          | 
             public long ldtr_dpl() { return 0; }
  | 
      
      
         | 142 | 
          | 
          | 
             public long tr_dpl()   { return 0; }
  | 
      
      
         | 143 | 
          | 
          | 
          
  | 
      
      
         | 144 | 
          | 
          | 
             public long es_s()     { return 1; }
  | 
      
      
         | 145 | 
          | 
          | 
             public long cs_s()     { return 1; }
  | 
      
      
         | 146 | 
          | 
          | 
             public long ss_s()     { return 1; }
  | 
      
      
         | 147 | 
          | 
          | 
             public long ds_s()     { return 1; }
  | 
      
      
         | 148 | 
          | 
          | 
             public long fs_s()     { return 1; }
  | 
      
      
         | 149 | 
          | 
          | 
             public long gs_s()     { return 1; }
  | 
      
      
         | 150 | 
          | 
          | 
             public long ldtr_s()   { return 1; }
  | 
      
      
         | 151 | 
          | 
          | 
             public long tr_s()     { return 1; }
  | 
      
      
         | 152 | 
          | 
          | 
          
  | 
      
      
         | 153 | 
          | 
          | 
             // data read write accessed
  | 
      
      
         | 154 | 
          | 
          | 
             public long es_type()   { return 3; }
  | 
      
      
         | 155 | 
          | 
          | 
             public long cs_type()   { return 3; }
  | 
      
      
         | 156 | 
          | 
          | 
             public long ss_type()   { return 3; }
  | 
      
      
         | 157 | 
          | 
          | 
             public long ds_type()   { return 3; }
  | 
      
      
         | 158 | 
          | 
          | 
             public long fs_type()   { return 3; }
  | 
      
      
         | 159 | 
          | 
          | 
             public long gs_type()   { return 3; }
  | 
      
      
         | 160 | 
          | 
          | 
             public long ldtr_type() { return 3; }
  | 
      
      
         | 161 | 
          | 
          | 
             public long tr_type()   { return 3; }
  | 
      
      
         | 162 | 
          | 
          | 
         }
  |