LEFT | RIGHT |
(no file at all) | |
1 // Inferno's libkern/vlrt-386.c | 1 // Inferno's libkern/vlrt-386.c |
2 // http://code.google.com/p/inferno-os/source/browse/libkern/vlrt-386.c | 2 // http://code.google.com/p/inferno-os/source/browse/libkern/vlrt-386.c |
3 // | 3 // |
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
5 // Revisions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vita
nuova.com). All rights reserved. | 5 // Revisions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vita
nuova.com). All rights reserved. |
6 // Portions Copyright 2009 The Go Authors. All rights reserved. | 6 // Portions Copyright 2009 The Go Authors. All rights reserved. |
7 // | 7 // |
8 // Permission is hereby granted, free of charge, to any person obtaining a copy | 8 // Permission is hereby granted, free of charge, to any person obtaining a copy |
9 // of this software and associated documentation files (the "Software"), to deal | 9 // of this software and associated documentation files (the "Software"), to deal |
10 // in the Software without restriction, including without limitation the rights | 10 // in the Software without restriction, including without limitation the rights |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 } | 416 } |
417 if(b <= 0) { | 417 if(b <= 0) { |
418 r->hi = t; | 418 r->hi = t; |
419 r->lo = a.lo; | 419 r->lo = a.lo; |
420 return; | 420 return; |
421 } | 421 } |
422 r->hi = t >> b; | 422 r->hi = t >> b; |
423 r->lo = (t << (32-b)) | (a.lo >> b); | 423 r->lo = (t << (32-b)) | (a.lo >> b); |
424 } | 424 } |
425 | 425 |
| 426 #pragma textflag 7 |
426 void | 427 void |
427 _lshv(Vlong *r, Vlong a, int b) | 428 _lshv(Vlong *r, Vlong a, int b) |
428 { | 429 { |
429 ulong t; | 430 ulong t; |
430 | 431 |
431 t = a.lo; | 432 t = a.lo; |
432 if(b >= 32) { | 433 if(b >= 32) { |
433 r->lo = 0; | 434 r->lo = 0; |
434 if(b >= 64) { | 435 if(b >= 64) { |
435 /* this is illegal re C standard */ | 436 /* this is illegal re C standard */ |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 return lv.hi > rv.hi || | 807 return lv.hi > rv.hi || |
807 (lv.hi == rv.hi && lv.lo > rv.lo); | 808 (lv.hi == rv.hi && lv.lo > rv.lo); |
808 } | 809 } |
809 | 810 |
810 int | 811 int |
811 _hsv(Vlong lv, Vlong rv) | 812 _hsv(Vlong lv, Vlong rv) |
812 { | 813 { |
813 return lv.hi > rv.hi || | 814 return lv.hi > rv.hi || |
814 (lv.hi == rv.hi && lv.lo >= rv.lo); | 815 (lv.hi == rv.hi && lv.lo >= rv.lo); |
815 } | 816 } |
LEFT | RIGHT |